When analysing an epidemic-prone infection, such as pandemic influenza, it is important to understand how many infections there could be in total. The overall number of infections that occur during such an epidemic, is called the ‘final epidemic size’. The expected final size of an epidemic can be calculated using methods detailed in Andreasen (2011), Miller (2012), Kucharski et al. (2014), and Bidari et al. (2016), and which are implemented in the finalsize package.
An epidemic is underway. We want to know how many individuals we would expect to be infected in total for a given level of transmission and population susceptibility: this is the cumulative sum of all infections, or the final size of the epidemic.
# load finalsize
library(finalsize)
A number of statistical methods can be used to estimate the \(R_0\) of an epidemic in its early stages from available data. These are not discussed here, but some examples are given in the episoap package.
Instead, this example considers a infection with an \(R_0\) of 1.5, similar to that which could potentially be observed for pandemic influenza.
# define r0 as 1.5
<- 1.5 r0
Population estimates at the country scale are relatively easy to get from trusted data aggregators such as Our World in Data. More detailed breakdowns of population estimates at the sub-national scale may be available from their respective national governments. Here, we use an estimate for the U.K. population size of about 67 million.
# get UK population size
<- 67 * 1e6 uk_pop
This initial example assumes uniform mixing, i.e., that all individuals in the population have a similar number of social contacts. This can be modelled in the form of a single-element contact matrix, which must be divided by the population size.
# prepare contact matrix
<- matrix(1.0) / uk_pop contact_matrix
Social contacts are well known to be non-uniform, with age being a strong influence on how many contacts a person has and, moreover, on the ages of their contacts. A relatively simple example is that of children of school-going age, who typically have more social contacts than the elderly, and most of whose social contacts are with other schoolchildren.
The “Modelling heterogeneous contacts” vignette explores how this can be incorporated into final epidemic size calculations using finalsize.
In this initial example, the population is assumed to be fully susceptible to infection. This is modelled in the form of a matrix with a single element, called susceptibility
.
# all individuals are fully susceptible
<- matrix(1.0) susceptibility
Since all individuals are fully susceptible, the break-up of the population into susceptibility groups can be represented as another single-element matrix, called p_susceptibility
.
# all individuals are in the single, high-susceptibility group
<- matrix(1.0) p_susceptibility
Susceptibility to infection is well known to vary due to a number of factors, including age, prior exposure to the pathogen, or immunisation due to a vaccination campaign.
The “Modelling heterogeneous susceptibility” vignette explores how variation in susceptibility within and between demographic groups can be incorporated into final epidemic size calculations using finalsize.
final_size
The final size of the epidemic in the population can then be calculated using the only function in the package, final_size()
. This example allows the function to fall back on the default options for the arguments solver
("iterative"
) and control
(an empty list).
# calculate final size
<- final_size(
final_size_data r0 = r0,
contact_matrix = contact_matrix,
demography_vector = uk_pop,
susceptibility = susceptibility,
p_susceptibility = p_susceptibility
)
# view the output data frame
final_size_data#> demo_grp susc_grp susceptibility p_infected
#> 1 demo_grp_1 susc_grp_1 1 0.5828132
This is the final epidemic size without accounting for heterogeneity in social contacts by age or other factors, and without accounting for variation in susceptibility to infection between or within demographic groups.
This value, of about 58% of the population infected, is easily converted to a count, and suggests that about 39 million people would be infected over the course of this epidemic.