Skip to toolbar

Epidemiological models (SIR) in nCov and Other Epidemics

Spread the love
Reading Time: 4 minutes

Epidemic is an incident, in time, where typically a large proportion of a population gets ill.

Corona-virus pandemic of 2019 is causing an epidemic. Originally detected somewhere in December 2019, we are still (March 20th 2020) in midst of the rising tide of infection cases. The causing virus is called specifically ‘Severe acute respiratory syndrome coronavirus 2″, or SARS-CoV-2 for short. Another alias for the exact same virus is nCov. The disease that results from this virus is called COVID-19.

The virus – cause of the epidemic

Photo 1579781403337 De692320718a?ixlib=rb 1.2
A virus — photo by CDC on Unsplash

The biological root of an epidemic is called an antigen. With the novel Corona-virus pandemic, it’s a virus in the “corona family”.

There have been corona viruses in the wild before this 2019-2020 epidemic.

Viruses are small, lifeless objects per se, who carry either a DNA or RNA code, and can drift to hijack a working cell’s production mechanism, so that the cells start producing replicants of the virus. Thus normal functioning of the cells are interrupted and the virus population starts to grow.

Corona (nCOV) leading to the disease COVID-19 is a RNA-virus. Thus the replication message carried is in the form of ribonucleic acid. See Wikipedia: RNA-virus.

As one virus can reproduce many other viruses, the growth curve of the mass of viruses is exponential in shape. It’s similar to the mechanism of nuclear fission – the mechanism of nuclear weapons. Many biological processes are exponential.

The growth often also has a natural limiting factor, thus there’s resistance. In human bodies, resistance may come in the form of immunity fighting back the spread of the virus. A virus may also simply exhaust the host or exhausting a critical matter that is needed to replicate; leading to either sustained levels of viral presence, or decay of the level.

The antigen causes the symptoms and capability to transmit the disease to another person. The branch of medicine and science that deals with epidemics is called epidemiology.

Mathematical models for viral epidemics

There are lot of mathematics which is useful in modeling these epidemics. Some of maths is actually quite simple, and can be understood perhaps better with computer simulation.

There’s a few “main ideas” of viral outbreak simulations:

  • differential equations (called DE, or ‘ODE’)
  • agent-based simulation
  • AI models, such as using autoencoders [Wikipedia: autoencoder]

The simplest epidemic models choose variables that predict the amounts of people in various stages of the disease. People move (permanently) from one compartment towards the final compartment, which is ‘Recovered’. A recovered person means one who has either gotten immune (healthy), or died.

People always thus essentially end up in the Recovered state. This means also that these kind of models assume the epidemic goes through 100% of the people; for an individual, thus, the question wouldn’t be “whether I will get infected”, but “when (is it) I will get infected”.

In real life, there’s actually only a few things that potentially can prevent an infection from ever happening. One of those is that during the epidemic, a vaccine is found. Thus this would “freeze” the situation (number of population allocated into each compartments), given that the nations have funds to provide vaccination and given that everyone is willing to get vaccinated.

Thus an epidemic has a few interesting elements to it:

  • properties of the virus
  • sociology of a population, among which the virus is spreading
  • remedies available to stop the virus spreading
  • effectiveness of communicating the correct information and situational awareness to target population
  • availability and cost of the cure, if a person has gotten Infected
Photo 1575468130797 Aa950b68aeec?ixlib=rb 1.2
Photo by CDC on Unsplash

One of the most famous model, a set of differential equations, is called SIR model. SIR is a “compartmental model”: it places people into exactly one compartment at any given time. In SIR, for example, people can be:

  • Susceptible
  • Infected
  • Resolved

Actual, recognizable individuals (single people) are not “tracked” in these models – rather; the numbers of people in each compartment are calculated as function of time. So the model itself doesn’t identify individuals who are infected, but the use of the model is fed with real numbers. The statistics of infected (tested) people gives epidemiologists, citizens and any stakeholders during the management and containment a lot of important information.

Population models produce numeric results that can be plotted as curves.

Contained population: sum S+I+R

There’s one particular limitation set in SIR model, by design: the sum of compartmentalized populations is constant, and equal to initial population of the study:

  • in SIR model, summing S+I+R is always constant => equal to the initial population
  • thus in SIR model, births are not allowed
  • “R” includes both cured (immune) and deaths

These models were largely formulated in 1927.

Recipe for using SIR epidemiologic model

  • initialize all 3 compartments to values (populations)
  • define 4 parameters for the differential equations
  • there will be 3 differential equations, one for each population
  • in SIR, the populations are S=susceptible (healthy), I = infected, R = recovered
  • run a ODE solver algorithm, usually provided as part of your programming language of choice
  • for example, R language has “deSolve” libary and a ode() function, for example
  • for R language, there’s also ready-made code libraries for the particular SIR model; for example, one called EpiDynamics
  • ode() or the appropriate modeling function returns as result the values of each function (corresponding to one function per compartment)
  • you can plot the functions, all on a same diagram (axes t for time, and autoscaling Y axis as per quantity) to get an overall image of how the epidemic turns out

Some suggested reading

Btw. Getting R for experimenting with math modeling – it’s a snap! It took me less than 15 minutes to install both free RStudio and the underlying R programming environment. Definitely recommended!

Facebook Comments

Published by jukkasoft

Hi! A bit updated description. Code enthusiasta, technology optimist, but also a realist. In my blog I wrote 80% of technology related articles, mostly in English and Finnish. I like to envision and ponder about things, how life could be, what we are doing wrong today, and so on. "Invented" a facebook -like system in 2000, as a short product pamphlet. Haven't yet realized the 20+ ideas that might have become big things. Maybe learning this skill one of these days!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: