spcaWrapper: Sparse PCA Wrapper

View source: R/spcaWrapper.R

spcaWrapperR Documentation

Sparse PCA Wrapper

Description

This wrapper function specifies which implementation of sparse pricincipal component analysis (SPCA) is used to sparsify the loadings of the contrastive covariance matrix. Currently, the scPCA package supports the iterative algorithm detailed by \insertCitezou2006sparse;textualscPCA, and \insertCiteerichson2018sparse;textualscPCA's randomized and non-randomized versions of SPCA solved via variable projection. These methods are implemented in the elasticnet and sparsepca packages.

Usage

spcaWrapper(
  alg,
  contrast_cov,
  contrast,
  k,
  penalty,
  eigdecomp_tol,
  eigdecomp_iter
)

Arguments

alg

A character indicating the SPCA algorithm used to sparsify the contrastive loadings. Currently supports iterative for the \insertCitezou2006sparse;textualscPCA implemententation, var_proj for the non-randomized \insertCiteerichson2018sparse;textualscPCA solution, and rand_var_proj for the randomized \insertCiteerichson2018sparse;textualscPCA result.

contrast_cov

A contrastive covariance matrix.

contrast

A numeric contrastive parameter used to compute the contrastive covariance matrix.

k

A numeric indicating the number of eigenvectors (or sparse contrastive components) to be computed.

penalty

A numeric indicating the L1 penalty parameter applied to the loadings.

eigdecomp_tol

A numeric providing the level of precision used by eigendecompositon calculations.

eigdecomp_iter

A numeric indicating the maximum number of interations performed by eigendecompositon calculations.

Value

A p x k sparse loadings matrix, where p is the number of features, and k is the number of sparse contrastive components.

References

\insertAllCited

PhilBoileau/scPCA documentation built on Feb. 6, 2024, 3:33 p.m.