Skip to contents

Given a fitted MFA model (with K clusters, each containing Lambda[[k]], mu[[k]], Psi[[k]], and mixing proportion pi[k]), this function computes the standard mixture log-likelihood: $$ \sum_{i=1}^{N} \log\left( \sum_{k=1}^{K} \pi_k \prod_{t=1}^{T_i} \mathcal{N}(x_{i,t} \mid \mu_k, \Sigma_k) \right), $$ where Sigma_k = Lambda_k * Lambda_k^T + Psi_k.

Usage

compute_logLik_mfa(list_of_data, mfa_fit)

Arguments

list_of_data

A list of length N, each an (T_i x M) matrix.

mfa_fit

A fitted MFA model, containing:

  • K clusters (implicit from length(mfa_fit$Lambda)),

  • Lambda[[k]], mu[[k]], Psi[[k]],

  • pi as a length-K vector of mixing proportions.

Value

A numeric scalar, the total log-likelihood.

Details

Internally uses rowwise multivariate normal densities. You will need mvtnorm::dmvnorm or an equivalent. Ensure each Sigma_k is well-defined and invertible if needed.