Varying the number of Gaussians (E-shaped region)

Generate data from above distributions

Number of points for training and test data

n1 = 1000 ; n2 = 1000 ;

Generate data

data1 = region1Data[n1] ; data2 = region1Data[n2] ;

Visualize training data

gd1 = PlotData2D[data1, pr, style1, nS] ; gd = Show[gd1, FS] ;

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

Generate sample EM results with varying number of component densities

results = Table[EMAll2[data1, k], {k, 2, 15}] ;

Plot log-likelihood of training data as a function of k

PlotLogLikelihood2[Last /@ results, data1] ;

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

Plot log-likelihood of test data as a function of k

PlotLogLikelihood2[Last /@ results, data2] ;

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


Created by Mathematica  (September 8, 2003)