Skip to content

1046: Add multivariate forecasts section to scoring rules vignette - #1250

Draft
nikosbosse wants to merge 4 commits into
mainfrom
issue-1046-multivariate-in-scoring-rules
Draft

nikosbosse wants to merge 4 commits into
mainfrom
issue-1046-multivariate-in-scoring-rules

Conversation

@nikosbosse

@nikosbosse nikosbosse commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

CLAUDE:

Description

This PR closes #1046.

The "Scoring rules" vignette now has a short Multivariate forecasts section, as asked for in the issue ("give a nod to multivariate forecasts"). The section:

  • explains what a multivariate forecast is (joint forecasts across locations, age groups or forecast horizons) and why scoring components separately ignores their dependence;
  • names the constructors (as_forecast_multivariate_sample(), as_forecast_multivariate_point()) and explains that joint_across names the column(s) across which forecasts are pooled into a single multivariate forecast; states the default metrics (pointing to get_metrics(example_multivariate_sample)), notes that quantile-based forecasts cannot be scored with these multivariate scores, and links to vignette("scoring-multivariate-forecasts");
  • adds Energy score and Variogram score subsections in the vignette's existing Observation / Forecast / formula style. These cover the definitions, the defaults (p = 0.5, all weights equal to one), how point forecasts are handled, the underlying scoringRules functions, and the main strengths and weaknesses of each score. The energy score is strictly proper (relative to distributions with finite first moment) but discriminates poorly on dependence structure. The variogram score is proper but not strictly proper, because it is insensitive to a common shift.

Two bib entries are added to vignettes/scoring-rules/scoringutils-package.bib: Gneiting, Stanberry, Grimit, Held & Johnson (2008), TEST 17(2):211-235, doi:10.1007/s11749-008-0114-x, and Scheuerer & Hamill (2015), Monthly Weather Review 143(4):1321-1334, doi:10.1175/MWR-D-14-00269.1. Both were checked against their DOIs and against the @references already in R/metrics-multivariate-sample.R. Capitalised words in the titles are brace-protected in the same style as the existing Zotero exports. Gneiting & Raftery (2007) is also cited, and that entry was already in the bib.

I checked the factual claims against the code. get_metrics() returns energy_score and variogram_score for multivariate sample forecasts and only variogram_score for multivariate point forecasts. The defaults p = 0.5 and w_vs = NULL (all weights equal to one in scoringRules::vs_sample()) match R/metrics-multivariate-sample.R and R/metrics-multivariate-point.R. I re-rendered the vignette with devtools::load_all() + rmarkdown::render(), and all citations resolve (no ???).

Implementation: two independent drafts were compared by a judge agent; draft A was chosen as base. A few wording improvements from draft B were grafted in.

Review

An independent adversarial agent reviewed the PR (verdict: approve). Changes made in response:

  • PR description: removed the caveat that the bib entries were unchecked; they were verified against the DOIs and the roxygen @references.
  • Bib: brace-protected capitals in the titles and the TEST journal name, matching the Zotero-export style of the other entries (so sentence-case CSL styles would not lowercase them).
  • Merged the duplicated default-metrics sentences into one with a parenthetical get_metrics(example_multivariate_sample).
  • Reworded joint_across to say it names the column(s) across which forecasts are pooled.
  • Added one sentence that quantile-based forecasts do not encode dependence between targets and cannot be scored with the multivariate scores.
  • Qualified "strictly proper" for the energy score with "relative to distributions with finite first moment".

Rebutted: nothing. The optional suggestion to re-export the entries from Zotero (adding abstract/file fields) was not done; the brace protection covers the formatting concern, and the extra Zotero fields are not used in rendering.

Checklist

  • My PR is based on a package issue and I have explicitly linked it.
  • I have included the target issue or issues in the PR title as follows: issue-number: PR title
  • I have tested my changes locally. (Vignette re-rendered and citations confirmed to resolve. Full devtools::test() passes with 0 failures.)
  • I have added or updated unit tests where necessary. N/A: docs-only change (vignette, bib, NEWS). No behaviour changes, so there is no test that could fail before and pass after.
  • I have updated the documentation if required.
  • I have built the package locally and run rebuilt docs using roxygen2. N/A: no roxygen comments or R code changed. The vignette was rendered locally.
  • My code follows the established coding standards and I have run lintr::lint_package() to check for style issues introduced by my changes. N/A: no R files changed.
  • I have added a news item linked to this PR.
  • I have reviewed CI checks for this PR and addressed them as far as I am able. CI pending.

🤖 Generated with Claude Code

nikosbosse and others added 4 commits November 8, 2026 13:09
Describe the energy score and the variogram score (including its use
for multivariate point forecasts), with formulas, references and a
pointer to the multivariate scoring vignette.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Clarify why the variogram score detects misspecified correlations, state
that it is proper but not strictly proper, describe the default weights
precisely, mention forecast horizons as an example, point to
get_metrics(example_multivariate_sample), and cite Gneiting & Raftery
(2007) for the energy score.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge the duplicated default-metrics sentence, reword the description of
joint_across, note that quantile forecasts cannot be scored with the
multivariate scores, qualify strict propriety of the energy score, and
brace-protect capitals in the new bib entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.18%. Comparing base (8b18f07) to head (7b3442f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1250   +/-   ##
=======================================
  Coverage   99.18%   99.18%           
=======================================
  Files          41       41           
  Lines        2333     2333           
=======================================
  Hits         2314     2314           
  Misses         19       19           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

multivariate scoring in scoring rules vignette

1 participant