Skip to main content

fa_from_centered

Function fa_from_centered 

Source
pub fn fa_from_centered(
    mat: &[f64],
    d: usize,
    t: usize,
    n_factors: usize,
    n_iter: usize,
) -> (Vec<f64>, Vec<f64>)
Expand description

Factor-analysis EM of a mean-centred matrix mat (d × t).

The loadings start from a deterministic PCA initialisation (top eigenvectors of the sample covariance scaled by sqrt of the eigenvalues, sign-fixed), and each EM step solves its SPD M and E[zzᵀ] systems by Cholesky. Returns (loadings [d × nf], uniquenesses [d]).