EM.mixexp {Renext} | R Documentation |
Expectation-Maximisation for a mixture of exponential distributions
Description
Experimental function for Expectation-Maximisation (EM) estimation
Usage
EM.mixexp(x, m = 2)
Arguments
x |
Sample vector with values |
m |
Number of mixture components. |
Details
The EM algorithm is very simple for exponential mixtures (as well as for many other mixture models).
According to a general feature of EM, this iterative method leads to successive estimates with increasing likelihood but which may converge to a local maximum of the likelihood.
Value
List with
estimate |
Estimated values as a named vector. |
logL |
Vector giving the log-likelihood for successive iterations. |
Alpha |
Matrix with |
Theta |
Matrix with |
Note
The estimation is done for expectation (inverse rates) but the
estimate
vector in the result contains rates for compatibility
reasons (e.g with exponential).
Author(s)
Yves Deville
See Also
mom.mixexp2
and ini.mixexp2
for "cheap"
estimators when m = 2
.
Examples
set.seed(1234)
x <- rmixexp2(n = 100, prob1 = 0.5, rate2 = 4)
EM.mixexp(x) -> res
res$estimate
matplot(res$Theta, type = "l", lwd = 2,
xlab = "iteration", ylab = "theta",
main = "exponential inverse rates")