Course Webpage

For a population distribution, $P(t),$ which is limited by some threshold value, $L,$ the functional form is often assumed to be of logistic type,

$$P\left(t\right)=\frac{L}{1+c\,e^{\,Kt}}$$

Assuming the following data has been collected,

$$ \begin{array}{|c|ccccc|} \hline t & 0 & 1 & 2 & 3 & 4\\ \hline P & 200 & 400 & 650 & 850 & 950 \\ \hline \end{array}$$

and taking $L=1000,$ compute, the values of $c$ and $K$ according to the least squares criterion.


Introduction

The logistic function

A slightly more complex function than the exponential one for modeling populations and epidemics is the logistic function. In the case of a population, it describes the dynamics of a population in a resource-limited environment. In the case of an epidemiological model, it assumes that there is a maximum number of individuals $ L $ that can be infected. The differential equation that describes it is similar to the exponential but a factor appears that highlights this limitation

$$\frac{dP}{dt} = K P\left(1-\frac{P}{L}\right)$$

In the early stages of the epidemic, when there are few infected individuals

$$ \frac{P}{L}\approx 0 \qquad \frac{dP}{dt} \approx K P $$

the curve behaves like an exponential. When the proportion of infected grows enough, the process slows down because there are many individuals who are no longer susceptible to infection because they have already been infected and the curve behaves like a straight line. In the last stages, the number of infected no longer grows.

Exercise

Let us linearize the function to approximate

$$ P=\frac{L}{1+c\,e^{\,Kt}} \quad \Longrightarrow \quad \frac{1}{P}=\frac{1+c\,e^{\,Kt}}{L} \quad \Longrightarrow \quad \frac{L}{P}=1+c\,e^{\,Kt} \quad \Longrightarrow $$

.

$$ \Longrightarrow \quad \frac{L}{P}-1=c\,e^{\,Kt} \quad \Longrightarrow \quad \ln\left(\frac{L}{P}-1\right)=\ln\left(c\,e^{\,Kt}\right) \quad \Longrightarrow $$

.

$$ \Longrightarrow \quad \ln \frac{L-P}{P}=\ln c + \ln e^{\,Kt} \quad \Longrightarrow \quad \ln \frac{L-P}{P}=\ln c + K\,t \ln e \quad \Longrightarrow $$

.

$$ \ln \frac{L-P}{P}=\ln c + K\,t $$

If we call

$$ y_k = \ln \frac{L-P_k}{P_k}, \quad x_k =t_k, \quad a_0 =\ln c, \quad a_1=k $$

we have

$$ \ln \frac{L-P_k}{P_k}\approx\ln c + K\,t_k \quad \Longrightarrow \quad y_k \approx a_0 + a_1\, x_k $$

The problem is now to fit a least squares regression line

$$ P_1(x) = a_0 + a_1\, x $$

to the transformed data $(x_k,y_k),\quad k = 1,\ldots,5$ with the system

$$ \left(\begin{array}{cc} \sum_{k=1}^{5}1 & \sum_{k=1}^{5}x_{k}\\ \sum_{k=1}^{5}x_{k} & \sum_{k=1}^{5}x_{k}^{2} \end{array}\right)\left(\begin{array}{c} a_{0}\\ a_{1} \end{array}\right)=\left(\begin{array}{c} \sum_{k=1}^{5}y_{k}\\ \sum_{k=1}^{5}x_{k}y_{k} \end{array}\right) $$

We compute the elements of these matrices

$$ \begin{array}{c|c|c|c|c|c|c|} \hline & x_k=t_k & P_k & y_{k}=\ln((L-P_k)/P_k) & x_{k}^{2} & x_{k}\,y_k\\ \hline & 0 & 200 & 1.386 & 0 & 0.\\ & 1 & 400 & 0.405 & 1 & 0.4055 \\ & 2 & 650 & -0.619 & 4 & -1.238 \\ & 3 & 850 & -1.735 & 9 & -5.204\\ & 4 & 950 & -2.944 & 16 & -11.78 \\ \hline \sum & 10 & & -3.506 & 30 & -17.81 \\ \hline \end{array} $$

and

$$ \begin{array}{ccccc} 5a_{0} & + & 10 a_{1} & = & -3.506\\ 10 a_{0} & + & 30 a_{1} & = & -17.81 \end{array} $$

And the solution is $a_0 = 1.459 \quad a_1=-1.080$. As

$$ a_0 =\ln c \quad a_1=K \quad \Longrightarrow c = e^{a_0}\approx 4.3 \quad K = a_1\approx -1.08 $$

The approximate curve is

$$ P\left(t\right)=\frac{1000}{1+4.3\,e^{-1.08t}} $$