Compute Factor Scores for All Subjects in an MFA Model
Source:R/rotation.R
compute_factor_scores_mfa.RdGiven a fitted MFA model (with z, mu, Lambda, Psi for each cluster),
this function computes the posterior factor scores Z_i(t) for each subject i
and stores them in model$factor_scores[[i]].
Arguments
- mfa_fit
A fitted MFA model, typically from
mfa_em_fit()orselect_optimal_K_r_mfa()$best_model_info$model, containing:z[i]: cluster assignments,Lambda[[k]],Psi[[k]],mu[[k]]for each cluster k.
- list_of_data
The same list of data
(T_i x M)used to fit the model.
Value
The same mfa_fit object, but with a new element factor_scores
(a list of length N), where each factor_scores[[i]] is a
(T_i x r) matrix of factor scores for subject i.
Details
Internally, it calls compute_factor_scores_optimized for each subject,
using that subject's assigned cluster k = z[i].