Learn R Programming

autoMFA (version 1.0.0)

amofa: Adaptive Mixture of Factor Analyzers (AMoFA)

Description

An implementation of the Adaptive Mixture of Factor Analyzers (AMoFA) algorithm from kaya2015adaptiveautoMFA. This code is a R port of the MATLAB code which was included with that paper.

Usage

amofa(data, itmax = 100, verbose = FALSE, varimax = FALSE)

Arguments

data

An n by p data matrix, where n is the number of observations and p is the number of dimensions of the data.

itmax

The maximum number of EM iterations allowed for the estimation of each MFA model.

verbose

Boolean indicating whether or not to print more verbose output, including the number of EM-iterations used and the total running time. Default is FALSE.

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 list 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.

    • totalEM: The total number of EM iterations used.

    • progress: A matrix containing information about the decisions made by the algorithm.

    • times: The time taken for each loop in the algorithm.

    • totalTime: The total time taken to fit the final model.

References

kaya2015adaptiveautoMFA

Examples

Run this code
# NOT RUN {
RNGversion('4.0.3'); set.seed(3)
MFA.fit <- amofa(autoMFA::MFA_testdata)

# }

Run the code above in your browser using DataLab