Skip to content

msPCA

0.5.1Package record

Sparse Principal Component Analysis with Multiple Principal Components

0packages depend
4.4Kdownloads / year
97.6%test coverage
13/13flavors OK

Overview

About

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.

Changes in 0.5.1
  • mspca() now records feasibilityConstraintType and nonredundancy in the returned object. nonredundancy holds two r x r matrices, orthogonality (\eqn{|u_t^\top u_s|}) and uncorrelatedness (\eqn{|u_t^\top \Sigma u_s| / \mathrm{tr}(\Sigma)}).
  • summary.mspca() now displays the feasibilityConstraintType used at fitting and the feasibility violation matrix in nonredundancy instead 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 of Sigma. This affects mspca(..., feasibilityConstraintType = 1) (the feasibility_violation field, the stopping rule, and the dual step size), feasibility_violation_off(), and the uncorrelatedness matrix in nonredundancy. Numerical results under feasibilityConstraintType = 1 may differ from earlier versions unless the input has tr(Sigma) = 1.
  • Additional input checks for mspca().
  • Minor documentation updates and clarification.
  • Added the snp500 dataset: 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() to snp500 comparing 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 in vignettes/articles/ and is not part of the CRAN build.
  • Added replication/, the scripts reproducing the benchmarking and case-study results. Build-ignored.
  • DESCRIPTION gains Depends: R (>= 3.5), LazyData: true, LazyDataCompression: xz and BugReports.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 3.5 min · r-devel-windows-x86_64
Status changes
  • 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
Advisories

none known

Documentation

In release 0.5.1
READMEYes · 1,016 wordsVignettesYes · 3 · dynamicNEWSYes · 100% structured · mentions 0.5.1Citation fileYes · cites a publicationWebsiteYes · pkgdown

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

4.4K
CRAN downloads in the past year
Rank #9,778 · ~12/day · ~366/mo
Daily download trend is not available in this view yet.
28430 days
1K90 days
4.4K1 year
Compare downloads with other packages →
Also on342 r2u3 autocran

Repository

1Stars
0Forks
0Open issues
0Open PRs
6Releases
211Commits
2Commit identities
dimensionality-reductionprincipal-component-analysisr-packagesparse-pca
211 commits · Last activity 2026-08-25 · 0% stars, 30d
Responsiveness
How these are sampled
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

2026-07-06 · 12026-07-07 · 1
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Governance and community (2)
Contributing guideIssue templates
Docs source (2)
pkgdown

GitHub Pages site last deployed 2026-08-25

pkgdown site last built 2026-08-25

Coverage (1)
Coverage reporting
Show all practicesHide 3 practices
Reproducibility and dev environment (1)
data-raw/
CRAN release process (1)
cran-comments.md
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • GitHub Copilotfirst seen on or before 2026-05-14
    Commits: at least 1 crediting it in the message
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
7 external dependencies (excludes base and recommended)

Installing msPCA adds 2 packages (2 with compiled code, 3.5 MB of source tarballs). Heaviest: Rcpp 1.8 MB, RcppEigen 1.7 MB.

Depends (1)
R >= 3.5
Imports (1)
LinkingTo (2)
Suggests (5)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

Datasets

People & History

People (2)
Author, Maintainer since 0.1.0 (2025), Copyright holder
Author, Copyright holder
Releases (7)

Pick two releases to compare their code metrics.

  • 0.5.1Latest
    record
    2026-06-25 · current release · diff ↗
  • 0.5.0
    record
    2026-06-25 · diff ↗ ·
    removed 1 export
    print_mspca
    added 1 export
    variance_explained_perPC
  • 0.4.1
    record
    2026-06-12 · diff ↗
  • 0.4.0
    record
    2026-05-22 · diff ↗ ·
    removed 2 exports
    orthogonality_violation, pairwise_correlation
    added 2 exports
    feasibility_violation_off, fraction_variance_explained_perPC
  • 0.3.0
    record
    2026-05-15 · diff ↗ ·
    removed 1 export
    tpw
    added 1 export
    tpm
  • R
    R 4.6.0 released · 2026-04-24
  • 0.2.0
    record
    2026-01-12 · diff ↗ ·
    added 1 export
    pairwise_correlation
  • 0.1.0
    record
    2025-12-09
  • R
    R 4.5.0 released · 2025-04-11

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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for msPCA version 0.5.1 [Data set]. HJJB, LLC. Data release v2026-10-23. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy