EMCluster (version 0.2-10)

Single Step: Single E- and M-step

Description

These functions are single E- and M-step of EM algorithm for model-based clustering of finite mixture multivariate Gaussian distribution with unstructured dispersion.

Usage

e.step(x, emobj = NULL, pi = NULL, Mu = NULL, LTSigma = NULL,
          norm = TRUE)
m.step(x, emobj = NULL, Gamma = NULL, assign.class = FALSE)

Arguments

x

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

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\).

norm

if returning normalized Gamma.

Gamma

containing posterior probabilities if normalized, otherwise containing component densities weighted by mixing proportion, dimension \(n\times K\).

assign.class

if assigning class id.

Value

The e.step returns a list contains Gamma, the posterior probabilities if norm=TRUE, otherwise it contains component densities. This is one E-step and Gamma is used to update emobj in the M-step next.

The m.step returns a new emobj according to the Gamma from the E-step above.

Details

These two functions are mainly used in debugging for development and post process after model fitting.

References

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

See Also

init.EM.

Examples

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

emobj <- list(pi = da2$pi, Mu = da2$Mu, LTSigma = da2$LTSigma)
eobj <- e.step(x2, emobj = emobj)
emobj <- m.step(x2, emobj = eobj)
emobj
# }
# NOT RUN {
<!-- %} -->
# }

Run the code above in your browser using DataCamp Workspace