Learn R Programming

mclust (version 1.1-7)

mixproj: Displays one standard deviation of an MVN mixture classification.

Description

mixproj displays one standard deviation of an MVN mxiture classification along with data in for selected pairs of coordinates. Function mvn2plot is used to plot the confidence ellipses.

Usage

mixproj(data, ms, partition, dimens, scale = F, k = 15, xlim, ylim,
xlab, ylab, col=partition, pch=partition, ...)
mvn2plot(mu, sigma, k, add=T, col=NULL, xlim=NULL, ylim=NULL, xlab=NULL,
ylab=NULL, ...)

Arguments

data
a matrix of onservations.
ms
The result of an mstep calculation (a list consisting of mu and sigma).
partition
A integer vector giving an initial classification for each observation.
dimens
A vector of length two giving the two variables of the data to be plotted. If not provided, a random selection of two variables is made.
scale
A logical variable telling whether or not the same scale should be used for both variables so as to preserve geometry. The default does not use the same scale.
k
Number of subdivisions for plotting segments of ellipsoids. Default: 8.
xlim, ylim, xlab, ylab, col, pch
Standard arguments to plot with default values.
add
Add ellipses from mvn2plot to the existing plot.
...
Further arguments to plot.
mu
Cluster centers.
sigma
Cluster covariance matrices.

See Also

mstep, clpairs

Examples

Run this code
data(iris)
cl <- mhclass(mhtree(iris[,1:4], modelid = "VVV"),3)
z <- me( iris[,1:4], modelid = "VVV", ctoz(cl))
pars <- mstep(iris[,1:4], modelid="VVV", z)
mixproj(iris[,1:4], ms=pars, partition=ztoc(z), dimens=c(1,2))
### Plot only one cluster
mvn2plot(pars$mu[1:2,1], pars$sigma[1:2, 1:2, 1], 25, F, col="red")

Run the code above in your browser using DataLab