Epidemics.jl is a Julia package that aims to mirror the R package {epidemics}, and to provide a robust way to model epidemic and disease outbreak scenarios. Epidemics.jl is a work in progress since it lags the development of epidemics.
Note Epidemics.jl is a personal project where I aim to learn more about the Julia language; it comes with no guarantees of current or future support or maintenance.
Epidemics.jl currently has basic implementations of three models, roughly tracking the R package {epidemics}.
-
epidemic_default()
: the default model, which is an SEIRV compartmental ODE model allowing for a vaccination regime that confers full immunity with a single dose, as well as (optionally) multiple overlapping interventions to reduce social contacts; -
epidemic_vacamole()
: the Vacamole model developed by RIVM for the Covid-19 pandemic, which is a work in progress, but will eventually allow for two-dose leaky vaccination, as well as multiple overlapping interventions; -
epidemic_stochastic()
: A simple stochastic compartmental SIR model.
Epidemics.jl is likely to include the Ebola model, as well as features such as time-dependence and rate interventions, from {epidemics} at some point.
Epidemics.jl can be installed from GitHub using the Julia package manager Pkg.jl.
using Pkg
Pkg.add(url="[email protected]:pratikunterwegs/Epidemics.jl.git")
You can run a simple age-structured epidemic model using the function epidemic_default()
with its default arguments.
using Epidemics
# an epidemic of 500 days
time_end = 500.0
# the default model with 3 age groups in the default population
epidemic_default(β=1.3/7, σ=0.5, γ=1/7,
population = Population(),
time_end=time_end, increment=1.0)
You can run a simple stochastic epidemic model using the function epidemic_stochastic()
with its default arguments.
using Epidemics
# an epidemic of 500 days
time_end = 500.0
# the default model with 3 age groups in the default population
epidemic_stochastic(population_size = 1010,
n_infectious = 20, n_recovered = 30,
β = 9.9, σ = 1.01,
time_end = sim_time_end,
time_increment = 0.02)
Epidemics.jl is currently faster than epidemics. Automated benchmarking is in the pipeline can be found in the development documentation. A static example for the default ODE model is shown below.
BenchmarkTools.Trial: 706 samples with 1 evaluation.
Range (min … max): 6.431 ms … 16.426 ms ┊ GC (min … max): 0.00% … 58.82%
Time (median): 6.626 ms ┊ GC (median): 0.00%
Time (mean ± σ): 7.085 ms ± 1.976 ms ┊ GC (mean ± σ): 6.24% ± 12.32%
█▅
██▇▃▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▃▂ ▂
6.43 ms Histogram: frequency by time 15.8 ms <
Memory estimate: 8.32 MiB, allocs estimate: 119924.