EM algorithm for Gaussian mixture models
Description
The regular expectationmaximization algorithm for general multivariate Gaussian mixture models.
Usage
1 2  EMAlgorithm(x, theta, eps = 1e06, max.ite = 1e+05, trace.theta = FALSE,
verbose = FALSE)

Arguments
x 
A matrix of observations where rows correspond to features and columns to experiments. 
theta 
A list of parameters as described in 
eps 
The maximal required difference in successive likelihoods to establish convergence. 
max.ite 
The maximum number of iterations. 
trace.theta 
Logical. If 
verbose 
Set to 
Details
Though not as versatile, the algorithm can be a faster alternative to
Mclust
in the mclust
package.
Value
A list of length 3 with elements:
theta 
A list of the estimated parameters as described in

loglik.tr 
A numeric vector of the loglikelihood trace. 
kappa 
A matrix where 
Author(s)
Anders Ellern Bilgrau <anders.ellern.bilgrau@gmail.com>
See Also
rtheta
, PseudoEMAlgorithm
Examples
1 2 3 4 5 6 7 8 9 10  set.seed(10)
data < SimulateGMCMData(n = 1000, d = 2, m = 3)
start.theta < rtheta(d = 2, m = 3)
res < GMCM:::EMAlgorithm(data$z, theta = start.theta)
par(mfrow = c(1,2))
plot(data$z, cex = 0.5, pch = 16, main = "Simulated data",
col = rainbow(3)[data$K])
plot(data$z, cex = 0.5, pch = 16, main = "GMM clustering",
col = rainbow(3)[apply(res$kappa,1,which.max)])
