Skip to content

pratikunterwegs/Epidemics.jl

Repository files navigation

Epidemics.jl

License:MIT Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Dev Build Status Coverage SciML Code Style

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}.

  1. 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;

  2. 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;

  3. 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.

Get started

Installation

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")

Running an ODE epidemic model

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)

Running a stochastic epidemic model

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)

Benchmarking

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.

Releases

No releases published

Packages

No packages published

Languages