rmix {mixbox}R Documentation

Generating realization from finite mixture models.

Description

The density function of a restricted G-component finite mixture model can be represented as

{\cal{M}}(\bold{y}|\bold{\Psi})=\sum_{g=1}^{G} \omega_{g} f_{\bold{Y}}(\bold{y}, \bold{\Theta}_g),

where positive constants \omega_{1}, \omega_{2},\cdots,\omega_{G} are called weight (or mixing proportions) parameters with this properties that \sum_{g=1}^{G}\omega_{g}=1 and \bold{\Psi} = \bigl(\bold{\Theta}_{1},\cdots, \bold{\Theta}_{G}\bigr)^{\top} with \bold{\Theta}_g=\bigl({\bold{\omega}}_g, {\bold{\mu}}_g, {{\Sigma}}_g, {\bold{\lambda}}_g\bigr)^{\top}. Herein, f_{\bold{Y}}(\bold{y}, \bold{\Theta}_g) accounts for the density function of random vector \bold{Y} within g-th component that admits the representation given by

{\bf{Y}} \mathop=\limits^d {\bold{\mu}}_{g}+\sqrt{W}{\bold{\lambda}}_{g}\vert{Z}_0\vert + \sqrt{W}{\Sigma}_{g}^{\frac{1}{2}} {\bf{Z}}_1,

where {\bold{\mu}}_{g} \in {R}^{d} is location vector, {\bold{\lambda}}_{g} \in {R}^{d} is skewness vector, and \Sigma_{g} is a positive definite symmetric dispersion matrix for g=1,\cdots,G. Further, W is a positive random variable with mixing density function f_W(w| \bold{\theta}_{g}), {Z}_0\sim N(0, 1) , and {\bold{Z}}_1\sim N_{d}\bigl( {\bold{0}}, \Sigma_{g}\bigr) . We note that W, Z_0, and {\bf{Z}}_1 are mutually independent.

Usage

rmix(n, G, weight, model = "restricted", mu, sigma, lambda, family = "constant",
        theta = NULL) 

Arguments

n

number of realizations.

G

number of components.

weight

a vector of weight parameters (or mixing proportions).

model

It must be "canonical", "restricted", or "unrestricted". By default model="restricted".

mu

a list of location vectors of G components.

sigma

a list of dispersion matrices of G components.

lambda

a list of skewness vectors of G components. If mixture model is symmetric, then a vector of zeros of appropriate size should be considered for the skewness vector of the corresponding component.

family

name of mixing distribution. By default family = "constant" that corresponds to the finite mixture of multivariate normal (or skew normal) distribution. Other candidates for family name are: "bs" (for Birnbaum-Saunders), "burriii" (for Burr type iii), "chisq" (for chi-square), "exp" (for exponential), "f" (for Fisher), "gamma" (for gamma), "gigaussian" (for generalized inverse-Gaussian), "igamma" (for inverse-gamma), "igaussian" (for inverse-Gaussian), "lindley" (for Lindley), "loglog" (for log-logistic), "lognorm" (for log-normal), "lomax" (for Lomax), "pstable" (for positive \alpha-stable), "ptstable" (for polynomially tilted \alpha-stable), "rayleigh" (for Rayleigh), and "weibull" (for Weibull).

theta

a list of maximum likelihood estimator(s) for \theta (parameter vector of mixing distribution) across G components. By default it is NULL.

Value

a matrix with n rows and d + 1 columns. The first d columns constitute n realizations from random vector \bold{Y}=(Y_1,\cdots,Y_d)^{\top} and the last column is the label of realization \bold{Y}_i ( for i = 1, \cdots n ) indicating the component that \bold{Y}_i is coming from.

Author(s)

Mahdi Teimouri

Examples


 weight <- rep( 0.5, 2 )
    mu1 <- rep(-5  , 2 )
    mu2 <- rep( 5  , 2 )
 sigma1 <- matrix( c( 0.4, -0.20, -0.20, 0.4 ), nrow = 2, ncol = 2 )
 sigma2 <- matrix( c( 0.4,  0.10,  0.10, 0.4 ), nrow = 2, ncol = 2 )
lambda1 <- matrix( c( -4, -2,  2,  5 ), nrow = 2, ncol = 2 )
lambda2 <- matrix( c(  4,  2, -2, -5 ), nrow = 2, ncol = 2 )
 theta1 <- c( 10, 10 )
 theta2 <- c( 20, 20 )
     mu <- list( mu1, mu2 )
  sigma <- list( sigma1 , sigma2 )
 lambda <- list( lambda1, lambda2)
  theta <- list( theta1 , theta2 )
      Y <- rmix( n = 100, G = 2, weight, model = "canonical", mu, sigma, lambda,
           family = "igamma", theta )


[Package mixbox version 1.2.3 Index]