sim_mnp | R Documentation |
Simulate data from a (normally mixed) multinomial probit model
sim_mnp(
N,
Tp = 1,
J,
P,
b = stats::rnorm(P),
Omega = NULL,
Sigma = diag(J),
X = function(n, t) matrix(stats::rnorm(J * P), nrow = J, ncol = P),
seed = NULL
)
N |
An |
Tp |
An |
J |
An |
P |
An |
b |
A |
Omega |
A |
Sigma |
A |
X |
A
|
seed |
Optionally set a seed for the choice data simulation. |
A data.frame
. The first column (n
) is the identifier for the
decider, the next column (t
) the identifier for the choice occasion.
Next comes the column y
with the indices of the chosen alternatives.
The last columns contain the column-wise entries of the covariate matrices.
The true model coefficients are added to the output via the attribute
"true"
. They are already normalized and can be directly compared with
the maximum likelihood estimate.
Additional attributes are "J"
(the number of alternatives),
"P"
(the number of choice covariates), and "mix"
(a boolean
which is TRUE
if Omega
is not NULL
).
f_ll_mnp()
for computing the log-likelihood of a (normally mixed)
multinomial probit model.
sim_mnp(N = 3, J = 3, P = 2, b = c(1, -1), Omega = diag(2), Sigma = diag(3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.