A model of the COVID-19 pandemic stratified by SA2.
Basic usage:
S <- simulate_sa2(days_to_simulate = 5)The default return value is a list of three components:
integer(days_to_simulate)The number of people infected on each day simulated- A
data.tableof 21,364,885 rows, one for each individual modelled, with columnsV1, ... Vdwhere d =days_to_simulateand each column is the status of each individual on each day simulated. - A vector of test results.
(Other return types are available via returner but these are subject to change.)
To model different epidemiological assumptions -- such as the the duration
of the incubation period, how likely transmission is in certain places, and
the severity of cases -- supply a list of parameters to EpiPars.
The function set_epipars() returns a list of the required parameters with
reasonable defaults.
S <- simulate_sa2(EpiPars = set_epipars())
# Assume longer average incubation, 8 days
S_long_incubation <-
simulate_sa2(EpiPars = set_epipars(incubation_mean = 8))
# Assume everyone in the household gets infected the following day
# if any member does
S_high_household_transmission <-
simulate_sa2(EpiPars = set_epipars(q_household = 1))
# Assume no-one is naturally resistant
S_no_natural_resist <-
simulate_sa2(EpiPars = set_epipars(resistance_threshold = 1000))Like EpiPars use set_policypars to supply a list of PolicyPars, to
change the assumptions about policies that restrict interaction.
# Open all schools
S_schools <-
simulate_sa2(PolicyPars = set_policypars(schools_open = TRUE))
## Isolate everyone over 65
S_ages_lockdown <-
simulate_sa2(PolicyPars = set_policypars(age_based_lockdown = 65:100))Two arguments are available to improve the performance of the model, as well as corresponding options.
nThreadthe number of threads to use during the modellinguse_dataEnvcan be set toTRUEto avoid boilerplate reading in and preparation of the base data.
- Install
R 4.0.0: https://cran.r-project.org/bin/macosx/ - Enable OpenMP by installing
rtools: https://github.com/rmacoslib/r-macos-rtools/releases/tag/v3.2.2