covw {mclust} | R Documentation |
Weighted means, covariance and scattering matrices conditioning on a weighted matrix
Description
Compute efficiently (via Fortran code) the means, covariance and scattering matrices conditioning on a weighted or indicator matrix
Usage
covw(X, Z, normalize = TRUE)
Arguments
X |
A |
Z |
A |
normalize |
A logical indicating if rows of |
Value
A list with the following components:
mean |
A |
S |
A |
W |
A |
Author(s)
M. Fop and L. Scrucca
Examples
# Z as an indicator matrix
X <- iris[,1:4]
Z <- unmap(iris$Species)
str(covw(X, Z))
# Z as a matrix of weights
mod <- Mclust(X, G = 3, modelNames = "VVV")
str(covw(X, mod$z))
[Package mclust version 6.1.1 Index]