Skip to content

Vaccination

mrbatist edited this page Mar 15, 2024 · 3 revisions

The VACCINATION_RATES functions

Vaccination is a virus- and experiment-specific process in the Scenarios Mechanistic Model. Typically, an AbstractParameters subclass will pass a parameter called VACCINATION_RATES to the runner. The value of this parameter is a Python function that takes an integer t as input, representing the number of days since the start of the experiment.

The vaccination function passed to the runner is responsible for returning a vaccine uptake matrix with dimensions (age groups x # shots). Each cell in the matrix represents the proportion of individuals in a specific age group and with a specific number of previous vaccinations who are being vaccinated at that time step. This information is used by the model's ordinary differential equations (ODEs) to update the movement of individuals within the susceptible compartment.

Similar to external infectious functions, VACCINATION_RATES functions must be continuously differentiable with respect to t and compatible with jax just-in-time compilation.

How the proportions are calculated and used by the ODEs is up to the disease specific use case. Below is the COVID19 model specific vaccination routine.

COVID19 Mechanistic Model Vaccination Uptake

Vaccination data is from the https://data.cdc.gov/Vaccinations/COVID-19-Vaccination-Age-and-Sex-Trends-in-the-Uni/5i5k-6cmh/data_preview, where the data is daily doses by age from national vaccine partners. To use this data, a continuous and differentiable function describing these vaccination trends is needed. In R, we use cubic spline fits with a new knot every week to create the function. Then we use the aspline R function to optimize the location of the knots in order to find the optimal minimum number of knots to simplify computation complexity.

Vaccination splines are read in and processed at initialization of the parameters class, when the ODE's call the function within VACCINATION_RATES the splines are evaluated at time step t.

It is important that the model runner's definition of the date that t=0 matches up to the fit of the splines. For example, the vaccination splines are fit to January 1st, 2021, while the runner wants to run dynamics starting from January 21st, 2021, the definition of t=0 does not line up. This is what the VAX_MODEL_DAYS_SHIFT configuration parameter is used for. The runner's t=0 is actually the vaccine functions 't=20, thus we set VAX_MODEL_DAYS_SHIFT = 20` to compensate for this difference. This workaround is specific to fitting splines to represent uptake and may not be used by other mechanistic models for different viruses.

When using splines, you must be wary of how long the splines are fit for, as querying outside of their range produces unexpected, usually infinite, results.

Lastly, vaccination only occurs on individuals not actively exposed or infected, this is enforced by the model ODE's themselves, who work with the output of the VACCINATION_RATES functions.