
Log-likelihood function of the (normally mixed) multinomial probit model
Source:R/functions.R
f_ll_mnp.RdLog-likelihood function of the (normally mixed) multinomial probit model
Usage
f_ll_mnp(
theta,
data,
neg = FALSE,
normal_cdf = mvtnorm::pmvnorm,
threshold = 1e-06
)Arguments
- theta
A
numeric, the vector of model coefficients. The order ofthetaisc(b, o, l), see the details.- data
A
data.frame, the output ofsim_mnp.- neg
Set to
TRUEto return the negative log-likelihood value.- normal_cdf
A
functionthat evaluates then-variate normal CDF. It must take the argumentslower, the vector of lower limits of lengthn,upper, the vector of upper limits of lengthn,mean, the mean vector of lengthn,sigma, thentimesncovariance matrix,
and return a single
numeric.By default,
normal_cdf = mvtnorm::pmvnorm.- threshold
A small
numericbetween 0 and 1. Choice probabilities below this value are set to this value to avoid numerical problems.
Details
The order of theta is supposed to be c(b, o, l), where
bis the vector of mean effects without the first entry,othe lower-triangular elements of the lower-triangular Cholesky root of the effect covariance matrixOmega(if any),and
lthe lower-triangular elements of the lower-triangular Cholesky root of the differenced (with respect to the last alternative) error term covariance matrixSigma.
See also
sim_mnp() for simulating a data set from a probit model.