tpapp / TransformVariables.jl

Transformations to contrained variables from ℝⁿ.
Other
66 stars 14 forks source link

Proposed transformation: Loading matrix for factor analysis #72

Open ElOceanografo opened 4 years ago

ElOceanografo commented 4 years ago

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

tpapp commented 3 years ago

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

ElOceanografo commented 3 years ago

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!