4 ms·
In gawk, as of 28 Jan, daily for 2 weeks, weekly for 100 days: #!/usr/bin/gawk -f BEGIN { # Data as of 2020-1-28 doublerate = 1.71
by dredmorbius 7y ago
In gawk, as of 28 Jan, daily for 2 weeks, weekly for 100 days:
#!/usr/bin/gawk -f
BEGIN {
# Data as of 2020-1-28
doublerate = 1.71
dailyrate = 2/doublerate
cases = 6063
deaths = 132
now = mktime( "2020 01 28 00 00 00" )
maxdays = 14
interval = 1
printf( "| %3s | %-12s | %12s | %14s |\n", "day", "date", "deaths", "cases" )
printf( "|%-5s|%14s|%14s|%16s|\n", ":---", "------------:", "------------:", "-------------:" )
for(day=1; day<=maxdays; day+=interval ) {
date = strftime( "%b %d, %Y", now + day * 86400 )
printf( "| %3i | %-12s | %'12i | %'14i |\n", day, date, deaths * (dailyrate^day), cases * (dailyrate^day) )
}
printf( "\n\n" )
maxdays = 100
interval = 7
printf( "| %3s | %-12s | %12s | %14s |\n", "day", "date", "deaths", "cases" )
printf( "|%-5s|%14s|%14s|%16s|\n", ":---", "------------:", "------------:", "-------------:" )
for(day=1; day<=maxdays; day+=interval ) {
date = strftime( "%b %d, %Y", now + day * 86400 )
printf( "| %3i | %-12s | %'12i | %'14i |\n", day, date, deaths * (dailyrate^day), cases * (dailyrate^day) )
}
printf( "\n" )
}
- dredmorbius 7y agoOutput. Keep in mind that low-side deviation is anticipated and is a measure of containment success. | day | date | deaths | cases | |:--- | ------------:| ------------:| -------------:| | 1 | Jan 29, 2020 | 154 | 7,091 | | 2 | Jan 30, 2020 | 180 | 8,293 | | 3 | Jan 31, 2020 | 211 | 9,700 | | 4 | Feb 01, 2020 | 247 | 11,345 | | 5 | Feb 02, 2020 | 288 | 13,269 | | 6 | Feb 03, 2020 | 337 | 15,519 | | 7 | Feb 04, 2020 | 395 | 18,152 | | 8 | Feb 05, 2020 | 462 | 21,230 | | 9 | Feb 06, 2020 | 540 | 24,830 | | 10 | Feb 07, 2020 | 632 | 29,041 | | 11 | Feb 08, 2020 | 739 | 33,967 | | 12 | Feb 09, 2020 | 864 | 39,727 | | 13 | Feb 10, 2020 | 1,011 | 46,465 | | 14 | Feb 11, 2020 | 1,183 | 54,345 | | day | date | deaths | cases | |:--- | ------------:| ------------:| -------------:| | 1 | Jan 29, 2020 | 154 | 7,091 | | 8 | Feb 05, 2020 | 462 | 21,230 | | 15 | Feb 12, 2020 | 1,383 | 63,561 | | 22 | Feb 19, 2020 | 4,143 | 190,297 | | 29 | Feb 26, 2020 | 12,403 | 569,731 | | 36 | Mar 04, 2020 | 37,135 | 1,705,718 | | 43 | Mar 11, 2020 | 111,181 | 5,106,750 | | 50 | Mar 18, 2020 | 332,865 | 15,289,096 | | 57 | Mar 25, 2020 | 996,564 | 45,774,017 | | 64 | Apr 01, 2020 | 2,983,613 | 137,042,800 | | 71 | Apr 08, 2020 | 8,932,639 | 410,292,352 | | 78 | Apr 15, 2020 | 26,743,422 | 1,228,374,011 | | 85 | Apr 22, 2020 | 80,067,114 | 3,677,628,161 | | 92 | Apr 29, 2020 | 239,712,883 | 11,010,448,584 | | 99 | May 06, 2020 | 717,676,247 | 32,964,174,931 |
- jerf 7y agoExtend the model out just a bit farther and you discover the true threat of coronavirus that we need to be worried about is when the infected and dead are sufficiently numerous that we need to start worrying about their Schwarzchild radius. Truly... dark times.
- dredmorbius 7y agoThere's a reason all growth curves tend to sigmoid (for instances / total births or cases w/ time), and steady-state, cyclic, or boom-bust. And ultimately, of course, extinction. OTOH, 2019-nCoV might be the answer to self-sustaining fusion we've been looking for.
- perl4ever 7y agoI like to put upper bounds on the worst case, so I checked out the Wikipedia page on the 1918 flu, and it appears that this virus is only about 1/5th as lethal, and lacking a world war, shouldn't spread as easily.
- djmips 7y agoNo world war however we now have airlines and modern travel.
- bsg75 7y agoWhat is the source for the doublerate ? Related to R0 ?
- dredmorbius 7y agoFrom the Wikipedia Wuhan 2019-nCoV article, semi-log graph. Caption: Semi-log plot of confirmed cases and deaths indicates the epidemic is in an exponential phase. Doubling time is 1.71 days (95% confidence interval 1.64 to 1.79) for case numbers https://en.m.wikipedia.org/wiki/2019–20_Wuhan_coronavirus_outbreak#/media/File%3ALog-linear_plot_of_coronovirus_cases_with_linear_regressions.png https://en.m.wikipedia.org/wiki/2019–20_Wuhan_coronavirus_ou... Since there are low and high estimates, I could include those values as well in my model. OK, done. Note that this really shows how sensitive growth rates are to even modest changes in doubling rate. Note that the 'lo' column refers to the time to doubling, not the rate of doubling, which may otherwise be counterintuitive. In the 100-day run, the difference between a 1.64 day doubling rate vs. a 1.79 day doubling rate is total global infection by April 8, vs. still < 360 million infected by May 6. The real lesson here is that growth rate matters vastly more than starting quantity. That's something any investor should recognise innately, but it applies accross numerous other fields. Including pandemic spread, population growth, and resource utilisation rates of increase. | day | date | deaths | cases | @ lo dbl | @ hi dbl | |:--- | ------------:| ------------:| -------------:| -------------:| -------------:| | 1 | Jan 29, 2020 | 154 | 7,091 | 7,393 | 6,774 | | 2 | Jan 30, 2020 | 180 | 8,293 | 9,016 | 7,569 | | 3 | Jan 31, 2020 | 211 | 9,700 | 10,996 | 8,457 | | 4 | Feb 01, 2020 | 247 | 11,345 | 13,410 | 9,449 | | 5 | Feb 02, 2020 | 288 | 13,269 | 16,353 | 10,557 | | 6 | Feb 03, 2020 | 337 | 15,519 | 19,943 | 11,796 | | 7 | Feb 04, 2020 | 395 | 18,152 | 24,321 | 13,180 | | 8 | Feb 05, 2020 | 462 | 21,230 | 29,660 | 14,726 | | 9 | Feb 06, 2020 | 540 | 24,830 | 36,171 | 16,454 | | 10 | Feb 07, 2020 | 632 | 29,041 | 44,111 | 18,384 | | 11 | Feb 08, 2020 | 739 | 33,967 | 53,794 | 20,541 | | 12 | Feb 09, 2020 | 864 | 39,727 | 65,602 | 22,951 | | 13 | Feb 10, 2020 | 1,011 | 46,465 | 80,003 | 25,644 | | 14 | Feb 11, 2020 | 1,183 | 54,345 | 97,564 | 28,652 | | day | date | deaths | cases | @ lo dbl | @ hi dbl | |:--- | ------------:| ------------:| -------------:| -------------:| -------------:| | 1 | Jan 29, 2020 | 154 | 7,091 | 7,393 | 6,774 | | 8 | Feb 05, 2020 | 462 | 21,230 | 29,660 | 14,726 | | 15 | Feb 12, 2020 | 1,383 | 63,561 | 118,981 | 32,014 | | 22 | Feb 19, 2020 | 4,143 | 190,297 | 477,290 | 69,595 | | 29 | Feb 26, 2020 | 12,403 | 569,731 | 1,914,634 | 151,293 | | 36 | Mar 04, 2020 | 37,135 | 1,705,718 | 7,680,489 | 328,895 | | 43 | Mar 11, 2020 | 111,181 | 5,106,750 | 30,810,015 | 714,985 | | 50 | Mar 18, 2020 | 332,865 | 15,289,096 | 123,593,305 | 1,554,303 | | 57 | Mar 25, 2020 | 996,564 | 45,774,017 | 495,790,250 | 3,378,893 | | 64 | Apr 01, 2020 | 2,983,613 | 137,042,800 | 1,988,845,356 | 7,345,363 | | 71 | Apr 08, 2020 | 8,932,639 | 410,292,352 | 7,978,184,014 | 15,968,056 | | 78 | Apr 15, 2020 | 26,743,422 | 1,228,374,011 | 32,004,207,853 | 34,712,893 | | 85 | Apr 22, 2020 | 80,067,114 | 3,677,628,161 | 128,383,767,336 | 75,462,218 | | 92 | Apr 29, 2020 | 239,712,883 | 11,010,448,584 | 515,007,020,041 | 164,047,010 | | 99 | May 06, 2020 | 717,676,247 | 32,964,174,931 | 2,065,932,759,210 | 356,621,130 | Chart is formatted as a Markdown chart, BTW.