Learn R Programming

Renext (version 3.1-4)

EM.mixexp: Expectation-Maximisation for a mixture of exponential distributions

Description

Experimental function for Expectation-Maximisation (EM) estimation

Usage

EM.mixexp(x, m = 2)

Value

List with

estimate

Estimated values as a named vector.

logL

Vector giving the log-likelihood for successive iterations.

Alpha

Matrix with m columns giving probability weights for successive iterations. Row with number it contains the m probabilities at iteration it.

Theta

Matrix with m columns giving the estimates of the m expectations for the successive iterations

Arguments

x

Sample vector with values >0.

m

Number of mixture components.

Author

Yves Deville

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.

See Also

mom.mixexp2 and ini.mixexp2 for "cheap" estimators when m = 2.

Examples

Run this code
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")

Run the code above in your browser using DataLab