CDCP.jl Documentation

CDCP.naive!Method
naive!(J::AbstractVector{Bool}; obj)

Solve in-place a combinatorial discrete choice problem with simple brute force. (Generally used for testing or time-trial exercises.) The solver expectes a pre-allocated Boolean vector J and objective function obj(J).

See also: naive, solve!, policy

source
CDCP.naiveMethod
naive(C::Integer; obj)

Solve a combinatorial discrete choice problem over C choices with simple brute force. (Generally used for testing or time-trial exercises.) The solver an objective function π(J).

See also: naive!, solve!, policy

source
CDCP.policyMethod
policy(C::Integer; scdca::Bool, obj, equalise_obj, [D_j_obj, zero_D_j_obj])

Find the policy function for a combinatorial discrete choice problem over C choices and one dimension of heterogeneity with SCD-C from above if scdca is true (otherwise, from below) and SCD-T. The solver uses the objective function obj(J, z), which must accept as argument a Boolean vector with length C and the heterogeneous component z and the equalise_obj((J1, J2), l, r) function, which identifies the z where the agent is indifferent between the pair (J1, J2). The routine provides the interval [l, r] along which this search is performed; if the marginal type is not in the interval, it is sufficient to return nothing.

The solver can optionally take D_j_obj(j, J, z) and zero_D_j_obj(j, J, l, r), user-supplied functions. The first is the marginal value function, while the second identifies the z where the marginal value of item j to set J is zero. For the second, the solver provides the interval [l, r] within which this marginal type is located. It is sufficient to return nothing is the marginal type is not within the interval. If not provided, the solver automatically constructs these using the equalise_obj function.

See also: solve!, solve

source
CDCP.solve!Method
solve!((sub, sup, aux); scdca::Bool, obj, [D_j_obj; containers])

Solve in-place a combinatorial discrete choice problem with SCD-C from above if scdca is true (otherwise, from below). The solver uses the preallocated Boolean vectors (sub, sup, aux) as well as the objective function obj(J). The objective function obj must accept as argument a Boolean vector with length corresponding to the number of items in the problem.

The solver can optionally take D_j_obj(j, J), a user-supplied marginal value function; otherwise it will construct one automatically given π. It may also optionally take preallocated containers = (working, converged), where working and converged are both Vectors with element type matching (sub, sup, aux). These are used for the branching step and will be automatically allocated if not supplied.

See also: solve, policy

source
CDCP.solveMethod
solve(C::Integer; scdca::Bool, obj, [D_j_obj; containers])

Solve a combinatorial discrete choice problem over C choices with SCD-C from above if scdca is true (otherwise, from below). The solver uses the objective function obj(J) which must accept as argument a Boolean vector with length corresponding to the number of items in the problem.

The solver can optionally take D_j_obj(j, J), a user-supplied marginal value function; otherwise it will construct one automatically given obj. It may also optionally take preallocated containers = (working, converged), where working and converged are both Vectors with element type matching (sub, sup, aux). These are used for the branching step and will be automatically allocated if not supplied.

See also: solve!, policy

source