mixmvnorm: Multivariate Normal Mixture Density

View source: R/mixmvnorm.R

mixmvnormR Documentation

Multivariate Normal Mixture Density

Description

The multivariate normal mixture density and auxiliary functions.

Usage

mixmvnorm(..., sigma, param = c("ms", "mn"))

## S3 method for class 'mvnormMix'
print(x, ...)

## S3 method for class 'mvnormMix'
summary(object, ...)

## S3 method for class 'mvnormMix'
sigma(object, ...)

Arguments

...

List of mixture components.

sigma

Reference covariance.

param

Determines how the parameters in the list are interpreted. See details.

x

The mixture to print

object

Multivariate normal mixture object.

Details

Each entry in the ... argument list is a numeric vector defining one component of the mixture multivariate normal distribution. The first entry of the component defining vector is the weight of the mixture component followed by the vector of means in each dimension and finally a specification of the covariance matrix, which depends on the chosen parametrization. The covariance matrix is expected to be given as numeric vector in a column-major format, which is standard conversion applied to matrices by the vector concatenation function c. Please refer to the examples section below.

Each component defining vector can be specified in different ways as determined by the param option:

ms

Mean vector and covariance matrix s. Default.

mn

Mean vector and number of observations. n determines the covariance for each component via the relation \Sigma/n with \Sigma being the known reference covariance.

The reference covariance \Sigma is the known covariance in the normal-normal model (observation covariance). The function sigma can be used to query the reference covariance and may also be used to assign a new reference covariance, see examples below. In case sigma is not specified, the user has to supply sigma as argument to functions which require a reference covariance.

Value

Returns a multivariate normal mixture with the specified mixture components.

See Also

Other mixdist: mixbeta(), mixcombine(), mixgamma(), mixnorm(), mixplot, mix

Examples


S <- diag(c(1, 2)) %*% matrix(c(1, 0.5, 0.5, 1), 2, 2) %*% diag(c(1, 2)) 
mvnm1 <- mixmvnorm(rob=c(0.2, c(0, 0), diag(c(5, 5))),
                   inf=c(0.8, c(0.5, 1), S/10), sigma=S)

print(mvnm1)
summary(mvnm1)

set.seed(657846)
mixSamp1 <- rmix(mvnm1, 500)
colMeans(mixSamp1)



RBesT documentation built on Aug. 22, 2023, 1:08 a.m.