Skip to content

Commit

Permalink
Merge branch 'main' into add-content-to-multiple-models-session
Browse files Browse the repository at this point in the history
  • Loading branch information
seabbs authored Nov 4, 2024
2 parents da417e3 + 79f627f commit d8c30c6
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 16 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
extra-repositories: 'https://stan-dev.r-universe.dev'
extra-repositories:
https://stan-dev.r-universe.dev,
https://epiforecasts.r-universe.dev

- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/render-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
extra-repositories: 'https://stan-dev.r-universe.dev'
extra-repositories:
https://stan-dev.r-universe.dev,
https://epiforecasts.r-universe.dev

- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@v2
Expand Down
21 changes: 14 additions & 7 deletions sessions.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,31 @@ comments: false

## Session 2: Forecast evaluation

14:10-15:20
14:10-15:00

- An overview of forecasting models (10 mins)
- Practice session: Evaluating forecasts from a range of models (60 mins)
- An introduction to forecast evaluation (5 mins)
- Practice session: Evaluating forecasts from a range of models (40 mins)
- Wrap up (5 mins)

15:30-15:50
## Session 3: Evaluating forecasts from multiple models

- Wrap up and discussion (20 mins)
15:10-15:50

## Session 3: Forecast ensembles
- Why might we want to evaluate forecasts from multiple models? (5 mins)
- Practice session: Evaluating forecasts from multiple models (40 mins)
- Wrap up (5 mins)

*There is a coffee break at 15:30-15:40 you are welcome to attend this or keep working through the course material.*

## Session 4: Forecast ensembles

15:50-17:10

- Introduction to forecast ensembles (10 mins)
- Practice session: Creating forecast ensembles (60 mins)
- Wrap up (10 mins)

## Session 4: End of course summary
## Session 5: End of course summary

17:10-17:30

Expand Down
6 changes: 3 additions & 3 deletions sessions/forecast-ensembles.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ order: 8

# Introduction

As we saw in the [forecast evaluation session](forecast-evaluation-of-multiple-models), different modelling approaches have different strength and weaknesses, and it is not clear a prior which one produces the best forecast in any given situation.
As we saw in the [forecast evaluation session](forecast-evaluation-of-multiple-models), different modelling approaches have different strength and weaknesses, and it is not clear a priori which one produces the best forecast in any given situation.
One way to attempt to draw strength from a diversity of approaches is the creation of so-called *forecast ensembles* from the forecasts produced by different models.

In this session, we'll build ensembles using forecasts from models of different levels of mechanism vs. statistical complexity.
Expand All @@ -30,15 +30,15 @@ The source file of this session is located at `sessions/forecast-ensembles.qmd`.
## Libraries used

In this session we will use the `nfidd` package to load a data set of infection times and access stan models and helper functions, the `dplyr` and `tidyr` packages for data wrangling, `ggplot2` library for plotting, the `tidybayes` package for extracting results of the inference and the `scoringutils` package for evaluating forecasts.
We will also use `qra` for quantile regression averaging in the weighted ensemble section.
We will also use `qrensemble` for quantile regression averaging in the weighted ensemble section.

```{r libraries, message = FALSE}
library("nfidd")
library("dplyr")
library("tidyr")
library("ggplot2")
library("scoringutils")
library("qra")
library("qrensemble")
```

::: {.callout-tip}
Expand Down
8 changes: 4 additions & 4 deletions sessions/forecast-evaluation-of-multiple-models.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ We can classify models along a spectrum by how much they include an understandin
These different approaches all have different strength and weaknesses, and it is not clear a prior which one produces the best forecast in any given situation.
One way to attempt to draw strength from a diversity of approaches is the creation of so-called *forecast ensembles* from the forecasts produced by different models.

In this session, we'll start with forecasts from models of different levels of mechanism vs. statistical complexity and build ensembles of these models.
In this session, we'll start with forecasts from models of different levels of mechanism vs. statistical complexity and build ensembles of these models.
We will then compare the performance of these ensembles to the individual models and to each other.

## Slides
Expand Down Expand Up @@ -48,7 +48,7 @@ The best way to interact with the material is via the [Visual Editor](https://do

## Initialisation

We set a random seed for reproducibility.
We set a random seed for reproducibility.
Setting this ensures that you should get exactly the same results on your computer as we do.

```{r}
Expand Down Expand Up @@ -117,7 +117,7 @@ ggplot(data, aes(x = t, y = Rt)) +
```
:::

The key assumptions we are making here are:
The key assumptions we are making here are:

- The population is constant and we roughly know the size of the population.
- The reproduction number only changes due to susceptible depletion
Expand All @@ -137,7 +137,7 @@ A statistical term that can be used to describe a time series with a trend is sa
More specifically, a _stationary_ time series is defined as one whose statistical properties, such as mean and variance, do not change over time.
In infectious disease epidemiology, this would only be expected for endemic diseases without external seasonal influence.

The random walk model we used in the [forecasting visualisation session](forecast-visualisation) is a special case of a more general class of models called _autoregressive (AR) models_.
The random walk model we used in the [forecasting visualisation session](forecast-visualisation) is a special case of a more general class of models called _autoregressive (AR) models_.
AR models are a class of models which predict the next value in a time series as a linear combination of the previous values in the time series.
The random walk model is specifically a special case of an AR(1) model where the next value in the time series is predicted as the previous value, multiplied by a value between 1 and -1 , plus some noise. This becomes a random walk when the multipled value is 0.

Expand Down

0 comments on commit d8c30c6

Please sign in to comment.