communications · CompSci_Studies · download · Health · medicine

Epidemiological models (SIR) in nCov and Other Epidemics

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

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 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!

calsync60 · certificates · download · hard · hassle · installation · Nokia e71 · sisx

To synch or not – that is the Question!

Reading Time: 3 minutesSometimes you need a specific thing. One of these for me is a synchronization
software between my Nokia e71 and Google calendar. Then I’d like to have
Roboform play with Chrome browser. And… and… (Roboform is a catchy
utility that stores passwords and feeds them into your browser when you need

In this story I describe how I spent an hour doing “installation” instead of
actually using the software. The plain need to have a software on my phone
turned out into an adventure where passwords, websites, ftp programs and what
not play a big part. Having moved on from the software based solution into
a web-based one was no help. I kept receiving synch errors.

It actually brings light to the bigger problem of these
giants (Nokia, Google) not being able to co-operate enough so that users
would benefit from the situation. It seems Nokia phones don’t have a decent
software for calendar synchronization. Please correct me! I would so much like
to be wrong in this case. What my experience tells is that trying to search
for good software and getting it right is sometimes a horribly frustrating

Each one of the installations is an adventure. You can never quite be sure
you will reach the target. It took about 20 years for Windows software
installation process to settle down and get standardized. Mobile phones have
a head start. What I’ve gathered is that there are some sort of standards
right from the beginning for eg. Symbian installations. I really liked exploring
the Nokia e71 right from the beginning, since there were much pre-installed
software. I liked Widgets. -ED. It turned, me not like! I haven’t digged into it but I really do miss the ease
of use of Widgets.

I’m probably the only one on this planet to be specialized in doing things
the hard way. Or then tech really is complicated. I want Calsync60 on my
Nokia phone. It’s available on the network, and I’d like to just download
it directly to my phone, since I don’t have the sync cable nor working bluetooth.

Well, turns out I can’t find a .SIS installation package on the whole net.
All articles point to this one location, which has a .zip file. It contains
two things: the real installation package (a .sisx) and an information file (text).
It’s plain irritating that software installation is this laborious.

I next need to install Filezilla to get ftp connection. So downloading yet
another 3.8 megabytes. After installation, I connect to my own site in order
to store the installation .sisx there. Need login information, which I rarely
use. It’s on another machine, stored in the Filezilla profile. Well, a couple of
minutes later I had my installation package on my server, ready to be downloaded
to Nokia. I took it. The download went fine. Then, it opened the .sisx into
. And crashed (jammed). The phone didn’t respond to power off anymore.
So I took out the battery, and booted that way. It’s amazing I’d spent approx. an hour trying to get a single software into my phone. This must be on the hot agenda with
Nokia. They’re really in trouble with software installation usability. It ain’t
satin smooth exactly, as this story has revealed. I hope they get it right with whatever the solution is. Because it’s getting more important by each day.

The good working solution was to do installation of PC Suite, and then install
the .sisx package from a local directory.
Because PC Suite makes your PC understand
the file extensions, thus it identifies the file correctly and you can install the
software to your phone. I should’ve known and skipped all the extra steps, but you
never know unless you try. 🙂 But wait. The story goes on. I had to tweak my phone’s
date and time back to 2008, so that the Calsync60 didn’t expire. And thus the calendar functions of course deteriorated. Putting it back into proper date,
the software wouldn’t play ball anymore. I was stuck.

Back to software business..

I dream of a system where I could just tell what I want, and the right software
would be offered
. Today it’s a lot of googling around and checking the details
when you need something. And there’s often a big negative surprise about an
installed software: it has some viral marketing, crippled functionality,
time limitations, and most often functional mismatch. But I don’t know whether
software could be put into a feasible property matrix. Like: I need sync between
Nokia e71, and Google Calendar, no limits, free of charge. The system would weed
down possibilities according to my criteria.

And please, make installations easier. Away with the certificates hassle, away
with searching all day along, and coming up with strange circumventing. I don’t know
how, but installation of software should be completely free of location, circumstances, whatsoever. It should be as simple as breathing.

I would just like plain software, nicely packaged, easy to look it up, so that I could enjoy it as soon as possible. There, the challenge has been thrown!

EDIT: on 25th June 2009, in the morning, I got to work with my phone.
The previous systems error (not giving much clue) was due to the lack of connecting
my profile with my Google Calendar. So perusing the user interface at Goosync I noticed there was a kind of to-do list of things to do, so I filled in the information and thus authorized GooSync to access my calendar.