Learn R Programming

Renext (version 2.0-0)

EM.mixexp: 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 >0.
m
Number of mixture components

Value

  • List with
  • estimateEstimated values as a named vector.
  • logLVector giving the log-likelihood for successive iterations.
  • AlphaMatrix with m columns giving probability weights for successive iterations. Row with number it contains the m probabilities at iteration it.
  • ThetaMatrix with m columns giving the estimates of the m expectations for the successive iterations

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
library(Renext)
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