Log-likelihood function of the (normally mixed) multinomial probit model
Source:R/functions.R
f_ll_mnp.Rd
Log-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 oftheta
isc(b, o, l)
, see the details.- data
A
data.frame
, the output ofsim_mnp
.- neg
Set to
TRUE
to return the negative log-likelihood value.- normal_cdf
A
function
that 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
, then
timesn
covariance matrix,
and return a single
numeric
.By default,
normal_cdf = mvtnorm::pmvnorm
.- threshold
A small
numeric
between 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
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 matrixOmega
(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 matrixSigma
.
See also
sim_mnp()
for simulating a data set from a probit model.