Learn R Programming

norMmix (version 0.2-0)

llmvtnorm: Log-Likelihood of Multivariate Normal Mixture Relying on mvtnorm::dmvnorm

Description

Compute the log-likelihood of a multivariate normal mixture, by calling dmvnorm() (from package mvtnorm).

Usage

llmvtnorm(par, x, k,
          model = c("EII", "VII", "EEI", "VEI", "EVI",
                    "VVI", "EEE", "VEE", "EVV", "VVV"))

Value

returns the log-likelihood (a number) of the specified model for the data (\(n\) observations) x.

Arguments

par

parameter vector as calculated by nMm2par

x

numeric data matrix (of dimension \(n \times p\)).

k

number of mixture components.

model

assumed model of the distribution

See Also

dmvnorm() from package mvtnorm. Our own function, returning the same: llnorMmix().

Examples

Run this code
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