Learn R Programming

ManlyMix (version 0.1.3)

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

la
matrix of the estimated transformation parameters (K x p)
tau
vector of mixing proportions (length K)
Mu
matrix of the estimated mean vectors (K x p)
S
array of the estimated covariance matrices (p x p x K)
gamma
matrix of posterior probabilities (n x K)
id
estimated membership vector (length n)
ll
log likelihood value
bic
Bayesian Information Criterion
iter
number of EM iterations run
flag
convergence 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