Compiled C++ routines that underlie mdcev.sim and
GenerateMDCEVData. These functions are exported for
advanced users and test code; most users should call the higher-level
wrappers instead.
DrawError_rngDraw preference error terms for one individual using the MLHS or independent draw approach.
MarshallianDemandCompute Marshallian (uncompensated) demand for one individual given marginal utilities at zero.
HicksianDemandCompute Hicksian (compensated) demand for one individual given a reference utility level.
ComputeUtilJEvaluate the KT utility function for one individual.
CalcWTP_rngSimulate welfare (WTP) across
nerrs error draws for one individual under a price policy.
CalcMarshallianDemand_rngSimulate Marshallian demand
across nerrs error draws for one individual under a price
policy.
DrawError_rng(quant_num, quant_j, price_j, psi_j, phi_j, gamma_j,
alpha, scale, model_num, nalts, nerrs, cond_error,
draw_mlhs, base_rng__, pstream__)MarshallianDemand(income, price, MUzero, phi, gamma, alpha, nalts,
algo_gen, model_num, tol_e, max_loop, pstream__)
HicksianDemand(util, price, MUzero, phi, gamma, alpha, nalts,
algo_gen, model_num, tol_l, max_loop, pstream__)
ComputeUtilJ(income, quant_j, price_j, psi, phi_j, gamma_j, alpha,
nalts, model_num, pstream__)
CalcWTP_rng(income, quant_j, price, price_p_policy, psi_p_sims,
phi_p_sims, psi_sims, phi_sims, gamma_sims, alpha_sims,
scale_sims, nerrs, cond_error, draw_mlhs, algo_gen,
model_num, price_change_only, tol, max_loop, base_rng__,
pstream__)
CalcMarshallianDemand_rng(income, quant_j, price, price_p_policy,
psi_p_sims, phi_p_sims, psi_sims, phi_sims,
gamma_sims, alpha_sims, scale_sims, nerrs,
cond_error, draw_mlhs, algo_gen, model_num,
price_change_only, tol, max_loop, base_rng__,
pstream__)
DrawError_rng returns a matrix of error draws with nerrs
rows and nalts + 1 columns.
MarshallianDemand and HicksianDemand return a numeric
vector of length nalts + 1 holding the numeraire quantity
followed by the non-numeraire quantities.
ComputeUtilJ returns a scalar utility value.
CalcWTP_rng and CalcMarshallianDemand_rng return a list
with one element per policy scenario, each holding the simulated
welfare measure or demand averaged over the nerrs error draws.
External pointer to the Boost RNG created by
rmdcev_get_rng.
External pointer to the output stream created by
rmdcev_get_stream.
Integer model type: 1 = gamma, 2 = alpha, 3 = hybrid, 4 = hybrid0, 5 = kt_ee, 6 = gamma1.
Individual income (scalar).
Vector of non-numeraire quantities.
Numeraire quantity consumed.
Vector of non-numeraire prices.
Full price vector (numeraire first).
Matrix of counterfactual prices, one row per policy scenario.
Psi utility parameters.
Phi parameters (kt_ee model).
Gamma satiation parameters.
Alpha parameters.
Scale parameter.
Lists of parameter draws, one element per simulation, for the baseline scenario.
Lists of psi and phi parameter draws for the policy scenarios.
Number of non-numeraire alternatives.
Number of error draws.
1 = conditional error draws; 0 = unconditional.
1 = Modified Latin Hypercube Sampling; 0 = iid.
Algorithm: 0 = hybrid (fast, requires alpha = 0); 1 = general bisection.
1 = only prices change across policies, so the baseline psi and phi draws are reused; 0 = psi and phi also change across policies.
Vector of marginal utilities at zero consumption.
Reference utility level (Hicksian demand).
Convergence tolerance for bisection.
Maximum bisection iterations.
mdcev.sim, PrepareSimulationData,
rmdcev_get_rng, rmdcev_get_stream