dmxnorm {lazy.cluster} R Documentation

## Density Function (pdf) of Mixture of Multivariate Normal Distribution

### Description

Density Function (pdf) of Mixture of Multivariate Normal Distribution

### Usage

```dmxnorm(X, rho, mu, Sigma, log = 0)
```

### Arguments

 `X` The value of random variables at which pdf is evaluated. This is either a nobs x nvar matrix or a vector of length nobs.. `rho` The mixing proportion vector of length ncl `mu` The mean matrix of the size ncl x nvar `Sigma` The dispersion matrices storeed in nvar x nvar x ncl array `log` = 1 to calculate log pdf

### Details

If Sigma is NOT a matrix, native dnorm is used.
When X is a matrix, mu must be a matrix and Sigma must be a 3D array.
When X is a vector, that is, X is univariate, Sigma can be a matrix.

### Examples

```# multivariate
set.seed(1701)
mu=matrix(c( 0,0,  1,1 ), 2,2)
Sigma=cbind(diag(2),.5*diag(2))
dim(Sigma)=c(2,2,2)
rho=c(.8,.2)
X=matrix(rnorm(10*2),10)
dmxnorm( X, rho, mu, Sigma, log=0 )

# univariate
set.seed(1701)
mu=c(0,0)
Sigma=c(0.5, 0.5)
rho=c(.8,.2)
X=matrix(rnorm(10),10)
X=rnorm(10)
den=dmxnorm( X, rho, mu, Sigma, log=0 )

```

[Package lazy.cluster version 0.1.2 Index]