EMCluster (version 0.2-10)

MVN: Density of (Mixture) Multivariate Normal Distribution

Description

These functions are tools for compute density of (mixture) multivariate Gaussian distribution with unstructured dispersion.

Usage

dmvn(x, mu, LTsigma, log = FALSE)
dlmvn(x, mu, LTsigma, log = TRUE)
dmixmvn(x, emobj = NULL, pi = NULL, Mu = NULL, LTSigma = NULL, log = FALSE)
logL(x, emobj = NULL, pi = NULL, Mu = NULL, LTSigma = NULL)

Arguments

x

the data matrix, dimension \(n\times p\).

mu

the centers of clusters, length \(p\).

LTsigma

the lower triangular matrices of dispersion, length \(p(p+1)/2\).

log

if logarithm returned.

emobj

the desired model which is a list mainly contains pi, Mu, and LTSigma, usually a returned object from init.EM.

pi

the mixing proportion, length \(K\).

Mu

the centers of clusters, dimension \(K\times p\).

LTSigma

the lower triangular matrices of dispersion, \(K\times p(p+1)/2\).

Value

A density value is returned.

Details

The dmvn and dlmvn compute density and log density of multivariate distribution.

The dmixmvn computes density of mixture multivariate distribution and is based either an input emobj or inputs pi, Mu, and LTSigma to assign class id to each observation of x.

The logL returns the value of the observed log likelihood function of the parameters at the current values of the parameters pi, Mu, and LTSigma, with the suplied data matrix x.

References

http://maitra.public.iastate.edu/

See Also

init.EM, emcluster.

Examples

Run this code
# NOT RUN {
<!-- %\dontrun{ -->
# }
# NOT RUN {
library(EMCluster, quietly = TRUE)
x2 <- da2$da
x3 <- da3$da

emobj2 <- list(pi = da2$pi, Mu = da2$Mu, LTSigma = da2$LTSigma)
emobj3 <- list(pi = da3$pi, Mu = da3$Mu, LTSigma = da3$LTSigma)

logL(x2, emobj = emobj2)
logL(x3, emobj = emobj3)

dmixmvn2 <- dmixmvn(x2, emobj2)
dmixmvn3 <- dmixmvn(x3, emobj3)

dlmvn(da2$da[1,], da2$Mu[1,], da2$LTSigma[1,])
log(dmvn(da2$da[1,], da2$Mu[1,], da2$LTSigma[1,]))
# }
# NOT RUN {
<!-- %} -->
# }

Run the code above in your browser using DataCamp Workspace