Fitting a series of mixtures of conjugate distributions to a
sample, using Expectation-Maximization (EM). The number of
mixture components is specified by the vector
Nc. First a
Nc component mixture is fitted, then a
component mixture, and so on. The mixture providing the best AIC
value is then selected.
Sample to be fitted by a mixture distribution.
Vector of mixture components to try out (default
Penalty parameter for AIC calculation (default 6)
The procedure stops if the difference of subsequent AIC values
is smaller than this threshold (default -Inf). Setting the threshold to 0
Enable verbose logging.
Further arguments passed to
type argument specifies the distribution of
the mixture components, and can be a normal, beta or gamma
The penalty parameter
k is 2 for the standard AIC
definition. Collet (2003) suggested to use values in the
range from 2 to 6, where larger values of
k penalize more
complex models. To favor mixtures with fewer components a value of
6 is used as default.
As result the best fitting mixture model is returned,
i.e. the model with lowest AIC. All other models are saved in the
Collet D. Modeling Survival Data in Medical Research. 2003; Chapman and Hall/CRC.
1 2 3 4 5 6 7 8 9 10 11 12 13
# random sample of size 1000 from a mixture of 2 beta components bm <- mixbeta(beta1=c(0.4, 20, 90), beta2=c(0.6, 35, 65)) bmSamp <- rmix(bm, 1000) # fit with EM mixture models with up to 10 components and stop if # AIC increases bmFit <- automixfit(bmSamp, Nc=1:10, thresh=0, type="beta") bmFit # advanced usage: find out about all discarded models bmFitAll <- attr(bmFit, "models") sapply(bmFitAll, AIC, k=6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.