Compute PC Factor Scores for All Subjects in a Mixture PCA Model
Source:R/rotation.R
compute_factor_scores_mpca.RdGiven a fitted MPCA model (with z, mu, W, sigma2 for each cluster),
this function computes the posterior factor (PC) scores Z_i(t) for each subject i
and stores them in mpca_fit$factor_scores[[i]].
Arguments
- mpca_fit
A fitted MPCA model from
mixture_pca_em_fit()orselect_optimal_K_r_mpca()$best_model_info$model, typically containing:z[i]: cluster assignments (1..K),mu[[k]],W[[k]],sigma2[k]for each cluster,possibly
P[[k]], D[[k]]instead ofW[[k]].
- list_of_data
The same list of data
(T_i x M)used to fit the model.
Value
The same mpca_fit object, but with a new element factor_scores,
where factor_scores[[i]] is a (T_i x r) matrix of PC scores for subject i.
Details
We use compute_factor_scores_mpca_single for each subject, with the
appropriate cluster parameters. This assumes isotropic noise sigma2[k] for cluster k.