Skip to contents

Main entry point for selecting the optimal number of synergies (latent factors) in mixture models. This unified interface dispatches to specialized selection methods based on the specified parameters.

Usage

select_r(
  list_of_data,
  model_type = c("MFA", "MPCA"),
  method = c("vaf", "vss", "smoothness", "cv", "multicriteria"),
  scope = c("global", "clusterwise", "hybrid"),
  K = NULL,
  rvec = 1:6,
  ...
)

Arguments

list_of_data

A list of N matrices, each of dimension (T_i x M)

model_type

Character, either "MFA" or "MPCA"

method

Character, selection method. One of:

  • "vaf" - Variance Accounted For threshold

  • "vss" - Very Simple Structure criterion

  • "smoothness" - Smoothness-based selection

  • "cv" - Cross-validation

  • "multicriteria" - Combined multiple criteria

scope

Character, scope of selection. One of:

  • "global" - Estimate r from pooled data

  • "clusterwise" - Estimate r separately for each cluster

  • "hybrid" - Combine global and clusterwise estimates

K

Integer, number of clusters (required for clusterwise/hybrid scope)

rvec

Integer vector, candidate r values to evaluate. Default: 1:6

...

Additional arguments passed to underlying selection functions

Value

A list containing:

best_r

Selected optimal r value

summary

Data frame with evaluation results for all candidate r values

best_model

Fitted model with optimal r (if refit_final = TRUE)

details

Additional details from the selection method

Details

This function provides a simplified interface to the various r selection methods available in the package. For more fine-grained control, use the specialized functions directly (e.g., select_r_by_vaf_mfa, select_r_mixture).

Deprecated Functions

The following functions are deprecated and will call select_r() with appropriate parameters:

  • select_r_by_vaf_mfa - Use select_r(method="vaf", model_type="MFA")

  • select_r_by_vaf_mpca - Use select_r(method="vaf", model_type="MPCA")

  • select_r_by_vss_mfa - Use select_r(method="vss", model_type="MFA")

  • select_r_by_vss_mpca - Use select_r(method="vss", model_type="MPCA")

Examples

if (FALSE) { # \dontrun{
# Simple VAF-based selection for MFA
result <- select_r(list_of_data, model_type = "MFA", method = "vaf",
                   scope = "global", K = 2, rvec = 1:5)

# Multicriteria selection with clusterwise scope
result <- select_r(list_of_data, model_type = "MFA", method = "multicriteria",
                   scope = "clusterwise", K = 3, rvec = 2:6)

# Cross-validation for MPCA
result <- select_r(list_of_data, model_type = "MPCA", method = "cv",
                   scope = "global", rvec = 1:4)
} # }