Understanding epidemic curves by simulating an outbreak

# Understanding epidemic curves by simulating an outbreak

## What are epidemic curves?

Epidemic curves, in the context of a virus outbreak, give us information relating to the speed and magnitude of the propagation. Those curves represent how many people are infected as a function of time. The time interval can be measured in days, weeks, months, etc...
Using such data, predicting models might be able to predict how the propagation of said virus will evolve.

Here are what an epidemic curve looks like: (Source)

## Epidemic curves obtained using the SIR and SEIR model

The SIR and SEIR models are a way of representing a virus spreading in the population. I already went over the SIR model in this article but I'll explain it again briefly.
The SIR and SEIR models are the two most basic models in what's known as compartmental models. The compartmental models takes a population and splits it into different compartments, (that's where the name comes from) and people in one compartment can move to another compartment, following some rules. Different compartmental models have different compartments. For example, the most basic one, the SIR model, has three compartments: Susceptible, Infected and Recovered. The rules in this one are that people can only move from the susceptible compartment to the infected compartment and from the infected compartment to the recovered compartment.

Of course, such a model must have a mathematical interpretation to be exploitable, and therefore, each compartment is described by a differential equation:

β being the infectivity constant and γ being the healing constant, you might have seen this model represented like so:

The basic idea behind this model is that by solving this system of differential equations, We'll be able to graph I(t) (which represents the number of infected people as a function of time), and we'll get an epidemic curve.

But before doing that, let's explain the SEIR model as well, which stands for Susceptible, Exposed, Infected, and Recovered. This model introduces a new compartment, the exposed compartment, which takes into account the fact that people can be exposed and infected to the virus without being contagious (there are way more variants, such as the SEIR model where people who recovered can go back to being susceptible, but we'll keep it simple here). We might represent this model like this:

Where σ can be the rate at which a person becomes Contagious. The equations then become:

Those systems of differential equations aren't easy to solve analytically, so I recommend reading my article on how to solve the SIR model by using Euler's method to understand how I'm able to graph the number of infected people as a function of time. And here are the results:

For the SIR model

And for the SEIR model