Learn R Programming

mclust (version 2.1-14)

mclust1Dplot: Plot one-dimensional data modelled by an MVN mixture.

Description

Plot one-dimensional data given parameters of an MVN mixture model for the data.

Usage

mclust1Dplot(data, ...,
             type = c("classification","uncertainty","density","errors"),
             ask = TRUE, symbols, grid = 100, identify = FALSE, CEX = 1, xlim)

Arguments

data
A numeric vector of observations. Categorical variables are not allowed.
...
One or more of the following: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
type
Any subset of c("classification","uncertainty","density","errors"). The function will produce the corresponding plot if it has been supplied sufficient information to do so. If more than one plot is possible then users will be
ask
A logical variable indicating whether or not a menu should be produced when more than one plot is possible. The default is ask=TRUE.
symbols
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 observation
grid
Number of grid points to use.
identify
A logical variable indicating whether or not to add a title to the plot identifying the dimensions used.
CEX
An argument specifying the size of the plotting symbols. The default value is 1.
xlim
An argument specifying bounds of the plot. This may be useful for when comparing plots.

Side Effects

One or more plots showing location of the mixture components, classification, uncertainty, density and/or classification errors. Points in the different classes are shown in separate lines above the whole of the data.

References

C. Fraley and A. E. Raftery (2002). Model-based clustering, discriminant analysis, and density estimation. Journal of the American Statistical Association 97:611-631. See http://www.stat.washington.edu/mclust. C. Fraley and A. E. Raftery (2002). MCLUST:Software for model-based clustering, density estimation and discriminant analysis. Technical Report, Department of Statistics, University of Washington. See http://www.stat.washington.edu/mclust.

See Also

mclust2Dplot, clPairs, coordProj, do.call

Examples

Run this code
n <- 250 ## create artificial data
set.seed(0)
y <- c(rnorm(n,-5), rnorm(n,0), rnorm(n,5))
yclass <- c(rep(1,n), rep(2,n), rep(3,n))

yEMclust <- summary(EMclust(y),y)

mclust1Dplot(y, identify = TRUE, truth = yclass, z = yEMclust$z, ask=FALSE,
             mu = yEMclust$mu, sigma = yEMclust$sigma, pro = yEMclust$pro)

do.call("mclust1Dplot",
        c(list(data = y, identify = TRUE, truth = yclass, ask=FALSE), 
        yEMclust))

Run the code above in your browser using DataLab