powered by
mvtnorm::dmvnorm
Compute the log-likelihood of a multivariate normal mixture, by calling dmvnorm() (from package mvtnorm).
dmvnorm()
llmvtnorm(par, x, k, model = c("EII", "VII", "EEI", "VEI", "EVI", "VVI", "EEE", "VEE", "EVV", "VVV"))
returns the log-likelihood (a number) of the specified model for the data (\(n\) observations) x.
x
parameter vector as calculated by nMm2par
numeric data matrix (of dimension \(n \times p\)).
matrix
number of mixture components.
assumed model of the distribution
dmvnorm() from package mvtnorm. Our own function, returning the same: llnorMmix().
llnorMmix()
set.seed(1); x <- rnorMmix(50, MW29) para <- nMm2par(MW29, model=MW29$model) llmvtnorm(para, x, 2, model=MW29$model) # [1] -236.2295
Run the code above in your browser using DataLab