Marginal parameters from fitted GMMs via mclust
mclustMarginalParams.RdFunction to compute the marginal parameters from a fitted Gaussian mixture models.
Arguments
- object
An object of class
MclustordensityMclust.- ...
Further arguments passed to or from other methods.
- pro
A vector of mixing proportions for each mixture component.
- mu
A matrix of mean vectors for each mixture component. For a \(d\)-variate dataset on \(G\) components, the matrix has dimension \((d \times G)\).
- sigma
An array of covariance matrices for each mixture component. For a \(d\)-variate dataset on \(G\) components, the array has dimension \((d \times d \times G)\).
Details
Given a \(G\)-component GMM with estimated mixture weight \(\pi_k\), mean vector \(\mu_{k}\), and covariance matrix \(\Sigma_{k}\), for mixture component \(k = 1, \dots, G\), then the marginal distribution has:
mean vector $$\mu = \sum_{k=1}^G \pi_k \mu_k$$
covariance matrix $$\Sigma = \sum_{k=1}^G \pi_k \Sigma_k + \pi_k (\mu_k - \mu)'(\mu_k - \mu)$$
References
Frühwirth-Schnatter S. (2006) Finite Mixture and Markov Switching Models, Springer, Sec. 6.1.1
Examples
x = iris[,1:4]
mod = Mclust(x, G = 3)
mod$parameters$pro
#> [1] 0.3333333 0.3005423 0.3661243
mod$parameters$mean
#> [,1] [,2] [,3]
#> Sepal.Length 5.006 5.915044 6.546807
#> Sepal.Width 3.428 2.777451 2.949613
#> Petal.Length 1.462 4.204002 5.482252
#> Petal.Width 0.246 1.298935 1.985523
mod$parameters$variance$sigma
#> , , 1
#>
#> Sepal.Length Sepal.Width Petal.Length Petal.Width
#> Sepal.Length 0.13320850 0.10938369 0.019191764 0.011585649
#> Sepal.Width 0.10938369 0.15495369 0.012096999 0.010010130
#> Petal.Length 0.01919176 0.01209700 0.028275400 0.005818274
#> Petal.Width 0.01158565 0.01001013 0.005818274 0.010695632
#>
#> , , 2
#>
#> Sepal.Length Sepal.Width Petal.Length Petal.Width
#> Sepal.Length 0.22572159 0.07613348 0.14689934 0.04335826
#> Sepal.Width 0.07613348 0.08024338 0.07372331 0.03435893
#> Petal.Length 0.14689934 0.07372331 0.16613979 0.04953078
#> Petal.Width 0.04335826 0.03435893 0.04953078 0.03338619
#>
#> , , 3
#>
#> Sepal.Length Sepal.Width Petal.Length Petal.Width
#> Sepal.Length 0.42943106 0.10784274 0.33452389 0.06538369
#> Sepal.Width 0.10784274 0.11596343 0.08905176 0.06134034
#> Petal.Length 0.33452389 0.08905176 0.36422115 0.08706895
#> Petal.Width 0.06538369 0.06134034 0.08706895 0.08663823
#>
mclustMarginalParams(mod)
#> $mean
#> [,1] [,2] [,3] [,4]
#> [1,] 5.843333 3.057333 3.758 1.199333
#>
#> $variance
#> [,1] [,2] [,3] [,4]
#> [1,] 0.68590753 -0.03840722 1.2675722 0.5115543
#> [2,] -0.03840722 0.19181382 -0.3304093 -0.1210532
#> [3,] 1.26757218 -0.33040933 3.0982006 1.2879867
#> [4,] 0.51155432 -0.12105317 1.2879867 0.5775488
#>