Title

mmain(D, Z, P, eps = 1e-09)

Arguments

D

an object of class multimixSettings - see data_organise for full description.

Z

a matrix

P

a matrix

eps

Minimum increase in loglikelihood per EM step. If this is not exceeded the the algorithm will terminate.

Value

an object of class multimix results which is a a list containing four elements: the multmixSettings object D, the \(Z\) matrix, the \(P\) matrix, and a results matrix, called results, with \(n\) rows and

\(numClusters\) columns.

Author

Murray Jorgensen

Examples

data(cancer.df)
D <- data_organise(cancer.df, numClusters = 2)
stage <- scan(system.file('extdata', 'Stage.txt', package = 'multimix')) - 2
Z <- make_Z_discrete(stage)
P <- initParamList(D,Z) 
zpr <- mmain(D,Z,P)
zpr
#> The algorithm terminated after 29 iterations
#> The final value of the log-likelihood is -11380.68
#> 
#> The estimated cluster probabilities are:
#> 
#> i     Pr(C=i)
#> ----  -------
#> 1     0.5636
#> 2     0.4364
#>