| simulate_mnp_data | R Documentation |
Generates synthetic choice data from the MNP data-generating process
estimated by run_mnprobit(): latent utility differences against the base
alternative (alternative 1),
w_i = X_i \beta + \delta + \varepsilon_i, \qquad
\varepsilon_i \sim N_{J-1}(0, \Sigma),
with alternative j > 1 chosen iff
w_{ij} > \max(0, \max_{k \neq j} w_{ik}) and the base chosen iff all
w_{ij} < 0. Covariates are Uniform(-1, 1). Choice sets are balanced
(every individual faces all J alternatives), as the MNP estimator
requires; there is no outside-option flag — model an outside good as a
zero-covariate base alternative instead.
simulate_mnp_data(
N = 5000,
J = 3,
beta = c(0.8, -0.6),
delta = NULL,
Sigma = matrix(c(1, 0.5, 0.5, 1.5), nrow = 2),
seed = 123
)
N |
Number of choice situations. |
J |
Number of alternatives (alternative 1 is the base). |
beta |
Fixed coefficients for |
delta |
ASCs of the differenced utilities, one per non-base
alternative (length |
Sigma |
Covariance matrix of the differenced errors
( |
seed |
Random seed ( |
The MNP likelihood only identifies parameters up to scale, so
true_params is reported on the identified scale (normalized by
\sigma_{11}): beta = \beta / \sqrt{\sigma_{11}}, delta
= \delta / \sqrt{\sigma_{11}}, and Sigma = \Sigma /
\sigma_{11} — the scale on which run_mnprobit() reports its posterior.
With the default Sigma (\sigma_{11} = 1) the DGP scale and the
identified scale coincide.
A choicer_sim object. true_params contains beta, delta,
and Sigma on the identified scale (see Details).
sim <- simulate_mnp_data(N = 1000, J = 3, seed = 123)
print(sim)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.