Skip to contents

Given the log-likelihood from compute_logLik_mpca, and the number of clusters K, dimension r, etc., this function computes the corrected BIC: BIC = -2 * log(L) + nu * log(N), where nu is the parameter count for MPCA. The corrected formula is K*(M*r + r*(r-1)/2 + M + 1) + (K-1), i.e. for each cluster we have (M*r) for the directions, r*(r-1)/2 for factor covariances, M for the mean, and 1 for sigma^2. Then (K-1) for mixing proportions.

Usage

compute_BIC_mpca(loglik, K, r, M, N_obs)

Arguments

loglik

The total mixture log-likelihood from compute_logLik_mpca.

K

Number of clusters.

r

Dimension of principal components.

M

Observed dimension.

N_obs

Number of observations (typically sum of all T_i across subjects).

Value

A numeric BIC value.

Details

The parameter count includes:

  • M*r: loading matrix (W or P)

  • r*(r-1)/2: factor covariances (off-diagonal elements)

  • M: cluster means (mu)

  • 1: isotropic noise variance (sigma2)

  • 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.