Skip to contents

Computes the global Variance Accounted For (VAF) for a fitted MFA or MPCA model. This is a unified wrapper that dispatches to the appropriate method-specific function.

Usage

compute_vaf_wrapper(method, list_of_data, fit)

Arguments

method

Model type: "MFA" or "MPCA".

list_of_data

A list of data matrices, each (T_i x M).

fit

A fitted model object.

Value

Numeric scalar: VAF value in [0, 1], where 1 indicates perfect reconstruction. Returns NA if computation fails.

Details

VAF is computed as \(1 - SSE/SST\), where SSE is the sum of squared reconstruction errors and SST is the total sum of squares.

Examples

if (FALSE) { # \dontrun{
fit <- mfa_em_fit(list_of_data, K = 3, r = 2)
vaf <- compute_vaf_wrapper("MFA", list_of_data, fit)
} # }