After the COVID-19 outbreak, if there is one part in the unpopular discipline of mathematics that has gained massive popularity, it would be **mathematical modelling**–SIR or SEIR models in specific. However, SIR and SEIR models are only a type of **epidemiologic modelling;** there is a whole family of models named compartmental models in epidemiology and also other techniques in curve fitting.

**Curve fitting**

To first debrief the notion of “curve fitting,” we must recall how whitebox models are created. We utilize actual data to create a set of equations or curves that fulfill such a trend. Hence, curve fitting, as its name suggests, is to **adjust the equation** of a curve so that it **approximates the given data **in the best possible way.

However, this does not mean that linear graphs have no place in modelling contagions; even exponential curves can be shifted into a linear graph by using a logarithmic scale. After such conversion, it is possible to simply create a line of best fit–which by definition, must **minimize the sum of the total square deviation **for each data point. More rigorously, for a line of best fit y=ax+b and dataset (x1,y1), …, (xn,yn), we must minimize **equation (1).** By some multivariable calculus, we get **equations (2.1)** and **(2.2).**

These two are now two linear equations with two variables, which we can get the answer by substitution or elimination!

**Compartmental models of Epidemiology**

A compartmental model, on the other hand, assigns people to a **different compartment **named with a specific variable, thereby enabling accurate prediction of their behaviours.

Among these, the SIR method is perhaps the most classic but also one of the **most effective** measures of modelling diseases. SIR is an acronym for** Susceptible, Infected, and Recovered**–the three groups of our society that share mutual relationships. (*Fig 1*) With the entire population, some would be susceptible, the population that can be infected; some would be infected (which is quite self-explanatory); and some could be recovered, which would be the population that would not be infected thanks to the immune system and memory cells. Then, for each of these groups, we will be able to create a formula that represents the population of each group at time *t*. Using this formula, we would be able to accurately predict the future of an outbreak.

*Fig 1. Flow between population stocks*

The SIR model can be further improved by expressing each variable as a differential equation. First, for a given time t, the susceptible, infected, and recovered population would be represented as *S(t), I(t), R(t), *while the entire population would be **eq 3.**

We then assign other variables *Gamma* and *Beta*. *Beta* would represent the average number of contacts per person at a time, multiplied by the chance that the contacted individual would get the disease. Naturally, *Beta* would be the power of infection of the disease. *Gamma,* then, would quantify the transition rate between the infected and recovered subjects. That is, if a disease takes *D* days to cure, *Gamma* would be *1/D*.

With all of these in mind, from **eq 3**, because N is a constant, **eq 4**.

Then, for the susceptible population, the number that decreases would equate to the power of infection of the disease by the number infected, since that would be the number of susceptible people that contact with the infected and receive the disease. Then, the rate of change would be obtained by multiplying the ratio of the susceptible population to the entire population to that value. Thus, **eq 5.**

For the infected population, *-dS/dt* would simply be the rate of increase. But note that we must subtract*Gamma I*, which is the people that would recover at time *t*. Thus, we get **eq 6. **Finally, **eq 7.**

With the four equations, we can obtain the solution of the differential equations, allowing us to model the future of diseases with high accuracy, as in **eq 8.1, 8.2, 8.3, 8.4.**

I will soon cover long-term infections such as HIV, which includes another variable representing age. Also, I will soon write about other models such as SEIR, MSIR, SIDS, and a suitable model for COVID-19.

More articles available at: https://www.seanyoonbio.com/