Wednesday, September 9, 2020

Single Variable Equations for the SIR Model

 

  One can also derive single variable equations for the SIR Model. We start with a short review of the model.


We can eliminate I from the equation for the rate of change for S as follows.



Note that the first two terms are a logistic function so we might refer to all the terms as a modified logistic function. Note that if S0 is larger than S the logarithm is negative and the last term is positive reducing the infection rate.  The single variable equation for I is more complicated.



SI Pandemic Model and the Logistic Equation

 

  One can produce a very simple model for a pandemic involving just infecteds and susceptibles, the haves and the have nots, with the infection rate being proportional to rate of interaction between individuals with complete mixing. It is almost trivial to show that the changes for the two compartments follow the Logistic Equation.



We might call this the SI Model since there is no removed compartment for those who have recovered and are no longer infectious and those who have died and no longer interact with others.


Tuesday, September 8, 2020

Theory Versus Reality

 

  I tried to do a more accurate version of Lotka's fit of US population growth. The data used came from Appendex A of the US Census publication Measuring America. Since the day of the year that the census was taken on has not been constant I computed the number of days from the beginning of 1790 and divided by 365.25, the number of days in a Julian year and used that as the time scale. The growth appears to be approximately geometric until about 1930 and may have been affected by the Depression, WWII and the Cold War as well as government domestic and immigration policy. 





The second plot shows the deviation from geometric growth. Lotka's measured time with t'=t-t0 with t0 being the time of peak growth which he gave as Apr 1, 1914. The values I got were the following.






The formula for the time of peak rate of change is determined as follows,



The population growth of the US appears to have been slowing down. The last plot of the rate of change in population growth appears to be symmetrical. So if one uses this model to predict the number of future Covid-19 cases of infections one is likely to be off since the coronavirus tends to linger. The SIR model is a better predictor since it can match an asymmetric curve. For an accurate prediction we need both an accurate model and an accurate fit.

Supplemental (Sep 8): If the data points are not evenly spaced the formula that has to be solved to determine A for the 3 point fit is f=α1(A)-α2(A)=0 or,



Supplemental (Sep 10): Lotka's solution for the integral of the logistic equation is exact. dx/x(a+bx) is a standard integral and gives the same solution.

Standard Integrals


Sunday, September 6, 2020

Comparison of 3 point and NLS predictions

 

  A comparison of the 3 point fit, the nonlinear least squares fit (NLS) and historical statistics up to 1960 is shown in the following plot. It's debatable which is the better predictor but the Depression and WWII may have lowered population growth.


Saturday, September 5, 2020

Lotka's 3 point fit

 

  The trick for doing Lotka's 3 point fit is deriving a formula that we can solve for the unknown value of A after the other variables have been eliminated. We start by deriving formulas for B and α involving the X values. 

The expression for α is true for all values of X so we can use two data points to eliminate it resulting in one equation with one unknown.

If the data points used are evenly spaced we can eliminate Δt to get a function whose zero value gives us A. Assuming a value for A we can use Newton's method to compute the corrections dA. The convergence is fairly rapid so only a few iterations are needed to arrive at the value for A.

 One gets less known error if one assumes the fit is exact for 3 data points but that ignores any error that may be associated with these points and if the 3 point fit is used for predictions the risk is that the results will be slightly off.


Friday, September 4, 2020

Correction Eqns for the Logistic Eqn


  The Logistic Function is simple enough to illustrate the computation of corrections to the assumed coefficients. One starts by computing δ, the difference between the calculated value of X and the observed value. Then one computes the two fit functions, φ0 and φ1, as well as the single auxiliary function, φ2, forming an array of numbers.

This first array is used to compute a reduced array for the data which is in turn used to solve for the coefficients using worksheet functions to solve a set of linear equations as shown above. The corrections are then added to the assumed values. Using copy and paste to replace the assumed values repeats the process.


Lotka's Logistic Equation

 

  An NIH webpage discusses the use of Lotka's Logistic Equation for Covid-19 forecasting. This equation is found in Lotka, Elements of Physical Biology, p. 65. Lotka's assumes the general growth equation can be expanded as the sum of individual factors and the product of their powers. For a simple quadratic growth function the solution is a geometric function which he sums with using the usual formula for the sum of a geometric series. The resulting formula is applied to the growth in the US population between 1790 and 1910. I tried to see if I could improve on his fit using correction equaton method. My first attempt failed but the fit indicated that the value for the year 1860 was an outlier so that data point was eliminated from the fit. Here are some images showing my fit.





So the correction equations succeeded in finding a better fit to the US population growth. Losses during the American Civil War may have affected the data after 1860. δ is the difference between calculated and observed values.

Supplemental (Sep 5): Lotka's fit is slightly better than the fit using the nonlinear least squares correction equatons. Lotka's standard deviation is 325781 while my fit had a stdev of 384743 and that was without the 1860 data point.

Supplemental (Sep 5): Lotka appears to have done a three point fit of the derived equaton. A similar fit produced these results.