Learn R Programming

mclust (version 2.0-1)

map: Classification given Probabilities

Description

Converts a matrix in which each row sums to 1 into the nearest matrix of (0,1) indicator variables.

Usage

map(z, ...)

Arguments

z
A matrix in which each row sums to 1 (for example a matrix of conditional probabilities as produced by the E-step of the EM algorithm).
...
Provided to allow lists with elements other than the arguments can be passed in indirect or list calls with do.call.

Value

  • A matrix of (0,1) indicator variables in which the [i,j]th entry is 1 if z[i,j] attains a maximum at index j and 0 otherwise.

References

C. Fraley and A. E. Raftery (2002a). Model-based clustering, discriminant analysis, and density estimation. Journal of the American Statistical Association 97:611-631. C. Fraley and A. E. Raftery (2002b). MCLUST:Software for model-based clustering, density estimation and discriminant analysis. Technical Report, Department of Statistics, University of Washington. See http://www.stat.washington.edu/mclust.

See Also

unmap, estep, em, me

Examples

Run this code
data(iris)
irisMatrix <- as.matrix(iris[,1:4])
irisClass <- iris[,5]

emEst <- me(modelName = "VVV", data = irisMatrix, z = unmap(irisClass))

map(emEst$z)

Run the code above in your browser using DataLab