Add conversion methods between multivariate and univariate forecast types
Maintainers usually reply within 1 day
@seabbs is already working on this.
Since Mar 9, 2026.
Assessment
This issue has not been assessed yet.
Description
Summary
There are no dedicated conversion methods between multivariate and univariate forecast types. Some conversions already work via default methods, but others need new methods.
What already works
Promoting univariate to multivariate works via the .default constructors:
as_forecast_multivariate_sample(forecast_sample_obj, joint_across = "location")works because the.defaultmethod callsas_forecast_generic()which strips/rebuilds the object, thenensure_mv_grouping()adds.mv_group_id.as_forecast_multivariate_point(forecast_point_obj, joint_across = "location")works the same way.
Existing univariate conversions for reference:
as_forecast_quantile.forecast_sampleconverts samples to quantilesas_forecast_point.forecast_quantileextracts the median as a point forecast
No new methods needed for the promotion cases.
What needs new methods
as_forecast_multivariate_point.forecast_multivariate_sample
Summarise samples to multivariate point predictions (e.g. via mean or median per forecast unit). Should follow the as_forecast_point.forecast_quantile pattern:
- Assert input is valid multivariate sample
- Aggregate
predictedvalues per forecast unit (configurable summary function, defaultmean) - Remove
sample_idcolumn - Preserve
.mv_group_idand grouping structure - Return
forecast_multivariate_pointobject
as_forecast_point.forecast_multivariate_sample
Same as above but also drops the multivariate grouping:
- Aggregate
predictedvalues per forecast unit - Remove
sample_idand.mv_group_idcolumns - Return
forecast_pointobject
Could be implemented as: convert to multivariate point first, then drop grouping. Or directly in one step.
as_forecast_point.forecast_multivariate_point
Downgrade by stripping multivariate grouping:
- Remove
.mv_group_idcolumn - Return
forecast_pointobject
as_forecast_quantile.forecast_multivariate_sample
Analogous to the existing as_forecast_quantile.forecast_sample but drops the multivariate grouping. Could delegate to the existing sample-to-quantile method after stripping .mv_group_id.
References
- #1114 (variogram score for multivariate sample)
- #1115 (multivariate point class)
as_forecast_point.forecast_quantileinR/class-forecast-quantile.Rfor the conversion patternas_forecast_quantile.forecast_sampleinR/class-forecast-sample.Rfor the sample-to-quantile pattern
This was opened by a bot. Please ping @seabbs for any questions.
- Dominant language
- R
- Stars
- 67
- Forks
- 24
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 2
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from epiforecasts/scoringutils
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
epiforecasts/scoringutils#1264 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
epiforecasts/scoringutils#1265 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
epiforecasts/scoringutils#1260 ·
Maintainers usually reply within 1 day
-
Incorrect guidance in `NEWS.md` re `add_relative_skill()`?Possibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1226 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
-
get_pit_histogram(): unsorted breaks produce negative densities; num_bins = 1 returns an empty tablePossibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1219 ·
Maintainers usually reply within 1 day
All issues in epiforecasts/scoringutils
Similar issues
-
data_bio2rarify - doc - dimensions wrongPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
leppott/BioMonTools#162 ·
-
publications
Difficulty 1/5 Under an hour Newbie friendliness 85/100
epiforecasts/epiforecasts.github.io#161 ·
Maintainers usually reply within 1 day
-
Label `{sas}` chunk source as `sas` instead of `txt`, so it gets syntax highlightingPossibly taken @michaelmayer2 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microbiome/OMA#1031 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ThinkR-open/golem#1265 ·