EM.mixexp | R Documentation |
Experimental function for Expectation-Maximisation (EM) estimation
EM.mixexp(x, m = 2)
x |
Sample vector with values |
m |
Number of mixture components. |
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.
List with
estimate |
Estimated values as a named vector. |
logL |
Vector giving the log-likelihood for successive iterations. |
Alpha |
Matrix with |
Theta |
Matrix with |
The estimation is done for expectation (inverse rates) but the
estimate
vector in the result contains rates for compatibility
reasons (e.g with exponential).
Yves Deville
mom.mixexp2
and ini.mixexp2
for "cheap"
estimators when m = 2
.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.