env_dim_selection: Envelope dimension selection

Description Usage Arguments Value Examples

View source: R/subspace_dimension_selection.R

Description

Select envelope dimension from a given range

Usage

1
env_dim_selection(dim_rng, da, K, iter, stopping=1e-7, opts=NULL, init, typ="G", add_eye="False")

Arguments

dim_rng

The range of envelope dimension we want to choose from

da

Data for clustering

K

Selected number of clusters

iter

Maximum iteration for EM algorithm

stopping

Stopping criterion

init

Initial values for EM

typ

CLEMM Type, "G": General CLEMM; "S": CLEMM-Shared

add_eye

Add 0.01*I_r to prevent S_k being too singular

opts

Parameters for mannifold optimization

Value

awe

AWE values for different envelope dimensions

u

Selected envelope dimension which corresponds to the minimum AWE values

Examples

 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
set.seed(999)
K <- 4;r <- 15; u<- 2;N <- 1000;md=2
da <- data_generation(r, u, N, K, md)
pi0 <- rep(0.25, 4)

set.seed(1)
idx <- sample(1:K, N, replace = TRUE, prob = pi0)
dat <- matrix(NA, N, r)
for (j in 1:K) {
    if(md <= 3){
      x_tmp <- rmvnorm(sum(idx==j), mean = da$mu[, j], sigma = da$Sigma[, , j])
    }else{ x_tmp <- rmvnorm(sum(idx==j), mean = da$mu[, j], sigma = da$Sigma)}
    dat[idx==j, ] <- x_tmp
}

opts <- c()
opts$record <- 0
opts$mxitr <- 2000
opts$xtol <- 1e-10
opts$gtol <- 1e-10
opts$ftol <- 1e-10

init=list()
init$centers = da$mu
init$wt = pi0
init$cov = da$Sigma

dim_sel_G = env_dim_selection(1:12, dat, K, iter=800, stopping=1e-7, init=init)

kusakehan/CLEMM documentation built on May 24, 2019, 2:46 p.m.