Logistic curve fitting in epidemiology: Difference between revisions

m
elided the 1st task, corrected 2 misspellings, used a bigger font to show the super- and subscripts, (fine print), used a consistent font for variables in/from expressions.corrected 2 uses of n sub oh-->n sub zero, moved 2 definitions closer to their use.
m (elided the 1st task, corrected 2 misspellings, used a bigger font to show the super- and subscripts, (fine print), used a consistent font for variables in/from expressions.corrected 2 uses of n sub oh-->n sub zero, moved 2 definitions closer to their use.)
Line 12:
including the growth of epidemics, are curves akin to the logistic curve:
 
'''f <big><big><big><b> ƒ(x) = L / (1 + e<sup>-k(x-x<sub>0</sub>)</sup>)''' </b></big></big></big>
 
Though predictions based on fitting to such curves may errerror, especially if used to
extrapolate from incomplete data, curves similar to the logistic curve have had
good fits in population studies, including modeling the growth of past epidemics.
 
The task:
 
;Task
* Given the following daily world totals since December 31, 2019 for persons
who have become infected with the novel coronavirus Covid-19:
 
* Given the following daily world totals since <tt> December 31, 2019 </tt> for persons who have become infected with the novel coronavirus Covid-19:
<pre>
Daily totals:
Line 38 ⟶ 34:
</pre>
 
* Use the following variant of the logistic curve as a formula:
 
* Use the following variant of the logistic curve as a formula:
'''f <big><big><big><b> ƒ(t) = n<sub>0</sub> e<sup>(r t)</sup> / ((1 + n<sub>0</sub> (e<sup>(r t)</sup> - 1) / K)''' </b></big></big></big>
 
Where:
Where::* &nbsp; <big><b> r </b></big> &nbsp; is the rate of growth of the infection in the population.
::* &nbsp; <big><b> K </b></big> &nbsp; is the world population, about 7.8 billion.
::* n0&nbsp; <big><b> n<sub>0</sub> </b></big> &nbsp; is 27, the number of cases found in China at the start of the pandemic.
 
 
The R0 of an infection (different from r above) is a measure of how many
 
The &nbsp; <big><b> R0 </b></big> &nbsp; of an infection (different from &nbsp; <big><b>r</b></big> &nbsp; above) is a measure of how many
new individuals will become infected for every individual currently infected.
It is an important measure of how quickly an infectious disease may spread.
 
<big><b>R0</b></big> &nbsp; is related to the logistic curve's &nbsp; <big><b>r</b></big> &nbsp; parameter by the formula:
 
''' <big><big><big><b> r ≈ ln(R0) / G''' </b></big></big></big>
 
where &nbsp; <big><b> G, </b></big> &nbsp; the generation time, is roughly the sum of the incubation time, perhaps 5 days, and
the mean contagion period, perhaps 7 days, so, for covid-19, roughly we have:
 
<big><big><big><b> R0 ≈ e<sup>12r</sup> </b></big></big></big>
 
'''R0 ≈ e<sup>12r</sup>'''
 
Assume the following constants hold in the formula above:
* K is the world population, about 7.8 billion
* n0 is 27, the number of cases found in China at the start of the pandemic.
 
;Task:
* Demonstrate code that finds a least-squares fits of the curve to the data.
* Show the calculated &nbsp; <big><b> r </b></big> &nbsp; for the logistic curve.
* Show the final &nbsp; <big><b> R0 </b></big> &nbsp; parameter you calculate from the logistic curve &nbsp; <big><b> r </b></big> &nbsp; value parameter.
 
;See also
 
;See also
:;*[[https://en.wikipedia.org/wiki/Basic_reproduction_number Basic reproduction number]]
:;*[[https://en.wikipedia.org/wiki/Logistic_function Logistic functions]]
Line 73 ⟶ 72:
:;*[[https://ourworldindata.org/coronavirus#all-charts-preview World covid-19 case tallies]]
:;*[[https://www.zoology.ubc.ca/~bio310/Blank%20Page%204_files/DL%20R%20and%20r.htm Calculating r and R0]]
<br><br>
 
 
=={{header|C}}==