Code Monkey home page Code Monkey logo

epidemic-simulations's Introduction

Epidemic Simulations

Live Demo

About

Epidemics can be modelled mathematically in order to make forecasts and, if necessary, take countermeasures in time. First and foremost is the mathematical model developed in 1927 by William Ogilvy Kermack & Anderson Gray McKendrick, which divides the population into three groups: susceptible (S), infected (I) and recovered (R) and also models the interactions between them. According to Robert J. Shiller, successful narratives run like epidemics and also possess characteristics of pathogens such as the risk of infection, incubation period or recovery rate. The simulations presented here can be used to model both narratives and biological epidemics.

Alt text

Algorithms

Susceptible - Infected (SI)

In this model, the simplest of those presented here, two groups are modelled - susceptible (S) and infected (I). Once infected, a person remains permanently infected, infectious and can infect other people, inevitably infecting the entire population. The infection rate β alone determines the speed of spread. I₀ is the percentage of the initial population which is infected.

Susceptible - Infected - Susceptible (SIS)

In this model, two groups are modelled - susceptible (S) and infected (I). Infected people have a rate of infection β to infect other susceptible people. β models both the chance of contact between people and the chance of successful transmission. Infected persons can recover with a recovery rate γ and rejoin the group of infected persons. After a certain period of time, a balance between infected and susceptible persons is always established. β (together with γ) determines this balance, as well as the speed at which it is achieved. I₀ is the percentage of the initial population which is infected.

Susceptible - Infected - Susceptible (SIR)

Infected people have an infection rate β to infect other susceptible people. β models both the chance of contact between people and the chance of successful transmission. Infected persons can recover with a recovery rate γ and belong to the group of recovering persons. The recovery rate can represent both the mortality rate and the recovery rate, since in this model, the recovering individuals are only characterized by the absence of infectivity after infection, and this can be assumed from both dead and immune individuals. μ models here the normal population dynamics and describes how many people die (not related to the disease) and are born, thus, the dynamic behaviour of an epidemic can be represented in the model. I₀ is the percentage of the initial population which is infected.

Suspectible - Infected - Recovered - Deceased (SIRD)

In this model, an extension of the SIR model, three groups are modelled - susceptible (S) infected (I), recovered (R) and deceased (D). Susceptible persons have a rate of infection β of infected persons to be infected. Infected persons have a rate of infection β to infect other susceptible persons and can die with a mortality rate of μ. β models both the chance of contact between people and the chance of successful transmission. Infected persons can recover with a recovery rate of γ and belong to the group of recovering persons. Since already in the SIR model the recovered (R) can represent dead as well as living immune persons, this extension effectively adds nothing to the SIR model except for the information about deceased I₀ is the initial percentage of the initial population infected.

Susceptible - Exposed - Infected - Susceptible (SEIS)

Three groups are modelled in this model - susceptible (S), exposed (E) and infected (I). Compared to the SEIR model, individuals cannot become immune and are potentially reinfectable after successful recovery. Susceptible persons have a rate of infection β of being infected by infected persons and belonging prematurely to the exposed group. Exposed persons are not yet infectious, cannot be re-infected and belong to the group of infected persons with an incubation rate a after some time. Infected persons have an infection rate β to infect other susceptible persons. β models both the chance of contact between people and the chance of successful transmission. Infected persons can recover with a recovery rate γ and again belong to the group of susceptible persons. μ models here the normal population dynamics and describes how many people die (not related to the disease) and are born, thus, the dynamic behaviour of an epidemic can be represented in the model. I₀ is the initial percentage of the initial population infected.

Susceptible - Exposed - Infected - Recovered (SEIR)

In this model the SIR model is extended to include Exposed (E), and four groups are modelled - Susceptible (S), Exposed (E), Infected (I) and Recovered (R). Susceptible people have a rate of infection β of being infected by infected people and to prematurely belong to the group of exposed people. Exposed persons are not yet infectious, cannot be reinfected, and with an incubation rate a, belong to the group of infected persons after some time. Infected persons have an infection rate β to infect other susceptible persons. β models both the chance of contact between people and the chance of successful transmission. Infected persons can recover with a recovery rate γ and belong to the group of recovering persons. The recovery rate can represent both the mortality rate and the recovery rate, since in this model, the recovering individuals are characterized by the absence of infectivity after infection, and this can be assumed from both dead and immune individuals. μ models here the normal population dynamics and describes how many people die (not related to the disease) and are born, thus, the dynamic behaviour of an epidemic can be represented in the model. I₀ is the initial percentage of the initial population infected.

Maternally Immunity - Susceptible - Infected - Recovered (MSIR)

In this model, an extension of the SIR model, four groups are modeled: maternal immune (M), susceptible (S) infected (I) and recovered (R). For some pathogens, such as measles, newborns with a certain chance cannot become infected because they receive maternal antibodies from the mother and thus temporarily develop a passive immunity. μ models here the normal population dynamics and describes how many people die (not related to the disease) and are born, thus, the dynamic behaviour of an epidemic can be represented in the model. Newborns M have a chance δ not to develop passive immunity or lose it and thus belong to the susceptible group S. Susceptible have an infection rate β of being infected by infected persons. Infected people have a rate of infection β to infect other susceptible people. β models both the chance of contact between people and the chance of successful transmission. Infected persons can recover with a recovery rate γ and belong to the group of recovering persons. The recovery rate can represent both the mortality rate and the recovery rate, since in this model, the recovering individuals are characterized by the absence of infectivity after infection, and this can be assumed from both dead and immune individuals. I₀ is the initial percentage of the initial population infected.

Maternally Immunity - Susceptible - Exposed - Infected - Recovered (MSEIR)

In this model, an extension of the MSIR model, five groups are modeled: maternal immune (M), Exposed (E), susceptible (S) infected (I) and recovered (R). For some pathogens, such as measles, newborns with a certain chance cannot become infected because they receive maternal antibodies from the mother and thus temporarily develop a passive immunity. μ models here the normal population dynamics and describes how many people die (not related to the disease) and are born, thus, the dynamic behaviour of an epidemic can be represented in the model. Newborns M have a chance δ not to develop passive immunity or lose it and thus belong to the susceptible group S. Susceptible people have a rate of infection β of being infected by infected people and to prematurely belong to the group of exposed people. Exposed persons are not yet infectious, cannot be reinfected, and with an incubation rate a, belong to the group of infected persons after some time. Infected people have a rate of infection β to infect other susceptible people. β models both the chance of contact between people and the chance of successful transmission. Infected persons can recover with a recovery rate γ and belong to the group of recovering persons. The recovery rate can represent both the mortality rate and the recovery rate, since in this model, the recovering individuals are characterized by the absence of infectivity after infection, and this can be assumed from both dead and immune individuals. I₀ is the initial percentage of the initial population infected.

Technical

Vue.js with Vuetify was used as the framework. For the display of the graphs, Chartkick.js was combined with Chart.js. For the mathematical integration the fourth order Runge-Kutta algorithm ode-rk4 was chosen.

epidemic-simulations's People

Contributors

dependabot[bot] avatar kevger avatar

Stargazers

 avatar

Watchers

 avatar

epidemic-simulations's Issues

SEIR model ode equation mistake

In /src/components/SimulationSEIR.vue line 130
dydt[3] = this.r * y[2] - this.m * y[3];
should be
dydt[3] = this.y * y[2] - this.m * y[3];
Or the recovered line won't show on the line chart.

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.