finalsize is an R package to calculate the final size of a SIR epidemic in populations with heterogeneity in social contacts and infection susceptibility.
finalsize provides estimates for the total proportion of a population infected over the course of an epidemic, and can account for a demographic distribution (such as age groups) and demography-specific contact patterns, as well as for heterogeneous susceptibility to infection between groups (such as due to age-group specific immune responses) and within groups (such as due to immunisation programs). An advantage of this approach is that it requires fewer parameters to be defined compared to a model that simulates the full transmission dynamics over time, such as models in the epidemics package.
finalsize implements methods outlined in Andreasen (2011), Miller (2012), Kucharski et al. (2014), and Bidari et al. (2016).
finalsize can help provide rough estimates of the effectiveness of pharmaceutical interventions in the form of immunisation programmes, or the effect of naturally acquired immunity through previous infection (see the vignette).
finalsize relies on Eigen via RcppEigen for fast matrix algebra, and is developed at the Centre for the Mathematical Modelling of Infectious Diseases at the London School of Hygiene and Tropical Medicine as part of the Epiverse-TRACE.
Installation
The package can be installed from CRAN using
install.packages("finalsize")Development version
The current development version of finalsize can be installed from
Github using the
remotes package. The development version documentation can be found
here.
if(!require("pak")) install.packages("pak") pak::pak("epiverse-trace/finalsize")
Quick start
The main function in finalsize is final_size(), which calculates the
final size of an epidemic given the