Skip to contents

Similar to align_factor_signs_mfa, but for a Mixture PCA model whose loadings are in W[[k]].

Usage

align_factor_signs_mpca(mpca_fit, method = c("max_abs"), cluster_ids = NULL)

Arguments

mpca_fit

A fitted MPCA model (with W[[k]], factor_scores[[i]], z, etc.).

method

A string specifying how to choose the sign. Defaults to "max_abs".

cluster_ids

Which clusters to process. Defaults to all.

Value

The same mpca_fit object, but with possibly flipped signs in W columns and factor_scores columns (if present).

Details

- For each cluster k, we loop over each factor (column) in W[[k]]. If the entry with largest absolute loading is negative, we multiply that entire column by -1. - If factor_scores is present, we also multiply the corresponding column in each subject's factor scores by -1.