To run forecasts on historical dates, execute the 'run_forecasts_for_cases.r' or 'run_forecasts_for_infections.r' script and all models will be run for a series of forecast dates. To score the forecasts use the 'score_forecasts()' function which relys on the 'summary_preds' output generated from 'fit_model()' and combined for multiple runs within 'historical_estimates.r'.
This repository contains code that uses data from the ONS Covid infection survey to generate infections and uses cases directly from the UK COVID Dashboard and combines with social contact data from the CoMix to make weekly age stratified infection and case incidence forecasts of SARS-COV-2.
The core model is based on the Next Generation Principle. An approximation of epidemic dynamics, which proposes that within a population of well-mixed sub-groups (e.g., age-groups), the incidence of infection in each age-group at time t is given by the incidence of infection in in each age-group the previous generation (t-g) multiplied by an interaction matrix known as the next generation matrix, N(t). We generalised the approach, integrating over the distribution of generation interval by taking the weighted sum of the product of the next generation matrix and the age-stratified vector of infections on dates between t-smax and t-1.
Under the social contact hypothesis, the next generation matrix is calculated by augmenting the contact matrix, C(t), by vectors of age-specific susceptibility (s) and infectiousness (i), where each element, sa and ia, give the specific susceptibility and infectiousness of age group a. Which we inform with data from CoMix.
The scripts compare this model to 3 other NGM:
- The same model with no contact data
- A model with no interaction between age-groups
- The same model but informed by contact data from a different historical contact survey conducted in 2008, POLYMOD
All models are fit in stan using the cmdstanr package.
The models are further compared to two nieve baselines
- With the prediction set as equal to the forecast date
- With the prediction set to be an exponential extrapolation of the previous two weeks
Also included is a script that scores and plots information about the performance of the forecasts the script focuses on the CRPS and Bias of the forecasts as calculated using the scoringutils package.
Historical forecasts: