normalmixEM(x, lambda = NULL, mu = NULL, sigma = NULL, k = 2,
arbmean = TRUE, arbvar = TRUE, epsilon = 1e-08,
maxit = 1000, maxrestarts=20, verb = FALSE, fast=FALSE)lambda is
random from uniform Dirichlet and number of
components is determined by mu.lambda and mu are NULL, then number of comsigma$^2$ has random exponential entries according to a binning method done on the data.
If lambda, mu, and sigmlambda, mu, and sigma
are all NULL.mus. If FALSE, then
a scale mixture will be fit.sigmas. If FALSE, then
a location mixture will be fit.normalmixEM2comp, which is a much faster version of the EM
algorithm for this case.
This version is less protected against certain kinds of unormalmixEM returns a list of class mixEM with items:arbmean = FALSE, then only the smallest standard
deviation is returned. See scale below.arbmean = FALSE, then the scale factor for the component standard deviations is returned.
Otherwise, this is omitted from the output.mvnormalmixEM, normalmixEM2comp##Analyzing the Old Faithful geyser data with a 2-component mixture of normals.
data(faithful)
attach(faithful)
system.time(out<-normalmixEM(waiting, arbvar = FALSE, epsilon = 1e-03))
out
system.time(out2<-normalmixEM(waiting, arbvar = FALSE, epsilon = 1e-03, fast=TRUE))
out2 # same thing but much fasterRun the code above in your browser using DataLab