Class FactorAnalysis

java.lang.Object
edu.cmu.tetrad.search.FactorAnalysis

public class FactorAnalysis extends Object
Useful references: "Factor Analysis of Data Matrices" - Paul Horst (1965) This work has good specifications and explanations of factor analysis algorithm and methods of communality estimation.

"Applied Factor Analysis" - R.J. Rummel (1970) This book is a good companion to the book listed above. While it doesn't specify any actual algorithm, it has a great introduction to the subject that gives the reader a good appreciation of the philosophy and the mathematics behind factor analysis.

Author:
Mike Freenor
  • Constructor Details

    • FactorAnalysis

      public FactorAnalysis(ICovarianceMatrix covarianceMatrix)
    • FactorAnalysis

      public FactorAnalysis(DataSet dataSet)
  • Method Details

    • successiveResidual

      public Matrix successiveResidual()
      Successive method with residual matrix.

      This algorithm makes use of a helper algorithm. Together they solve for an unrotated factor loading matrix.

      This method calls upon its helper to find column vectors, with which it constructs its factor loading matrix. Upon receiving each successive column vector from its helper method, it makes sure that we want to keep this vector instead of discarding it. After keeping a vector, a residual matrix is calculated, upon which solving for the next column vector is directly dependent.

      We stop looking for new vectors either when we've accounted for close to all of the variance in the original correlation matrix, or when the "d scalar" for a new vector is less than 1 (the d-scalar is the corresponding diagonal for the factor loading matrix -- thus, when it's less than 1, the vector we've solved for barely accounts for any more variance). This means we've already "pulled out" all of the variance we can from the residual matrix, and we should stop as further factors don't explain much more (and serve to complicate the model).

      PSEUDO-CODE:

      0th Residual Matrix = Original Correlation Matrix Ask helper for the 1st factor (first column vector in our factor loading vector) Add 1st factor's d-scalar (for i'th factor, call its d-scalar the i'th d-scalar) to a list of d-scalars.

      While the ratio of the sum of d-scalars to the trace of the original correlation matrix is less than .99 (in other words, while we haven't accounted for practically all of the variance):

      i'th residual matrix = (i - 1)'th residual matrix SUBTRACT the major product moment of (i - 1)'th factor loading vector Ask helper for i'th factor If i'th factor's d-value is less than 1, throw it out and end loop. Otherwise, add it to the factor loading matrix and continue loop.

      END PSEUDO-CODE

      At the end of the method, the list of column vectors is actually assembled into a TetradMatrix.

    • successiveFactorVarimax

      public Matrix successiveFactorVarimax(Matrix factorLoadingMatrix)
    • setThreshold

      public void setThreshold(double threshold)
    • getThreshold

      public double getThreshold()
    • getNumFactors

      public int getNumFactors()
    • setNumFactors

      public void setNumFactors(int numFactors)
    • getResidual

      public Matrix getResidual()