Description Usage Arguments Value Note See Also Examples
View source: R/densityMclust.R
Computes component densities for observations in MVN mixture models parameterized by eigenvalue decomposition.
1 |
modelName |
A character string indicating the model. The help file for
|
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:
|
warn |
A logical value indicating whether or not a warning should be issued
when computations fail. The default is |
... |
Catches unused arguments in indirect or list calls via |
A numeric matrix whose [i,k]
th entry is the
density or log density of observation i in component k.
The densities are not scaled by mixing proportions.
When one or more component densities are very large in magnitude, it may be possible to compute the logarithm of the component densities but not the component densities themselves due to overflow.
cdensE
, ...,
cdensVVV
,
dens
,
estep
,
mclustModelNames
,
mclustVariance
,
mclust.options
,
do.call
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 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,]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.