TransformVariables.jl icon indicating copy to clipboard operation
TransformVariables.jl copied to clipboard

Proposed transformation: Loading matrix for factor analysis

Open ElOceanografo opened this issue 6 years ago • 2 comments

Would there be any interest in a "special array" transformation to create loading matrices for factor analysis? i.e., when n observed variables are represented by m <= n latent factors, the loading matrix L has size (n, m) and links the latent variables x to observed variables y as y ~ MvNormal(L * x, sigma). When fitting it by MLE/MCMC, all entries above the diagonal are set to zero to ensure the columns are linearly independent. The transform is thus from a vector with (n - m + 2) * m elements to an n * m matrix.

I've got a working example hacked together that I could turn into a pull request if this would be useful for others...

ElOceanografo avatar Mar 24 '20 16:03 ElOceanografo

Sorry for the late reply. I am not familiar with these methods, so an example would help clarify.

tpapp avatar May 05 '21 15:05 tpapp

I actually went and turned my working example into its own small package: https://github.com/ElOceanografo/FactorLoadingMatrices.jl. There's an example in the readme that illustrates the intended usage. Basically the transformation constructs the first m columns of a Cholesky lower triangle, so you can do dimensionality reduction inside a probabilistic model.

Still happy to contribute the transformation here as well if you want!

ElOceanografo avatar May 05 '21 16:05 ElOceanografo