Learn R Programming

norMmix (version 0.2-0)

llnorMmix: Log-likelihood of parameter vector given data

Description

Calculates log-likelihood of a dataset, tx, given a normal mixture model as specified by a parameter vector. A parameter vector can be obtained by applying nMm2par to a norMmix object.

Usage

llnorMmix(par, tx, 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

tx

Transposed numeric data matrix, i.e. tx := t(x) is of dimension \(p \times n\); its rows are variables and columns are observations.

k

number of mixture components.

model

assumed distribution model of normal mixture

See Also

Our alternative function llmvtnorm() (which is based on dmvnorm() from package mvtnorm).

Examples

Run this code
set.seed(1); tx <- t(rnorMmix(50, MW29))
para <- nMm2par(MW29, model=MW29$model)

llnorMmix(para, tx, 2, model=MW29$model)
# [1] -236.2295

Run the code above in your browser using DataLab