statsmodels/statsmodels — pull request #1384 by kshedden (2014-02-12 07:34:02+00:00)
Title: Additions to correlation tools

This PR adds a few new methods for fitting factor-structured correlation or SPD matrices to a given matrix.

There are two main routines for users: cor_nearest_factor and cov_nearest_eye_factor. Both of these routines attempt fit a factor structure to a given matrix by minimizing the Frobenius norm.

These routines can be used to do factor analysis, but the main application is to take an estimated correlation or covariance matrix that is not SPD and fit it to an SPD matrix. Imposing a factor structure provides a form of regularization, and also allows for faster manipulation (inversion, square roots, etc.) of very large matrices.

cor_nearest_factor uses general-purpose optimization techniques (spectral projected gradient and non monotone line searching) that may have other uses. Perhaps these routines belong in a different file.

tests, docstrings, and literature references are provided.

There is also a utility function corr_thresholded for thresholding larger correlation matrices that are too big to fit into memory.