estimate_leading_pc: Estimate the leading principal component

View source: R/31_pre_processing_functions.R

estimate_leading_pcR Documentation

Estimate the leading principal component

Description

Estimates the leading principal component of the input matrix using dense or sparse PCA.

Usage

estimate_leading_pc(control, pca_method = c("dense_pca", "sparse_pca"))

Arguments

control

A matrix or data frame. Each row is a sample, and each column is a feature.

pca_method

Character. PCA method to use. Options are "dense_pca" (default) or "sparse_pca".

Details

For low-dimensional settings (\le 30 features), the method automatically switches to dense PCA. For sparse PCA, the function uses the PMA::SPC.cv cross-validation method.

Value

A normalized numeric vector representing the leading principal component direction.

Examples

## Not run: 
X <- matrix(rnorm(100), nrow = 20)
estimate_leading_pc(X, pca_method = "dense_pca")

## End(Not run)


HMC documentation built on June 8, 2025, 10:32 a.m.

Related to estimate_leading_pc in HMC...