Learn R Programming

mclust (version 6.1)

decomp2sigma: Convert mixture component covariances to matrix form

Description

Converts covariances from a parameterization by eigenvalue decomposition or cholesky factorization to representation as a 3-D array.

Usage

decomp2sigma(d, G, scale, shape, orientation, ...)

Value

A 3-D array whose [,,k]th component is the covariance matrix of the kth component in an MVN mixture model.

Arguments

d

The dimension of the data.

G

The number of components in the mixture model.

scale

Either a G-vector giving the scale of the covariance (the dth root of its determinant) for each component in the mixture model, or a single numeric value if the scale is the same for each component.

shape

Either a G by d matrix in which the kth column is the shape of the covariance matrix (normalized to have determinant 1) for the kth component, or a d-vector giving a common shape for all components.

orientation

Either a d by d by G array whose [,,k]th entry is the orthonomal matrix whose columns are the eigenvectors of the covariance matrix of the kth component, or a d by d orthonormal matrix if the mixture components have a common orientation. The orientation component of decomp can be omitted in spherical and diagonal models, for which the principal components are parallel to the coordinate axes so that the orientation matrix is the identity.

...

Catches unused arguments from an indirect or list call via do.call.

See Also

sigma2decomp

Examples

Run this code
meEst <- meVEV(iris[,-5], unmap(iris[,5])) 
names(meEst)
meEst$parameters$variance

dec <- meEst$parameters$variance
decomp2sigma(d=dec$d, G=dec$G, shape=dec$shape, scale=dec$scale,
             orientation = dec$orientation)
# \donttest{
do.call("decomp2sigma", dec)  ## alternative call
# }

Run the code above in your browser using DataLab