Estimate the number of components and loading reliability (shared helpers)
Source:R/components_utils.R
estimate_components.RdThese helpers provide a common interface for component retention and loading
reliability across bada, mfa, penalized_mfa, and related
models. They are intentionally modular so alternative criteria (e.g., AIC,
permutations) can be added later without changing call sites.
Arguments
- fit
A fitted object (e.g.,
bada,mfa,penalized_mfa,penalized_mfa_clusterwise).- method
Component or reliability method. For
estimate_components, one of"rmt"(Marchenko–Pastur edge) or"variance"(keep all non-zero). Forloading_reliability, currently"bootstrap".- sdev
Optional singular values; if
NULL, taken fromfit$sdevwhen available.- V_list
Optional list of loading matrices; if
NULL, the helper attempts to extract fromfit(usingattr(fit, "V_list")or splittingfit$vbyblock_indiceswhen present).- n
Optional number of observations (rows); defaults to
nrowof scores if available.- tail_q
Numeric; fraction of smallest eigenvalues used to estimate noise variance for the RMT test (default 0.2). Only used in
estimate_componentswhenmethod = "rmt".- alpha
Confidence level for hypothesis tests or bootstrap intervals.
- boot_loadings
For
loading_reliability: a list of loading matrices from bootstrap refits (all same dimensions as the reference loadings).- V_ref
For
loading_reliability: optional reference loading matrix. IfNULL, extracted fromfitusing the same logic asV_list.