cdens(modelName, data, logarithm = FALSE, parameters, warn = NULL, ...)
mclustModelNames
describes the available models.warn=FALSE
.do.call
.[i,k]
th entry is the
density or log density of observation i in component k.
The densities are not scaled by mixing proportions.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.
cdensE
, ...,
cdensVVV
,
dens
,
estep
,
mclustModelNames
,
mclustVariance
,
mclust.options
,
do.call
z2 <- unmap(hclass(hcVVV(faithful),2)) # initial value for 2 class case
model <- me(modelName = "EEE", data = faithful, z = z2)
cdens(modelName = "EEE", data = faithful, logarithm = TRUE,
parameters = model$parameters)[1:5,]
data(cross)
odd <- seq(1, nrow(cross), by = 2)
oddBIC <- mclustBIC(cross[odd,-1])
oddModel <- mclustModel(cross[odd,-1], oddBIC) ## best parameter estimates
names(oddModel)
even <- odd + 1
densities <- cdens(modelName = oddModel$modelName, data = cross[even,-1],
parameters = oddModel$parameters)
cbind(class = cross[even,1], densities)[1:5,]
Run the code above in your browser using DataLab