This function takes a fitted MFA model (with elements z, mu, Lambda, Psi)
and reconstructs all subjects' data from the factor scores, computing the
ratio of explained variance (\(1 - \mathrm{SSE}/\mathrm{SST}\)).
Arguments
- list_of_data
A list of matrices, each
(T_i x M), containing the original data.- res
A fitted MFA model result. It must contain:
z: A length-N vector of cluster assignments (1..K).mu: A list of length K, each a mean vector of length M.Lambda: A list of length K, each anM x rloading matrix.Psi: A list of length K, each anM x Mdiagonal matrix.
Details
For each subject i, we identify its cluster assignment k_i, compute factor scores
via compute_factor_scores, reconstruct Xhat from the factor model,
accumulate the sum of squares of residuals (SSE), and the sum of squares total (SST).
Examples
if (FALSE) { # \dontrun{
gvaf <- compute_global_vaf_mfa(my_data_list, fit_mfa)
cat("Global VAF:", gvaf, "\n")
} # }