
Last chance! 50% off unlimited learning
Sale ends in
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, colors = NULL, ngrid = length(data),
xlab = NULL, xlim = NULL, CEX = 1,
main = FALSE, …)
A numeric vector of observations. Categorical variables are not allowed.
A named list giving the parameters of an MCLUST model, used to produce superimposing ellipses on the plot. The relevant components are as follows:
pro
Mixing proportions for the components of the mixture. There should one more mixing proportion than the number of Gaussian components if the mixture model includes a Poisson noise term.
mean
The mean for each component. If there is more than one component, this is a matrix whose kth column is the mean of the kth component of the mixture model.
variance
A list of variance parameters for the model.
The components of this list depend on the model
specification. See the help file for mclustVariance
for details.
A matrix in which the [i,k]
th entry gives the
probability of observation i belonging to the kth class.
Used to compute classification
and
uncertainty
if those arguments aren't available.
A numeric or character vector representing a classification of
observations (rows) of data
. If present argument z
will be ignored.
A numeric or character vector giving a known
classification of each data point.
If classification
or z
is also present,
this is used for displaying classification errors.
A numeric vector of values in (0,1) giving the
uncertainty of each data point. If present argument z
will be ignored.
Choose from one of the following three options: "classification"
(default), "density"
, "errors"
, "uncertainty"
.
Either an integer or character vector assigning a plotting symbol to
each unique class classification
. Elements in symbols
correspond to classes in classification
in order of
appearance in the observations (the order used by the
function unique
). The default is to use a single plotting
symbol |. Classes are delineated by showing them in separate
lines above the whole of the data.
Either an integer or character vector assigning a color to each
unique class classification
. Elements in colors
correspond to classes in order of appearance in the observations
(the order used by the function unique
).
The default is given is mclust.options("classPlotColors")
.
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.
An argument specifying a label for the horizontal axis.
An argument specifying bounds of the plot. This may be useful for when comparing plots.
An argument specifying the size of the plotting symbols. The default value is 1.
A logical variable or NULL
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, A. E. Raftery, T. B. Murphy and L. Scrucca (2012). mclust Version 4 for R: Normal Mixture Modeling for Model-Based Clustering, Classification, and Density Estimation. Technical Report No. 597, Department of Statistics, University of Washington.
# NOT RUN {
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 <- Mclust(y)
mclust1Dplot(y, parameters = yModel$parameters, z = yModel$z,
what = "classification", main = TRUE)
mclust1Dplot(y, parameters = yModel$parameters, z = yModel$z,
truth = yclass, what = "errors", main = TRUE)
mclust1Dplot(y, parameters = yModel$parameters, z = yModel$z,
what = "density", main = TRUE)
mclust1Dplot(y, z = yModel$z, parameters = yModel$parameters,
what = "uncertainty", main = TRUE)
# }
Run the code above in your browser using DataLab