Skip to contents

Similar to compute_global_vaf_mfa, but uses a Mixture PCA model structure. Given a model with z, mu, P, D, Psi, we reconstruct each subject's data from the principal component scores, accumulate SSE, and compare to total sum of squares (SST).

Usage

compute_global_vaf_mpca(list_of_data, res)

Arguments

list_of_data

A list of (T_i x M) data matrices.

res

The fitted Mixture PCA model, typically from mixture_pca_em_fit. Must contain:

  • z: cluster assignments (length N).

  • mu: list of length K, each (M) vector.

  • P: list of length K, each (M x r).

  • D: list of length K, each (r x r) diagonal.

  • Psi: list of length K, each (M x M) diagonal.

Value

A numeric scalar, \(1 - \mathrm{SSE}/\mathrm{SST}\) across all subjects and time steps.

Details

The user must define how to reconstruct data from PCA parameters. Typically, for each cluster k, we have W = P * D, so we either compute posterior scores or do a direct projection.