f_ll_mnp | R Documentation |
Log-likelihood function of the (normally mixed) multinomial probit model
f_ll_mnp(
theta,
data,
neg = FALSE,
normal_cdf = mvtnorm::pmvnorm,
threshold = 1e-06
)
theta |
A |
data |
A |
neg |
Set to |
normal_cdf |
A
and return a single By default, |
threshold |
A small |
The order of theta
is supposed to be c(b, o, l)
, where
b
is the vector of mean effects without the first entry,
o
the lower-triangular elements of the lower-triangular
Cholesky root of the effect covariance matrix Omega
(if any),
and l
the lower-triangular elements of the lower-triangular
Cholesky root of the differenced (with respect to
the last alternative) error term covariance matrix Sigma
.
A numeric
, the log-likelihood value at theta
given data
.
https://en.wikipedia.org/wiki/Multinomial_probit
sim_mnp()
for simulating a data set from a probit model.
data <- sim_mnp(N = 500, J = 3, P = 2, b = c(1, 3), Sigma = diag(3))
theta <- attr(data, "true")
f_ll_mnp(theta = theta, data = data)
nlm(f_ll_mnp, p = theta, data = data, neg = TRUE)$estimate
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.