Classify multivariate observations on a dimension reduced subspace estimated from a Gaussian finite mixture model.

# S3 method for MclustDR
predict(object, dim = 1:object$numdir, newdata, eval.points, ...)

Arguments

object

an object of class 'MclustDR' resulting from a call to MclustDR.

dim

the dimensions of the reduced subspace used for prediction.

newdata

a data frame or matrix giving the data. If missing the data obtained from the call to MclustDR are used.

eval.points

a data frame or matrix giving the data projected on the reduced subspace. If provided newdata is not used.

...

further arguments passed to or from other methods.

Value

Returns a list of with the following components:

dir

a matrix containing the data projected onto the dim dimensions of the reduced subspace.

density

densities from mixture model for each data point.

z

a matrix whose [i,k]th entry is the probability that observation i in newdata belongs to the kth class.

uncertainty

The uncertainty associated with the classification.

classification

A vector of values giving the MAP classification.

References

Scrucca, L. (2010) Dimension reduction for model-based clustering. Statistics and Computing, 20(4), pp. 471-484.

Author

Luca Scrucca

See also

Examples

mod = Mclust(iris[,1:4]) dr = MclustDR(mod) pred = predict(dr) str(pred)
#> List of 5 #> $ dir : num [1:150, 1:4] 1.86 1.45 1.62 1.41 1.91 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : NULL #> .. ..$ : chr [1:4] "Dir1" "Dir2" "Dir3" "Dir4" #> $ density : num [1:150] 10.55 4.76 7.37 6.2 9.02 ... #> $ z : num [1:150, 1:2] 1 1 1 1 1 ... #> $ uncertainty : num [1:150] 2.51e-11 5.56e-08 3.64e-09 8.61e-08 8.50e-12 ... #> $ classification: Factor w/ 2 levels "1","2": 1 1 1 1 1 1 1 1 1 1 ...
data(banknote) mod = MclustDA(banknote[,2:7], banknote$Status) dr = MclustDR(mod) pred = predict(dr) str(pred)
#> List of 5 #> $ dir : num [1:200, 1:6] -0.862 -1.911 -1.748 -1.92 -1.685 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : NULL #> .. ..$ : chr [1:6] "Dir1" "Dir2" "Dir3" "Dir4" ... #> $ density : num [1:200] 7.13e-06 2.34e-01 2.71e-01 3.52e-01 3.36e-04 ... #> $ z : num [1:200, 1:2] 2.19e-07 8.23e-21 2.31e-23 3.13e-21 2.44e-24 ... #> $ uncertainty : num [1:200] 2.19e-07 0.00 0.00 0.00 0.00 ... #> $ classification: Factor w/ 2 levels "counterfeit",..: 2 2 2 2 2 2 2 2 2 2 ...