Skip to content

mvrsquared

0.1.6Package record

Compute the Coefficient of Determination for Vector or Matrix Outcomes

1packages depend
3.2Kdownloads / year
98.7%test coverage
13/13flavors OK

Overview

About

Compute the coefficient of determination for outcomes in n-dimensions. May be useful for multidimensional predictions (such as a multinomial model) or calculating goodness of fit from latent variable models such as probabilistic topic models like latent Dirichlet allocation or deterministic topic models like latent semantic analysis. Based on Jones (2019) doi:10.48550/arXiv.1911.11061.

Changes in 0.1.6

This patch addresses the issue with package documentation highlighted by CRAN and

described here

It also cites the arXiv paper in the DESCRIPTION by its DOI,

<doi:10.48550/arXiv.1911.11061>, rather than as <arXiv:1911.11061>, which

CRAN's checks had been flagging with a NOTE.

This patch also makes calc_rsquared() substantially faster, with no change to

its arguments or return value.

  • **Sparse y is no longer read as though it were dense.** The calculation visited every cell of y and read each one out of the sparse matrix, which costs a search per read; on a 70,676 x 20,926 matrix that was roughly three billion searches to read four million nonzeros. Both sums of squares split into a part over the nonzeros and a part that does not depend on y's values, and the second part has a closed form, so only the nonzeros need visiting. On that matrix with 100 latent dimensions: **194 s to 1.5 s single threaded, and 16.6 s to 0.34 s on twelve threads.**
Show all changes in 0.1.6Hide the rest of the changes in 0.1.6
  • **A yhat supplied directly no longer builds an identity matrix.** When yhat was given as a matrix rather than as two matrices to multiply, it was turned into a factorization by pairing it with an identity the width of y -- quadratic memory in the number of columns, and a matrix multiplication that did nothing. Such a yhat now goes to its own routine. At 20,926 columns the identity alone was 3.5 GB, so this case previously became unusable on wide outcomes well before it became slow.
  • **Results are unchanged**, to floating point tolerance. The sums are accumulated in a different order, so this is not bit-for-bit identical to 0.1.5; agreement with a dense reference calculation is to about 1e-14 relative, and R-squared is unchanged in every digit print() will show you.
  • **The note about parallelism and precision has been retired.** Results do not depend on threads: each observation writes its own slot and the totals are summed sequentially afterwards. Thread counts from 1 to 12 were verified to give bit-identical results, on both the factorized and direct paths.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 3.7 min · r-devel-windows-x86_64
Status changes
  • OK13 OK2026-09-05
  • NOTE11 OK, 2 NOTE2026-06-09
  • ERROR11 OK, 1 NOTE, 1 ERROR2026-06-08
  • WARNING11 OK, 1 NOTE, 1 WARNING2026-06-07
  • NOTE12 OK, 2 NOTE2026-04-22
Show 4 earlier changesHide 4 earlier changes
  • ERROR11 OK, 2 NOTE, 1 ERROR2026-04-18
  • NOTE12 OK, 2 NOTE2026-04-10
  • ERROR12 OK, 1 NOTE, 1 ERROR2026-04-09
  • NOTE12 OK, 2 NOTE2026-03-10
Advisories

none known

Documentation

In release 0.1.6
READMEYes · 232 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 0.1.6Citation fileNoWebsitenot declared in DESCRIPTION
Help pages
2 (1 internal)includes a package overview page
Examples that run
100%1 run in a plain check
Exported functions with examples
100%
Documented parameters
100%
Return-value docs
100%
Help pages citing references
0%

Downloads

3.2K
CRAN downloads in the past year
Rank #9,174 · ~9/day · ~268/mo
Daily download trend is not available in this view yet.
40230 days
1.1K90 days
3.2K1 year
Compare downloads with other packages →
Also on391 r2u1 autocran

Repository

0Stars
1Forks
2Open issues
0Open PRs
5Releases
108Commits
2Commit identities
108 commits · Last activity 2026-08-31 · Default branch at 0.1.6.999, ahead of CRAN 0.1.6 (checked 2026-10-21)
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
7
Median days to close, 50 most recently updated closed PRs
0

Forks over time

2021-06-27 · 12026-07-07 · 1
PracticesBeta

6 development-tooling and community-health practices detected across 4 families in the upstream repository

Checks run against github.com/tommyjones/mvrsquared on 2026-10-21.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux

Coverage (1)
Coverage reporting (Codecov)
CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
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.

  • Claude Codefirst seen 2026-08-30
    Commits: at least 4 crediting it in the message
Models named in its commits
  • Claude Opus 54 commits · Aug 2026
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
13 external dependencies (excludes base and recommended)

Installing mvrsquared adds 3 packages (3 with compiled code, 3.1 MB of source tarballs). Heaviest: Rcpp 1.8 MB, RcppArmadillo 1.0 MB, RcppThread 308 KB.

Depends (1)
R >= 3.0.2
Imports (3)
MatrixmethodsRcpp
Enhances (0)
none
Reverse dependencies
1direct
0indirect
Imports 1
Depends, Imports or LinkingTo, most downloaded first

People & History

People (2)
Author, Maintainer since 0.0.3 (2020)
Contributor · added in 0.1.4
Releases (7)

Pick two releases to compare their code metrics.

  • 0.1.6Latest
    record
    2026-08-31 · current release · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • 0.1.5
    record
    2023-07-15 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 0.1.4
    record
    2022-06-01 · diff ↗
  • R
    R 4.2.0 released · 2022-04-22
  • 0.1.2
    record
    2021-09-20 · diff ↗
  • R
    R 4.1.0 released · 2021-05-18
  • 0.1.1
    record
    2020-10-21 · diff ↗
  • 0.1.0
    record
    2020-06-25 · diff ↗
  • R
    R 4.0.0 released · 2020-04-24
  • 0.0.3
    record
    2020-02-20
  • R
    R 3.6.0 released · 2019-04-26

Package metadata

First published
2020-02-20
Total releases
7 / 6 yrs
License
MIT + file LICENSE OSI
Minimum R
≥ 3.0.2
Download size
122 KB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("mvrsquared")
Jones, T., & Nagler, T. (2026). mvrsquared: Compute the Coefficient of Determination for Vector or Matrix Outcomes (Version 0.1.6) [Computer software]. https://doi.org/10.32614/CRAN.package.mvrsquared

This package has no citation file, so citation() returns this entry built from DESCRIPTION.

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 mvrsquared version 0.1.6 [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