Learn R Programming

ManlyMix (version 0.1.2)

Manly.select: Manly transformation selection

Description

Runs forward or backward model selection procedures for finding the optimal model in terms of BIC.

Usage

Manly.select(X, model, method, tol = 1e-5, max.iter = 1000, silent = FALSE)

Arguments

X
dataset matrix (n x p)
model
list containing parameters of the initial model
method
model selection method (options 'forward' and 'backward')
tol
tolerance level
max.iter
maximum number of iterations
silent
output control

Value

  • lamatrix of the estimated transformation parameters (K x p)
  • tauvector of mixing proportions (length K)
  • Mumatrix of the estimated mean vectors (K x p)
  • Sarray of the estimated covariance matrices (p x p x K)
  • gammamatrix of posterior probabilities (n x K)
  • idestimated membership vector (length n)
  • lllog likelihood value
  • bicBayesian Information Criterion
  • iternumber of EM iterations run
  • flagconvergence flag (0 - success, 1 - failure)

Details

Runs Manly forward and backward model selection procedures for a provided dataset. Forward and backward selection can be started from any ManlyMix object provided in 'model'. Manly transformation parameters are provided in matrix 'model$la'. If some transformations are not needed for specific components, zeros have to be specified in corresponding poisition. When all transformation parameters are set to zero, Manly mixture model degenerates to a Gaussian mixture model. Notation: n - sample size, p - dimensionality of the dataset X, K - number of mixture components.

See Also

Manly.EM

Examples

Run this code
set.seed(123)

K <- 3; p <- 4
X <- as.matrix(iris[,-5])
id.true <- rep(1:K, each = 50)

# Obtain initial memberships based on the K-means algorithm
id.km <- kmeans(X, K)$cluster

# Run the EM algorithm for a Gaussian mixture model based on K-means solution
G <- Manly.EM(X, id = id.km)
id.G <- G$id

# Run FORWARD SELECTION ('silent' is on)
F <- Manly.select(X, model = G, method = "forward", silent = TRUE)

# Run the EM algorithm for a full Manly mixture model based on Gaussian mixture solution
la <- matrix(0.1, K, p)
M <- Manly.EM(X, id = id.G, la = la)

# Run BACKWARD SELECTION ('silent' is off)
B <- Manly.select(X, model = M, method = "backward")

BICs <- c(G$bic, M$bic, F$bic, B$bic)
names(BICs) <- c("Gaussian", "Manly", "Forward", "Backward")
BICs

Run the code above in your browser using DataLab