Runs the EM algorithm for matrix clustering
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)dataset of random matrices (p x T x n), n random matrices of dimensionality (p x T)
dataset of explanatory variables (T x q x n), q explanatory variables for modeling Y
initialization parameters provided by function MatManly.init()
initial membership vector
initial transformation parameters (K x p)
initial transformation parameters (K x T)
initial mixing proportions (length K)
initial mean matrices (p x T x K)
initial coefficient matrices (q x p x K)
initial array of sigma (p x p x K)
initial array of psi (T x T x K)
mean structure: 0-unrestricted, 1-additive
covariance structure of the Psi matrix: 0-unrestricted, 1-AR1
tolerance level
maximum number of iterations
minimum size of clusters allowed for controlling spurious solutions
whether to produce output of steps or not
matrix of the skewness parameters (K x p)
matrix of the skewness parameters (K x T)
vector of mixing proportions (length K)
matrix of the estimated mean matrices (p x T x K)
matrix of the coefficient parameters (q x p x K)
array of the estimated sigma (p x p x K)
array of the estimated psi (T x T x K)
mean structure: 0-unrestricted, 1-additive
covariance structure of the Psi matrix: 0-unrestricted, 1-AR1
matrix of the estimated posterior probabilities (n x K)
estimated membership vector (length n)
log likelihood value
Bayesian Information Criterion
number of EM iterations run
convergence flag (0 - success, 1 - failure)
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.
# NOT RUN {
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)
# }
Run the code above in your browser using DataLab