gmm11R: Regularized GMM by Ruan et al. (2011)

Description Usage Arguments Value References Examples

View source: R/algorithm_gmm11R.R

Description

Ruan et al. (2011) proposed a regularized covariance estimation by graphical lasso to cope with high-dimensional scenario where conventional GMM might incur singular covariance components. Authors proposed to use λ as a regularization parameter as normally used in sparse covariance/precision estimation problems and suggested to use the model with the smallest BIC values.

Usage

1
gmm11R(data, k = 2, lambda = 1, ...)

Arguments

data

an (n\times p) matrix of row-stacked observations.

k

the number of clusters (default: 2).

lambda

regularization parameter for graphical lasso (default: 1).

...

extra parameters including

maxiter

the maximum number of iterations (default: 10).

nstart

the number of random initializations (default: 5).

usediag

a logical; covariances are diagonal if TRUE, or full covariances are returned for FALSE (default: FALSE).

Value

a named list of S3 class T4cluster containing

cluster

a length-n vector of class labels (from 1:k).

mean

a (k\times p) matrix where each row is a class mean.

variance

a (p\times p\times k) array where each slice is a class covariance.

weight

a length-k vector of class weights that sum to 1.

loglkd

log-likelihood of the data for the fitted model.

algorithm

name of the algorithm.

References

\insertRef

ruan_regularized_2011T4cluster

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -------------------------------------------------------------
#            clustering with 'iris' dataset
# -------------------------------------------------------------
## PREPARE
data(iris)
X   = as.matrix(iris[,1:4])
lab = as.integer(as.factor(iris[,5]))

## EMBEDDING WITH PCA
X2d = Rdimtools::do.pca(X, ndim=2)$Y  

## COMPARE WITH STANDARD GMM
cl.gmm = gmm(X, k=3)$cluster
cl.11Rf = gmm11R(X, k=3)$cluster
cl.11Rd = gmm11R(X, k=3, usediag=TRUE)$cluster

## VISUALIZATION
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,3), pty="s")
plot(X2d, col=cl.gmm,  pch=19, main="standard GMM")
plot(X2d, col=cl.11Rf, pch=19, main="gmm11R: full covs")
plot(X2d, col=cl.11Rd, pch=19, main="gmm11R: diagonal covs")
par(opar)

T4cluster documentation built on Aug. 16, 2021, 9:07 a.m.