Given the log-likelihood from compute_logLik_mfa, and known
K, r, M, N, this function computes
BIC = -2 * log(L) + nu * log(N),
where nu is the parameter count for the MFA model. The corrected formula is
nu = K * (M * r + r * (r-1)/2 + M + M) + (K - 1).
Details
The parameter count includes:
M*r: factor loadings (Lambda)r*(r-1)/2: factor covariances (off-diagonal elements)M: unique variances (diagonal Psi)M: cluster means (mu)K-1: mixing proportions
This corrected formula properly penalizes larger r values, improving r estimation stability.
Note: N_obs should typically be the total number of time points (sum of T_i) rather than the number of subjects, as BIC penalizes based on sample size.