| simulate_hmnp_data | R Documentation |
Generates synthetic panel choice data from the hierarchical probit DGP with iid normal utility shocks:
U_{ijt} = x_{ijt}'\beta_i + \delta_j + \epsilon_{ijt}, \qquad
U_{iot} = \epsilon_{iot}, \qquad
\epsilon \sim N(0, \sigma^2),
choice by argmax within the task. The outside option is stochastic — it
carries its own N(0, \sigma^2) shock on top of systematic utility
0, exactly as in the estimator. \beta_i \sim N(\beta, W) (normal
only) and \delta_j = z_j'\theta + \xi_j,
\xi_j \sim N(0, \sigma_d^2), as in simulate_hmnl_data().
simulate_hmnp_data(
N = 500,
T = 10,
J = 4,
beta = c(0.8, -0.6),
W = NULL,
theta = c(0.5, -0.4),
sigma_d = 0.5,
Z = NULL,
include_outside = TRUE,
seed = 123,
vary_choice_set = FALSE,
sigma = 1
)
N |
Number of respondents. |
T |
Number of choice situations per respondent. |
J |
Number of inside alternatives. |
beta |
Population means of the structural random coefficients
(length |
W |
Covariance of the random coefficients ( |
theta |
Mean-function coefficients for
|
sigma_d |
Standard deviation of the alternative-level effects
|
Z |
Optional |
include_outside |
Logical; if |
seed |
Random seed ( |
vary_choice_set |
Logical; if |
sigma |
Standard deviation of the iid utility shocks (DGP scale). |
The iid-probit likelihood identifies parameters only up to the common
scale \sigma, so true_params is reported on the identified
scale: beta = \beta/\sigma, W = W/\sigma^2, theta
= \theta/\sigma, sigma_d = \sigma_d/\sigma, delta
= \delta/\sigma, xi = \xi/\sigma. With the default
sigma = 1 the DGP scale and the identified scale coincide.
A choicer_sim object. true_params contains beta, W,
theta, sigma_d, the realized delta and xi, and the full
mean-function design Z — all on the identified scale (see Details).
sim <- simulate_hmnp_data(N = 100, T = 4, J = 4, seed = 123)
print(sim)
sim$true_params$delta
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.