Anyone used the SIR for infectious disease? [View all]
https://en.wikipedia.org/wiki/Mathematical_modelling_of_infectious_disease#The_SIR_model
Super simple model. I coded it in Perl, whopping 40 lines of code, I added a nuance to quarantine a portion of the infected.
What I found, (regardless of total population). If beta (similar to R0) drops from 1.5 to 1.0, the peak number of cases is cut in half. Implication being that
if we can reduce interpersonal contacts by just 33% each day we'll push the peak case load down and out. If you can quarantine 50% of the infected cases the peak reduces by about 80%.
But you can't quarantine cases if you don't test for them...
[code]
use strict ;
use warnings ;
my $s_pop=10000000 ; # susceptible
my $i_pop=1 ; # infected
my $r_pop=0 ; #dead or immune
my $tot_pop = $s_pop + $i_pop + $r_pop ;
my $beta0=$ARGV[0] ; # per week
my $beta2=$ARGV[1] ; # per week
my $delay=$ARGV[2] ; # weeks
die "usage sir.pl <betaO> <beta2> <delay2>" if ! defined $beta0 ;
my $cases=1 ;
my $day=0 ;
my $beta=$beta0 ;
my $gamma=0.5 ; # assume it takes 1/(2 weeks) to recover
my $p_q = 0.0 ; # proportion of infected who are quarantined.
my $p_uq = 1.0-$p_q ; # proportion of population quarantined, but infected.
for(my $week=1 ; $week < 50 ; $week++) {
my $pct=$i_pop/$tot_pop*100 ;
print "week $week -- infected cases $i_pop, $pct %n" ;
if(defined($beta2) && defined($delay)) {
$beta = $beta2 if $week >= $delay ;
}
my $ds = -$p_uq*$beta*$s_pop*$i_pop/$tot_pop ;
my $di = $p_uq*$beta*$s_pop*$i_pop/$tot_pop - $gamma*$i_pop ;
my $dr = $gamma*$i_pop ;
$s_pop += $ds ;
$i_pop += $di ;
$r_pop += $dr ;
}
[/code]