model_selection {deepgmm} R Documentation

## Function to compare different models

### Description

Compares different models and return the best one selected according to criterion (BIC or AIC).

### Usage

model_selection(y, layers, g, seeds = 3, it = 50, eps = 0.001,
init = "kmeans", init_est = "factanal", criterion = "BIC")


### Arguments

 y A matrix or a data frame in which rows correspond to observations and columns to variables. layers The number of layers in the deep Gaussian mixture model. Admitted values are 1, 2 or 3. g The number of clusters. seeds Numeric vector containing seeds to try. it Maximum number of EM iterations. eps The EM algorithm terminates the relative increment of the log-likelihod falls below this value. init Initial paritioning of the observations to determine initial parameter values. See Details. init_est To determine how the initial parameter values are computed. See Details. criterion Model selection criterion, either "AIC" of "BIC".

### Details

Compares different models and return the best one selected according to criterion (BIC or AIC). One can use diffefrent number of seeds.

### Value

A list containing an object of class "dgmm" containing fitted values and list of BIC and AIC values.

### References

Viroli, C. and McLachlan, G.J. (2019). Deep Gaussian mixture models. Statistics and Computing 29, 43-51.

### Examples


layers <- 2
k <- c(3, 4)
r <- c(3, 2)
it <- 50
eps <- 0.001
y <- scale(mtcars)

sel <- model_selection(y, layers, 3, seeds = 1, it = 250, eps = 0.001)
sel

summary(sel)



[Package deepgmm version 0.1.62 Index]