Skip to contents

This function computes the Variance Accounted For (VAF) for a fitted Mixture PCA model.

Usage

compute_VAF_mpca(list_of_data, mpca_fit, z)

Arguments

list_of_data

A list of subject data matrices.

mpca_fit

A fitted MPCA model with P, D, Psi, mu.

z

An integer vector of cluster assignments.

Value

A numeric scalar for the overall VAF.

Examples

if (FALSE) { # \dontrun{
sim <- simulate_mixture_data(N = 50, K = 3, r = 2, M = 6, T_each = 100)
fit <- mixture_pca_em_fit(sim$list_of_data, K = 3, r = 2)
vaf <- compute_VAF_mpca(sim$list_of_data, fit, fit$z)
print(vaf)
} # }