nMm2par {norMmix} | R Documentation |
From a "norMmix"
(-like) object, return the numeric
parameter vector in our MLE parametrization.
nMm2par(obj,
model = c("EII", "VII", "EEI", "VEI", "EVI",
"VVI", "EEE", "VEE", "EVV", "VVV"),
meanFUN = mean.default,
checkX = FALSE)
obj |
a
|
model |
a |
meanFUN |
a |
checkX |
a boolean. check for positive definiteness of covariance matrix. |
This transformation forms a vector from the parameters of a normal mixture. These consist of weights, means and covariance matrices.
Covariance matrices are given as D and L from the LDLt decomposition
vector containing encoded parameters of the mixture. first, the centered log ratio of the weights, then the means, and then the model specific encoding of the covariances.
the inverse function of nMm2par()
is par2nMm()
.
A <- MW24
nMm2par(A, model = A$model)
# [1] -0.3465736 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
# [7] -2.3025851
## All MW* models in {norMmix} pkg:
pkg <- "package:norMmix"
lMW <- mget(ls(pattern = "^MW", pkg), envir=as.environment(pkg))
lM.par <- lapply(lMW, nMm2par)
## but these *do* differ ___ FIXME __
modMW <- vapply(lMW, `[[`, "model", FUN.VALUE = "XYZ")
cbind(modMW, lengths(lM.par), npar = sapply(lMW, npar))[order(modMW),]