summary.mclustDAtest {mclust02}R Documentation

Classification and posterior probability from mclustDAtest.

Description

Classifications from mclustDAtest and the corresponding posterior probabilities.

Usage

## S3 method for class 'mclustDAtest':
summary(object, pro, ...)

Arguments

object The output of mclustDAtest.
pro Prior probabilities for each class in the training data.
... Not used. For generic/method consistency.

Value

A list with the following two components:

classfication The classification from mclustDAtest
z Matrix of posterior probabilities in which the [i,j]th entry is the probability of observation i belonging to class j.

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. See http://www.stat.washington.edu/mclust.

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

mclustDAtest

Examples

set.seed(0)
n <- 100 ## create artificial data

x <- rbind(matrix(rnorm(n*2), n, 2) %*% diag(c(1,9)),
           matrix(rnorm(n*2), n, 2) %*% diag(c(1,9))[,2:1])
xclass <- c(rep(1,n),rep(2,n))
## Not run: 
par(pty = "s")
mclust2Dplot(x, classification = xclass, type="classification", ask=FALSE)
## End(Not run)

odd <- seq(1, 2*n, 2)
train <- mclustDAtrain(x[odd, ], labels = xclass[odd]) ## training step
summary(train)

even <- seq(1, 2*n, 2)
test <- mclustDAtest(x[even, ], train) ## compute model densities
testSummary <- summary(test) ## classify training set

names(testSummary)
testSummary$class
testSummary$z

[Package mclust02 version 2.1-18 Index]