91_mvn: Density of (Mixture) Multivariate Normal Distribution

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

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

Usage

1
2
3
4
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 * 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 * p.

LTSigma

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

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.

Value

A density value is returned.

Author(s)

Wei-Chen Chen [email protected] and Ranjan Maitra.

References

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

See Also

init.EM, emcluster.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## 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,]))

## End(Not run)

Example output

Loading required package: MASS
Loading required package: Matrix
[1] -9761.686
[1] -5997.094
[1] -0.8498813
[1] -0.8498813

EMCluster documentation built on Aug. 26, 2017, 9:04 a.m.