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!

communications · customers · Uncategorized · worklyf

Tingling curiosity

Reading Time: < 1 minuteA random blast.

You know the feeling when you…

* buy that coffee mug with your branding on it. Fallout-related, naturally (remnant from geek stage)
* don’t carry the laptop to home on weekends
* turn off social media notifications during 925
* swear you could code Hubspot better
* still find using “F6” in Sublime to check for spelling errors the most convenient way
* abandon your reflexes for typing ’emacs -nw’
* don’t care about resolving an issue with Ubuntu software center on your laptop
* use ‘iptraf’ and ‘etherape’ way less
* revert back to the standard Ubuntu ‘iptraf’ package instead of your own compiled version of it
* get a nice looking book about advanced “bash” scripting, because it looks and smells good (truth: haven’t. Yet.)
* shave four times as often (Promise.)

Yeah. Sales is good 🙂


artificial intelligence · communications · fsf · future spam flow · information · new · order · PIM · pipelining knowledge · stress

A future email system idea

Reading Time: 4 minutes

What is the underlying problem of Personal Information Management?

Originally appeared in my Blogspot blog called Psiic.


I wrote back 10 years ago:
Current situation is that people use a variety of means (both electronic, physical, and mental) to achieve the needs of their work / personal communications.

Sometimes the barrier of entry into a new mental activity is high: “Can I handle this, is this too much for me? I am already on 7 mailing lists, I can’t just do it.” It’s just so much easier to say NO, than try something which possibly involves a risk; or where the person estimates the future spam flow (FSF) to be high.

The proposed system here is to alleviate this problem, and enable a more rich personal life! It’s not yet a realized (programmed) system, but this is an idea. I think it could be coded and proven to be effective, if implemented.

Acute problem points in current email systems:

  • archival with security in mind. When you are accessing a mailbox, there is whole lot of your life in it! It’s like part of your diary.
  • updating the information; now it is left for the user himself. A notification system of sorts would be nice.
  • handling the same information in several different computing environments:
    personal computer at home, work; a cellular or PDA, smart phone
    On route, without access to the above, but still able to use a ubiquitous network like Internet.
  • working in groups, sharing appropriately
  • handling of duplicate emails (CC’ed; carbon copied), so that they do not confuse
    the recipient. Many times a person might receive the exact same email in several inboxes, when the sender wanted to make sure that he is reached for sure / in time. All duplicates would be intelligently chained into one conversation. Duplicates are a source of major conflicts and annoyance.
  • of the duplicate email boxes, I found that it seems to be rather constant that I have 2 mailboxes at all times: personal + work. 
  • In uni studying I had the university mail, and then occasionally a work email 
  • time-based priority to emails: trying to make out the most logical sequence the emails should be read. How to do this?

What Else?

* tracking keywords and dates, applying heuristics to solve the ordering problem

* track response times to emails: if the user is always responding very quickly to
person X, then he will have higher priority in the general view order of emails

* asking for feedback from the user: “I ordered these two emails like this:
First comes message X, then message Y. What do you think?

a) This was the best solution
b) Reverse the order
c) They are unrelated

Theory of Pipeling (parallelizing) knowledge in life

- The Pipeline theory of life: 
  * you start process 1 (laundry), and do process 2 (reading) WHILE process 1 lasts;
    then you continue finishing process 1 (hang the clothes drying) etc.
    ==> is parallelism optimization possible just like in computer architecture?
    * Signals (event notifications) are becoming more important: reminders about the
      processes' states. When you have automation, it should be linked to the human
      controlling the process.
  * The Resource scheduling theory: booking tickets in advance to theatre
  * The Resource refining theory: you can do less now, and expect to do more work in the
    future, or you can do something very perfectly now and save time in the future
    (unpacking groceries after visiting the supermarket: should you prepare the groceries
    to be ready-to-use in containers etc. or just leave the bulk packages as they were?)

– possibility of concurrency in brain
* using all the modalities to make the email reading session a pleasant one: music,
audio synthesis to notify of new messages (from who, what’s the subject), reading
single keywords from the message body. Using a map perhaps to represent the country
origin of messages, based on these facts:
1) the language of the email
2) top-level domains, where helpful
3) as a weak indicator, the name of the sender might help guessing the geogr. location

* a tutorial to using the email system, like that of the best games. Makes you feel very
interested and everything is coming at a nice pace. Still it’s “live”, not just a
boring step-by-step web page or help file

– need for out-of-brain adjustment of the “flow” experience. Concept of time distorts pretty
heavily with some people, so little reminders of the day’s plans is necessary. Reminders
can be as simple as “Blink/beep me after 3 minutes so I’ll check the boiling rice in kitchen”
or according to ordinary calendar events.

Actions used in PIM:

1) Handling
2) Classifying
3) Retrieving

Proposed enhancements:

– a major part of the development is also eye-movement tracking, to gain knowledge how
people select the order of messages to be shown. The lab would consist of required
hardware, and also during the labs new incoming messages will be generated with various
topics to map out how the recipient responds to these, especially when the incoming
message “interrupts” a mental activity

– stress-relief logic, by using biomedical sensors to evaluate current situation, and
affecting the user with the proper modality of information

Types of calendar notes people make:

-household chores together with other tenants (“pihatalkoot”)
-meetings of hobby clubs

Routine: return a book to library

Personal relationships
-sports activity with friend

Personal events
-friend’s weddings


-A course starting
-Exams or equivalent

A wide variety of medication must be taken quite regularly in order
to maximise its effect.

-make an order via web or other media
-simple reminders within the day: PostIt Notes typically glued into monitors,
on the desk etc.: “Call Jim!” “Get laundry!” “Visit the post office!”