Learn R Programming

mclust (version 3.4.7)

dens: Density for Parameterized MVN Mixtures

Description

Computes densities of observations in parameterized MVN mixtures.

Usage

dens(modelName, data, logarithm = FALSE, parameters, warn=NULL, ...)

Arguments

modelName
A character string indicating the model. The help file for mclustModelNames describes the available models.
data
A numeric vector, matrix, or data frame of observations. Categorical variables are not allowed. If a matrix or data frame, rows correspond to observations and columns correspond to variables.
logarithm
A logical value indicating whether or not the logarithm of the component densities should be returned. The default is to return the component densities, obtained from the log component densities by exponentiation.
parameters
The parameters of the model: [object Object],[object Object],[object Object]
warn
A logical value indicating whether or not a warning should be issued when computations fail. The default is warn=FALSE.
...
Catches unused arguments in indirect or list calls via do.call.

Value

  • A numeric vector whose ith component is the density of the ith observation in data in the MVN mixture specified by parameters.

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.

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.

See Also

cdens, mclustOptions, do.call

Examples

Run this code
faithfulBIC <- mclustBIC(faithful) 
faithfulModel <- mclustModel(faithful, faithfulBIC) ## best parameter estimates
names(faithfulModel)

Dens <- dens(modelName = faithfulModel$modelName, data = faithful,
                parameters = faithfulModel$parameters)
Dens

## alternative call
oddDens <- do.call("dens", c(list(data = faithful), faithfulModel))

Run the code above in your browser using DataLab