mclust1Dplot {mclust} | R Documentation |
Plot one-dimensional data given parameters of an MVN mixture model for the data.
mclust1Dplot(data, parameters=NULL, z=NULL, classification=NULL, truth=NULL, uncertainty=NULL, what = c("classification", "density", "errors", "uncertainty"), symbols=NULL, ngrid=length(data), xlab = NULL, xlim=NULL, CEX=1, identify=FALSE, ...)
data |
A numeric vector of observations. Categorical variables are not allowed. |
parameters |
A named list giving the parameters of an MCLUST model, used to produce superimposing ellipses on the plot. The relevant components are as follows:
|
z |
A matrix in which the |
classification |
A numeric or character vector representing a classification of
observations (rows) of |
truth |
A numeric or character vector giving a known
classification of each data point.
If |
uncertainty |
A numeric vector of values in (0,1) giving the
uncertainty of each data point. If present argument |
what |
Choose from one of the following three options: |
symbols |
Either an integer or character vector assigning a plotting symbol to
each unique class |
ngrid |
Number of grid points to use for density computation over the interval spanned by the data. The default is the length of the data set. |
xlab |
An argument specifying a label for the horizontal axis. |
xlim |
An argument specifying bounds of the plot. This may be useful for when comparing plots. |
CEX |
An argument specifying the size of the plotting symbols. The default value is 1. |
identify |
A logical variable indicating whether or not to add a title to the plot identifying the dimensions used. |
... |
Other graphics parameters. |
A plot showing location of the mixture components, classification, uncertainty, density and/or classification errors. Points in the different classes are shown in separated levels above the whole of the data.
C. Fraley and A. E. Raftery (2002). Model-based clustering, discriminant analysis, and density estimation. Journal of the American Statistical Association 97:611-631.
C. Fraley and A. E. Raftery (2006). MCLUST Version 3 for R: Normal Mixture Modeling and Model-Based Clustering, Technical Report no. 504, Department of Statistics, University of Washington.
mclust2Dplot
,
clPairs
,
coordProj
n <- 250 ## create artificial data set.seed(1) y <- c(rnorm(n,-5), rnorm(n,0), rnorm(n,5)) yclass <- c(rep(1,n), rep(2,n), rep(3,n)) yModel <- mclustModel(y, mclustBIC(y)) mclust1Dplot(y, parameters = yModel$parameters, z = yModel$z, what = "classification", identify = TRUE) mclust1Dplot(y, parameters = yModel$parameters, z = yModel$z, truth = yclass, what = "errors", identify = TRUE) mclust1Dplot(y, parameters = yModel$parameters, z = yModel$z, what = "density", identify = TRUE) mclust1Dplot(y, z = yModel$z, parameters = yModel$parameters, what = "uncertainty", identify = TRUE)