Sparse Principal Component Analysis with Multiple Principal Components
Overview
Implements an algorithm for computing multiple sparse principal components of a dataset. The method is based on Cory-Wright and Pauphilet "Sparse PCA with Multiple Components" (2026) doi:10.1287/opre.2023.0598. The algorithm uses an iterative deflation heuristic with a truncated power method applied at each iteration to compute sparse principal components with controlled sparsity.
mspca()now recordsfeasibilityConstraintTypeandnonredundancyin the returned object.nonredundancyholds two r x r matrices,orthogonality(\eqn{|u_t^\top u_s|}) anduncorrelatedness(\eqn{|u_t^\top \Sigma u_s| / \mathrm{tr}(\Sigma)}).summary.mspca()now displays thefeasibilityConstraintTypeused at fitting and the feasibility violation matrix innonredundancyinstead of recomputing them. Its printed output now names the constraint definition in use and points to the stored matrices for the other one.- New weighting rule for the per-component penalty weights to unify both constraint types and improve convergence.
- Uncorrelatedness violations are now normalized by the total variance
tr(Sigma), i.e. the pairwise term is|u_t' Sigma u_s| / tr(Sigma). The normalized measure is now invariant to a rescaling ofSigma. This affectsmspca(..., feasibilityConstraintType = 1)(thefeasibility_violationfield, the stopping rule, and the dual step size),feasibility_violation_off(), and theuncorrelatednessmatrix innonredundancy. Numerical results underfeasibilityConstraintType = 1may differ from earlier versions unless the input hastr(Sigma) = 1. - Additional input checks for
mspca(). - Minor documentation updates and clarification.
- Added the
snp500dataset: the market-deflated correlation matrix of daily log-returns for 423 S&P 500 constituents, January 2010 - December 2019 (423 x 423, xz-compressed). - Added a vignette "Case study: sparse factors in S&P 500 returns", a full application of
mspca()tosnp500comparing the two non-redundancy constraints. - Added a vignette "Algorithm and implementation notes", documenting the optimization problem, both algorithms, the implicit matrix-vector implementation, computational complexity, and guidance on parameter choices.
- Added a website-only article "Benchmarking against other sparse PCA packages", comparing
mspca()against seven competing implementations on four real datasets. It lives invignettes/articles/and is not part of the CRAN build. - Added
replication/, the scripts reproducing the benchmarking and case-study results. Build-ignored. DESCRIPTIONgainsDepends: R (>= 3.5),LazyData: true,LazyDataCompression: xzandBugReports.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-09
- ERROR12 OK, 1 ERROR2026-06-08
- OK12 OK2026-04-25
Show 3 earlier changesHide 3 earlier changes
- NOTE12 OK, 2 NOTE2026-04-22
- ERROR11 OK, 2 NOTE, 1 ERROR2026-04-18
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
The repository also keeps web-only articles.
- Help pages
- 9
- Examples that run
- 100%7 run in a plain check
- Exported functions with examples
- 67%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 11%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 812
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Releases over time
Issues over time
Commits over time
10 development-tooling and community-health practices detected across 7 families in the upstream repository
Checks run against github.com/jeanpauphilet/mspca on 2026-10-21.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Show all practicesHide 3 practices
This repository shows signs of AI coding tools.
- GitHub Copilotfirst seen on or before 2026-05-14Commits: at least 1 crediting it in the message
Dependencies
Code & Tests
Datasets
People & History
Package metadata
- First published
- 2025-12-09
- Total releases
- 7 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.5
- Bundled data
- 779 KB / 1 file
- Download size
- 1.3 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("msPCA")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.1287/opre.2023.0598.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.