Mixture of two Gaussians (unknown μ_1and μ_2)

Mixture model definitions

Visualize mixture model

pdf = Plot[mixturepdf1D[params1, x], {x, -5, 5}, FrameTrue, AxesFalse, PlotStyle {Thickness[.01], Green}] ;

[Graphics:../HTMLFiles/index_20.gif]

Generate labeled data from mixture model

n = 100 ; data = RandomMixtureModel1D[params1, n] ;

Visualize generated data

PlotDataLabeled1D[data, Red, Blue] ;

[Graphics:../HTMLFiles/index_23.gif]

Plot log likelihood of data as a function of μ1 and μ2

{est1, est2} = PlotLogLikelihoodLocal2[data, params2]

[Graphics:../HTMLFiles/index_25.gif]

RowBox[{{, RowBox[{RowBox[{{, RowBox[{RowBox[{-, 1.89821}], ,, 1.92038}], }}], ,, RowBox[{{, RowBox[{2.01276, ,, RowBox[{-, 1.77287}]}], }}]}], }}]

PlotLogLikelihoodLocal3[data, params2] ;

[Graphics:../HTMLFiles/index_28.gif]

likelihoodFunction1D[data, Join[{est1}, Drop[params2, 1]]]

RowBox[{-, 200.853}]

likelihoodFunction1D[data, Join[{est2}, Drop[params2, 1]]]

RowBox[{-, 208.65}]

Visualize resulting pdfs

g1 = Plot[mixturepdf1D[{est1, σ, Pω}, x], {x, -5, 5}, FrameTrue, Axes ... sFalse, PlotStyle {Thickness[.01], Blue}, Evaluate[nS]] ; Show[pdf, g1, g2, yS] ;

[Graphics:../HTMLFiles/index_34.gif]


Created by Mathematica  (September 8, 2003)