Backwards-compatible methods
CommonSolve.solve
— Methodsolve(C::Integer; scdca::Bool, obj)
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 of length C
.
CommonSolve.solve!
— Methodsolve!((sub, sup, aux); scdca::Bool, obj, restart::Bool=true)
Solve in-place a combinatorial discrete choice problem with SCD-C from above if scdca
is true (otherwise, from below). The solver uses the objective function obj(J)
and initiates using the Boolean vectors (sub, sup, aux)
if restart=false
. The objective function obj
must accept as argument a Boolean vector with length corresponding to the number of items in the problem.
CDCP.policy
— Methodpolicy(C::Integer; scdca::Bool, obj, equalise_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.
The solver can optionally take zero_D_j_obj(j, J, l, r)
, a user-supplied function that identifies the z
where the marginal value of item j
to set J
is zero. The solver provides the interval [l, r]
within which this marginal type is located. If not provided, the solver automatically constructs these using the equalise_obj
function.
CDCP.policy!
— Methodpolicy!((cutoffs, policies), containers0, C::Integer; scdca::Bool, obj, equalise_obj, zero_D_j_obj=zero_D_j(equalise_obj, falses(C)), restart::Bool=true)
The similar to policy
, but the solver initiates with working0
in containers0 = (working0, _, _)
if restart=false
.
CDCP.naive
— Methodnaive(C::Integer; obj)
Solve a combinatorial discrete choice problem with objective function π(J)
over C
choices with exhaustion.
CDCP.naive!
— Methodnaive!(J::AbstractVector{Bool}; obj)
Similar to naive
, but accepts a pre-allocated vector J
.