Unified interface for computing log-likelihood for both MFA and MPCA models.
Automatically detects model type from the fit object structure.
Usage
compute_logLik(list_of_data, fit, model_type = NULL)
Arguments
- list_of_data
A list of N matrices, each of dimension (T_i x M)
- fit
A fitted model object (MFA or MPCA)
- model_type
Character, either "MFA" or "MPCA". If NULL, auto-detected
from the fit object structure.
Value
A numeric scalar representing the total log-likelihood
Examples
if (FALSE) { # \dontrun{
# Works with either MFA or MPCA fit objects
ll <- compute_logLik(list_of_data, fit)
# Or explicitly specify model type
ll <- compute_logLik(list_of_data, fit, model_type = "MFA")
} # }