Compute the set of forecasts present for all values of a given column.
Source:R/filter_to_shared_forecasts.R
get_shared_forecasts.Rd
Compute the set of forecasts present for all values of a given column.
Arguments
- tbl
Table of forecasts or scores to filter, as a valid input to
scoringutils::get_forecast_unit()
.- comparator_values
Character vector of comparator values for which to compute shared forecasts. If
NULL
(default), use all unique values of the column specified incompare
.- compare
Name of the column containing the comparator values. Default
"model"
.
Value
Table of forecast unit values for all and only the shared
forecasts, which can be joined to the original table for filtering
purposes (see filter_to_shared_forecasts()
).
Examples
get_shared_forecasts(scoringutils::example_quantile,
c("EuroCOVIDhub-ensemble", "UMass-MechBayes"))
#> # A tibble: 128 × 6
#> location target_end_date target_type location_name forecast_date horizon
#> <chr> <date> <chr> <chr> <date> <dbl>
#> 1 DE 2021-05-08 Deaths Germany 2021-05-03 1
#> 2 DE 2021-05-15 Deaths Germany 2021-05-03 2
#> 3 DE 2021-05-15 Deaths Germany 2021-05-10 1
#> 4 DE 2021-05-22 Deaths Germany 2021-05-03 3
#> 5 DE 2021-05-22 Deaths Germany 2021-05-10 2
#> 6 DE 2021-05-22 Deaths Germany 2021-05-17 1
#> 7 DE 2021-05-29 Deaths Germany 2021-05-10 3
#> 8 DE 2021-05-29 Deaths Germany 2021-05-17 2
#> 9 DE 2021-05-29 Deaths Germany 2021-05-24 1
#> 10 DE 2021-06-05 Deaths Germany 2021-05-17 3
#> # ℹ 118 more rows