Skip to content

tomatitito/sir-model

Repository files navigation

An implementation of the SIR-Model using probabilistic programming

This project implements the SIR-Model, widely used in epidemiology, in the probabilistic programming language Anglican.

I developed this model as part of my dissertion Modelling and Simulation of Systemic Risk using Probabilistic Programming on the basis of an integrative Framework.

The SIR-Model is usually implemented as a system of differential equations. My implementation differs substantially from this approach while staying within the SIR framework. The S-, I- and R-Compartments are conceptualized as random variables and the weekly numbers of suscptible individuals, new infections and removed individuals are sampled from their respective distributions.

Modelling new infections as a 2-stage process

An important number in the context of this model is R-0, the basic reproduction number, which represents the average number of new infections generated by an infectious individual. Approaching this from a probabilistic angle, I model the number of new cases generated by an infectious individual as a Poisson-distributed random variable with an appropriately chosen parameter.

As an example, a Poisson random variable with parameter lambda = 2 will result in a distribution whose mean and variance equals 2. Since it is not clear, what the right parameter for the Poisson distribution is, it is also conceptualized as a random variable and sampled from a prior distribution of possible values. If data for weekly new infections is available, it can be used to inform the posterior distribution of parameter values (it can be learned from data).

Moreover, I model the spread of the disease as a two-stage process, where individuals that have just been infected are likely to generate more cases than those who have already been infected for a week. The reasoning here is that in the incubation period and - depending on the strength of the disease when it begins to manifest itself - in the early phase of the disease, infected individuals still go to work, meet friends and engage in social activities. The resulting number of social contacts is likely to be high, leading to a potentially large number of new infections.

A week into the infection, however, people are likely to really be sick and therefore stay at home. In this phase, they might infect other individuals living in the same household, but the number of social contacts and thus potential new infections is likely to be substantially lower.

This two-stage process resembles a variant of the SIR-Model called SEIR, where the E stands for exposed. Exposed individuals are seen as infectious, but without showing symptoms.

Running the model with and without data

The model be run in a forward fashion, meaning that no data is used to learn the parameters. In this case, in every run, values are sampled from their distributions. Such a run is basically a simulation using the assumptions that were put into the model. But the model can also be run incorporating observations for one or more of its random variables. In my case, I used data provided by the Robert-Koch-Institute, specifying the number weekly of new infections.

Installation

https://github.com/tomatitito/sir-model

Usage

It should be possible to call like this:

$ java -jar sir-modell-0.1.0-standalone.jar [args]

Because of this, you have to run (-main) from within a repl.

Results

Running the model forward 10000 times without conditioning on data yields the following distribution over possible influenza seasons. The blue-shaded are represents to 95% highest density interval (HDI), 95% of the outcomes that are more likely than the remaining 5%. Note that, while the HDI first becomes wider and then narrower again towards the end of the season, the variance within the outcomes is very high.

plot_no_dat

Running the model 10000 times conditioning on data from the 2015/16 influenca season yields the following results. I have used 24 datapoints representing weekly new incfections. The data are provided by the Robert-Koch-Institut (RKI).

plot_dat

Options

FIXME: listing of options this app accepts.

Examples

...

Bugs

...

Any Other Sections

That You Think

Might be Useful

License

Copyright © 2017 FIXME

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

About

Probabiistic program to model weekly new infections during an influenza season

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors