niafall
niafall

Reputation: 186

How is the posterior probability matrix calculated in mixtools?

In the R package mixtools, the normalmixEM function is used to fit Gaussian mixture models to data using an EM algorithm, e.g.;

library(mixtools)
data(faithful)
attach(faithful)
set.seed(100)
system.time(out<-normalmixEM(waiting, arbvar = FALSE, epsilon = 1e-03))

Looking at the output, the fit object includes a matrix of posterior probabilities for the observations:

out$posterior[1:5,]
           comp.1       comp.2
[1,] 1.023014e-04 0.9998976986
[2,] 9.999083e-01 0.0000917408
[3,] 4.108021e-03 0.9958919788
[4,] 9.671243e-01 0.0328757394
[5,] 1.211525e-06 0.9999987885

This specific output is not produced by all mixture distribution fitting packages, e.g. mixdist, and I'm wondering if it is possible to derive these probabilities using the parameters from the mixture of Gaussians (e.g. mu, sigma, and lambda)?

Upvotes: 0

Views: 57

Answers (0)

Related Questions