Description Usage Arguments Value References See Also Examples
Calculate the density of multivariate mixture models at data points for each component
1 |
dat |
The dataset |
n |
The total number of points |
p |
Dimension of data |
g |
The number of clusters |
distr |
A three letter string indicating the distribution; "mvn" for normal, "mvt" for t distribution, "msn" for skew normal, and "mst" for skew t distribution. |
mu |
A numeric mean matrix with each column corresponding to the mean |
sigma |
An array of dimension (p,p,g) with first two dimensions corresponding covariance matrix of each component |
dof |
A vector of degrees of freedom for each component |
delta |
A matrix with each column as skew parameter vector |
ddmix gives an n by g matrix of logorithm of density at each data point for each component.
McLachlan G.J. and Krishnan T. (2008). The EM Algorithm and Extensions (2nd). New Jersay: Wiley.
McLachlan G.J. and Peel D. (2000). Finite Mixture Models. New York: Wiley.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | p=2
g=3
#mixing propotion of each component
pro <- c(0.3,0.3,0.4)
#specify mean and covariance matrix for each component
sigma<-array(0,c(2,2,3))
for(h in 2:3) sigma[,,h]<-diag(2)
sigma[,,1]<-cbind( c(1,0),c(0,.1))
mu <- cbind(c(4,-4),c(3.5,4),c( 0, 0))
#specify other parameters for "mvt","msn","mst"
delta <- cbind(c(3,3),c(1,5),c(-3,1))
dof <- c(3,5,5)
#specify the distribution
distr <- "mst"
y <- c(1,2)
n=1
#then the density value at y for the mixture model is
ddmix(y, n, p, g, distr, mu, sigma, dof, delta)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.