Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck, ggdist=?ignore-before-r=4.1.0
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Added support for scoring multivariate forecasts (#288, big thank you to Sam Abbott and Sebastian Funk). You can find detailed information in the Vignette "Scoring multivariate forecasts". There is a new forecast type, `forecast_multivariate_sample()` and a corresponding `as_forecast_multivariate_sample()` function. To score a multivariate forecast, users are expected to provide a `joint_across` argument which specifies the variables which are forecast jointly.
- Fixed a small bug with `bias_sample()` when continuous predictions were equal to observations. These ties could lead to incorrect bias scores. New calculations now use mid-ranks to deal with ties.
- Removed workaround for `{distributional}` native pipe issue which has now been fixed upstream (#947).

# scoringutils 2.1.2

Expand Down
12 changes: 6 additions & 6 deletions vignettes/Deprecated-visualisations.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ The example data used is the data shipped with the `scoringutils` package. It co
library(scoringutils)
library(data.table)
library(ggplot2)
library(ggdist)
library(magrittr)
library(magrittr) #pipe operator
```
Expand All @@ -34,7 +35,7 @@ library(magrittr) #pipe operator

In previous versions of `scoringutils`, forecasts and observed values could be visualised using the function `plot_predictions()` and its `make_na()` helper function. The following shows the function code first and then an example.

```{r eval=require("ggdist", quietly = TRUE)}
```{r}
#" @title Plot Predictions vs True Values
#"
#" @description
Expand Down Expand Up @@ -98,7 +99,6 @@ In previous versions of `scoringutils`, forecasts and observed values could be v
#" aes(fill = model, color = model)


library(ggdist)
plot_predictions <- function(data,
by = NULL,
x = "date",
Expand Down Expand Up @@ -278,7 +278,7 @@ In the following are a few examples of using the two functions to create a plot

Visualising the median forecasts for the example data. The truth data is restricted to a period between 2021-05-01 and 2021-07-22. The forecast data is a forecast from the model "EuroCOVIDhub-ensemble" made on the "2021-06-07". All other data is set to `NA`, effectively removing it from the plot.

```{r eval=require("ggdist", quietly = TRUE)}
```{r}
median_forecasts <- example_quantile[quantile_level == 0.5]
median_forecasts %>%
make_NA(what = "truth",
Expand All @@ -296,7 +296,7 @@ median_forecasts %>%

This is the same plot, but with a variety of prediction intervals shown, instead of just the median.

```{r eval=require("ggdist", quiet = TRUE)}
```{r}
example_quantile %>%
make_NA(what = "truth",
target_end_date <= "2021-05-01",
Expand All @@ -314,7 +314,7 @@ example_quantile %>%

And a similar plot, this time based on continuous forecasts. The predictions are automatically converted to a quantile-based forecasts for plotting.

```{r eval=require("ggdist", quietly = TRUE)}
```{r}
example_sample_continuous %>%
make_NA(what = "truth",
target_end_date <= "2021-05-01",
Expand All @@ -332,7 +332,7 @@ example_sample_continuous %>%

Displaying two forecasts at a time with additional colours:

```{r eval=require("ggdist", quietly = TRUE)}
```{r}
example_quantile %>%
make_NA(what = "truth",
target_end_date > "2021-07-15",
Expand Down