Learn R Programming

EMCluster (version 0.2-16)

Projection On 2D: Produce Projection on 2D

Description

The function projects multivariate data on 2D plane which can be displayed by plotppcontour() later.

Usage

project.on.2d(x, emobj = NULL, pi = NULL, Mu = NULL,
    LTSigma = NULL, class = NULL, method = c("PP", "SVD"))

Value

A projection is returned which is a list contains

  • da is a \(n \times 2\) projected matrix of x.

  • Pi is the original proportion emobj$pi of length \(K\).

  • Mu is a \(K \times 2\) projected matrix of emboj$Mu.

  • S is a \(2 \times 2 \times K\) projected array of emboj$LTSigma.

  • class is the original class id emobj$class.

  • proj.mat is the projection matrix of dimension \(p \times 2\).

Arguments

x

the data matrix, dimension \(n\times p\).

emobj

the desired model which is a list mainly contains pi, Mu, and LTSigma, usually a returned object from init.EM.

pi

the mixing proportion, length \(K\).

Mu

the centers of clusters, dimension \(K\times p\).

LTSigma

the lower triangular matrices of dispersion, \(K\times p(p+1)/2\).

class

id of classifications, length \(n\).

method

either projection pursuit or singular value decomposition.

Author

Wei-Chen Chen wccsnow@gmail.com and Ranjan Maitra.

Details

This function produces projection outputs of x and emobj.

References

https://www.stat.iastate.edu/people/ranjan-maitra

See Also

project.on.2d().

Examples

Run this code
if (FALSE) {
library(EMCluster, quietly = TRUE)
set.seed(1234)

### Iris.
x <- as.matrix(iris[, 1:4])
ret <- init.EM(x, nclass = 3, min.n = 30)
ret.proj <- project.on.2d(x, ret)

### Plot.
pdf("iris_ppcontour.pdf", height = 5, width = 5)
plotppcontour(ret.proj$da, ret.proj$Pi, ret.proj$Mu, ret.proj$S,
              ret.proj$class, main = "Iris K = 3")
dev.off()
}

Run the code above in your browser using DataLab