This package contains the code to implement a bayesian modelling framework of epidemic transmission that encompasses five distinct models. The package also contains the code to implement multi-model comparison between the candidate models using a method of importance sampling to estimate the model evidence of each model.
You can install the package from GitHub using:
install.packages("devtools")
devtools::install_github("hanmacrad2/SuperSpreadingEpidemicsMCMC")
The transmission dynamics of an epidemic are rarely homogeneous. Super-spreading events (SSEs) and super-spreading individuals (SSIs) are two examples of heterogeneous transmissibility. Inference of super-spreading is commonly carried out on secondary case data, the distribution of which is known as the offspring distribution
This package contains the code to implement a modelling framework encompassing five models and multi-model comparison that aims to account for a range of different spreading dynamics. Each of the models are discrete-time, stochastic, branching-process models that aim to model the spreading of an epidemic through a susceptible population. The five-model framework encompasses a baseline model with regular-spreading, a model with individual reproduction number (SSI), a bimodal super-spreading events (SSEB) model, a bimodal super-spreading individuals (SSIB) model and a negative binomial model with over-dispersion to account for super-spreading (SSE). The basic reproductive rate (R0) is a key measure in estimating the ability of a new pathogen to spread, and is a parameter in each of the models. A Bayesian approach is used to infer model parameters by means of Markov chain Monte Carlo (MCMC). The framework is adaptive and generalizable to a wide range of diseases and is applied to both simulated data and real data (Covid-19, SARS outbreak (2003)). Model comparison is carried out between the models to determine which model best fits a particular dataset.
The package also contains other util functions such as plotting functions to plot the mcmc samples and results
The code below provides an example of how to simulate incidence time series data from each of the five epidemic transmission models and visualize the resulting time series. Subsequently, the model parameters can be inferred as fit to the data using the adaptive MCMC algorithms implemented in the functions listed below.
library(SuperSpreadingEpidemicsMCMC)
#Simulate data from each model
data_baseline <- SIMULATE_EPI_BASELINE(r0 = 2.0)
data_sse <- SIMULATE_EPI_SSE(r0 = 2.0, k = 0.2)
data_ssi <- SIMULATE_EPI_SSI(r0 = 2.0, k = 0.2)
data_sseb <- SIMULATE_EPI_SSEB(r0 = 2.0, alpha = 0.5, beta = 10)
data_ssib <- SIMULATE_EPI_SSIB(r0 = 2.0, a = 0.5, b = 10)
#Visualise the time series incidence datasets
plot.ts(data_baseline)
plot.ts(data_sse)
plot.ts(data_ssi)
plot.ts(data_sseb)
plot.ts(data_ssib)
#Infer the parameters using MCMC
mcmc_baseline <- MCMC_INFER_BASELINE(data_baseline)
mcmc_sse <- MCMC_INFER_SSE(data_sse)
mcmc_ssi <- MCMC_INFER_SSI(data_ssi)
mcmc_sseb <- MCMC_INFER_SSEB(data_sseb)
mcmc_ssib <- MCMC_INFER_SSIB(data_ssib)