MatManly.EM: EM algorithm for matrix clustering

Description Usage Arguments Details Value Examples

View source: R/libMatManlyFull.R

Description

Runs the EM algorithm for matrix clustering

Usage

1
2
3
MatManly.EM(Y, X = NULL, initial = NULL, id = NULL, la = NULL, nu = NULL, tau = NULL, 
Mu = NULL, beta = NULL, Sigma = NULL, Psi = NULL, Mu.type = 0, Psi.type = 0, 
tol = 1e-05, max.iter = 1000, size.control = 0, silent = TRUE)

Arguments

Y

dataset of random matrices (p x T x n), n random matrices of dimensionality (p x T)

X

dataset of explanatory variables (T x q x n), q explanatory variables for modeling Y

initial

initialization parameters provided by function MatManly.init()

id

initial membership vector

la

initial transformation parameters (K x p)

nu

initial transformation parameters (K x T)

tau

initial mixing proportions (length K)

Mu

initial mean matrices (p x T x K)

beta

initial coefficient matrices (q x p x K)

Sigma

initial array of sigma (p x p x K)

Psi

initial array of psi (T x T x K)

Mu.type

mean structure: 0-unrestricted, 1-additive

Psi.type

covariance structure of the Psi matrix: 0-unrestricted, 1-AR1

tol

tolerance level

max.iter

maximum number of iterations

size.control

minimum size of clusters allowed for controlling spurious solutions

silent

whether to produce output of steps or not

Details

Runs the EM algorithm for modeling and clustering matrices for a provided dataset. Both matrix Gaussian mixture and matrix Manly mixture with given explanatory variables (data matrix X) or without explanatory variables (X is null) can be employed. A user has three options to initialize the EM algorithm. The user can use the MatManly.init() function to get initial parameters and input them as 'initial'. The second choice is to specify either initial id vector 'id' and transformation parameters 'la'. The third option is to input initial mode parameters 'la', 'tau', 'Mu', and 'Sigma' and 'Psi'. In the case when transformation parameters are not provided, the function runs the EM algorithm without any transformations, i.e., it is equivalent to the EM algorithm for a Gaussian mixture model. If some transformation parameters have to be excluded from the consideration, in the corresponding positions of matrix 'la', the user has to specify value 0. A user also has three options to specify the covariance structure of the 'Psi' matrices, including unrestricted case, spherical matrices and autoregressive structured matrices. Notation: n - sample size, p x T - dimensionality of the random matrices, K - number of mixture components.

Value

la

matrix of the skewness parameters (K x p)

nu

matrix of the skewness parameters (K x T)

tau

vector of mixing proportions (length K)

Mu

matrix of the estimated mean matrices (p x T x K)

beta

matrix of the coefficient parameters (q x p x K)

Sigma

array of the estimated sigma (p x p x K)

Psi

array of the estimated psi (T x T x K)

Mu.type

mean structure: 0-unrestricted, 1-additive

Psi.type

covariance structure of the Psi matrix: 0-unrestricted, 1-AR1

gamma

matrix of the estimated 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)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
set.seed(123)

data(crime)


Y <- crime$Y[c(2,7),,] / 1000

p <- dim(Y)[1]
T <- dim(Y)[2]
n <- dim(Y)[3]
K <-  2

#init <- MatManly.init(Y, K = K, la = matrix(0.1, K, p), nu = matrix(0.1, K, T))
#M1 <- MatManly.EM(Y, initial = init, max.iter = 1000)

MatManlyMix documentation built on May 2, 2019, 5:58 a.m.