norMmix {norMmix} | R Documentation |
norMmix
creates a multivariate normal (aka Gaussian) mixture
object, conceptually a mixture of k
multivariate
(p
-dimensional) Gaussians
\mathcal{N}(\mu_j, \Sigma_j)
, for j=1, \dots, k
.
norMmix(mu, Sigma = NULL, weight = rep(1/k, k), name = NULL,
model = c("EII", "VII", "EEI", "VEI", "EVI",
"VVI", "EEE", "VEE", "EVV", "VVV"))
mu |
matrix of means, or a vector in which case |
Sigma |
NULL, number, numeric, vector (length = k), matrix (dim = p x k), or array (p x p x k). See details. |
weight |
weights of mixture model components |
name |
gives the option of naming mixture |
model |
see ‘Details’ |
model
must be specified by one of the (currently 10)
character
strings shown in the default.
(In a future version, model
may become optional).
norMmix
as a few nifty ways of constructing simpler matrices from
smaller givens. This happens according to the dimension of the given
value for the Sigma argument:
for a single value d
or NULL
, norMmix()
assumes
all covariance matrices to be diagonal with entries d
or 1
, respectively.
for a vector v
, norMmix
assumes all matrices to
be diagonal with the i-th matrix having diagonal entries v[i]
.
for a matrix m
, norMmix
assumes all matrices to
be diagonal with diagonal vector m[,i]
, i.e., it goes by
columns.
an array is assumed to be the covariance matrices, given explicitly.
FIXME ... give "all" the details ... (from Bachelor's thesis ???)
currently, a list
of class "norMmix"
, with
a name
attribute and components
model |
three-letter |
mu |
(p x k) matrix of component means |
Sigma |
(p x p x k) array of component Covariance matrices
|
weight |
p-vector of mixture probability weights;
non-negative, summing to one: |
k |
integer, the number of components |
dim |
integer, the dimension |
Nicolas Trutmann
__ TODO __
norMmixMLE()
to fit such mixture models to data (an n
\times p
matrix).
“Marron-Wand”-like examples (for testing, etc), such as
MW21
.
## Some of the "MW" objects : % --> ../R/zmarrwandnMm.R
# very simple 2d:
M21 <- norMmix(mu = cbind(c(0,0)), # 2 x 1 ==> k=2, p=1
Sigma = 1, model = "EII")
stopifnot(identical(M21, # even simpler, Sigma = default :
norMmix(mu = cbind(c(0,0)), model = "EII")))
m2.2 <- norMmix(mu = cbind(c(0, 0), c(5, 0)), Sigma = c(1, 10),
weight = c(7,1)/8, model = "VEI")
m22 <- norMmix(
name = "one component rotated",
mu = cbind( c(0,0) ),
Sigma = array(c(55,9, 9,3), dim = c(2,2, 1)),
model = "EVV")
stopifnot( all.equal(MW22, m22) )
m213 <- norMmix(
name = "#13 test VVV",
weight = c(0.5, 0.5),
mu = cbind( c(0,0), c(30,30) ),
Sigma = array(c( 1,3,3,11, 3,6,6,13 ), dim=c(2,2, 2)),
model = "VVV")
stopifnot( all.equal(MW213, m213) )
str(m213)
m34 <- norMmix(
name = "#4 3d VEI",
weight = c(0.1, 0.9),
mu = matrix(rep(0,6), 3,2),
Sigma = array(c(diag(1:3), 0.2*diag(3:1)), c(3,3, 2)),
model = "VVI" )
stopifnot( all.equal(MW34, m34) )