MFA_ECM {autoMFA} | R Documentation |
ECM-Based MFA Estimation
Description
An implementation of an ECM algorithm for the MFA model which does not condition on the factors being known (Zhao and Yu 2008).
Performs a grid search from gmin
to gmax
, and qmin
to qmax
, respectively. The best combination of g and q is chosen to be the model with the minimum BIC.
Usage
MFA_ECM(
Y,
gmin = 1,
gmax = 10,
qmin = 1,
qmax = NULL,
eta = 0.005,
itmax = 500,
nkmeans = 5,
nrandom = 5,
tol = 1e-05,
conv_measure = "diff",
varimax = FALSE
)
Arguments
Y |
An n by p data matrix, where n is the number of observations and p is the number of dimensions of the data. |
gmin |
The smallest number of components for which an MFA model will be fitted. |
gmax |
The largest number of components for which an MFA model will be fitted. |
qmin |
The smallest number of factors with which an MFA model will be fitted. |
qmax |
The largest number of factors with which an MFA model will be fitted. Must obey the Ledermann bound. |
eta |
The smallest possible entry in any of the error matrices D_i (Zhao and Yu 2008). |
itmax |
The maximum number of ECM iterations allowed for the estimation of each MFA model. |
nkmeans |
The number of times the k-means algorithm will be used to initialise models for each combination of g and q. |
nrandom |
The number of randomly initialised models that will be used for each combination of g and q. |
tol |
The ECM algorithm terminates if the measure of convergence falls below this value. |
conv_measure |
The convergence criterion of the ECM algorithm. The default |
varimax |
Boolean indicating whether the output factor loading matrices should be constrained using varimax rotation or not. |
Value
A list containing the following elements:
model
: A list specifying the final MFA model. This contains:B
: A p by p by q array containing the factor loading matrices for each component.D
: A p by p by g array of error variance matrices.mu
: A p by g array containing the mean of each cluster.pivec
: A 1 by g vector containing the mixing proportions for each FA in the mixture.numFactors
: A 1 by g vector containing the number of factors for each FA.
clustering
: A list specifying the clustering produced by the final model. This contains:responsibilities
: A n by g matrix containing the probability that each point belongs to each FA in the mixture.allocations
: A n by 1 matrix containing which FA in the mixture each point is assigned to based on the responsibilities.
diagnostics
: A list containing various pieces of information related to the fitting process of the algorithm. This contains:bic
: The BIC of the final model.logL
: The log-likelihood of the final model.times
: A data frame containing the amount of time taken to fit each MFA model.totalTime
: The total time taken to fit the final model.
References
Zhao J, Yu PLH (2008). “Fast ML Estimation for the Mixture of Factor Analyzers via an ECM Algorithm.” IEEE Transactions on Neural Networks, 19(11), 1956-1961. ISSN 1045-9227.
Examples
RNGversion('4.0.3'); set.seed(3)
MFA.fit <- MFA_ECM(autoMFA::MFA_testdata,3,3)