Git Product home page Git Product logo

epidemics.jl's Introduction

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.

epidemics.jl's People

Contributors

pratikunterwegs avatar

Stargazers

Sam Abbott avatar James Azam avatar Toshiaki Asakura avatar Ceco Maples avatar

Watchers

 avatar

epidemics.jl's Issues

Main function should mirror epidemics::epidemic()

This PR is to request that the main function, epidemic(), should mirror the R function epidemics::epidemic(), and allow passing arguments as ... or the Julia equivalent. These should then be checked and prepared by the appropriate functions, chosen based on the model chosen in epidemic(model = ...), before being passed to a function specified by model = ....

Implement final size calculation

This PR is to request the implementation of a final size calculation function from the output of an epidemic model, i.e., the data frame resulting from a call to epidemic(). This function should allow lumping or splitting by demographic group.

Retire epidemic() function

This issue is to request that the epidemic() function should be retired in favour of separate model functions, such as epidemic_default().

Implement SEIR-V model

This PR is to request that the default model in Epidemics.jl be updated to include an optional vaccination regime to mirror the default model in {epidemics}.

Separate default model from epidemic()

This issue is to request that the default model be renamed to epidemic_default() and separated out from the overall epidemic() function, with standalone input checking suitable for this model.

Add vaccination regime class

This PR is to request a vaccination regime type Vaccination that mirrors epidemics::vaccination() from {epidemics}.

Argument checking for the default model

This PR is to request a function that checks the arguments to epidemic() for compatibility with the default model, seir!. This should include checking that there are only single pathogen parameters, even though pathogens can be initialised with multiple parameters.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.