Learn R Programming

GMCM (version 1.4)

EStep: Steps of the EM algorithm for a Gaussian Mixture model

Description

Functions to perform the expectation and maximization steps of the EM algorithm for an multivariate Gaussian mixture model.

Usage

EStep(x, theta)

MStep(x, kappa, meta.special.case = FALSE)

Arguments

x

A matrix of observations where rows corresponds to features and columns to experiments.

theta

A list of parameters formatted as described in rtheta.

kappa

A matrix where the (i,j)'th entry is the probability that x[i,] belongs to the j'th component. Usually the returned value of EStep.

meta.special.case

Logical. If TRUE, the maximization step is performed under the special case of Li et. al. (2011). Default values is FALSE.

Value

EStep returns a matrix of probabilities as kappa above.

MStep returns a list of parameters formatted as described in rtheta.

References

Li, Q., Brown, J. B. J. B., Huang, H., & Bickel, P. J. (2011). Measuring reproducibility of high-throughput experiments. The Annals of Applied Statistics, 5(3), 1752-1779. doi:10.1214/11-AOAS466

See Also

rtheta

Examples

Run this code
# NOT RUN {
set.seed(1)
sim <- GMCM:::SimulateGMMData(n = 100)
x <- sim$z
true.theta <- sim$theta
init.theta <- GMCM:::rtheta()  # Generate starting parameters

# Do one EM interation
es <- GMCM:::EStep(x, init.theta)
new.theta <- GMCM:::MStep(x, es)

# Compare current estimate with the true
new.theta
true.theta
# }

Run the code above in your browser using DataLab