s243a icon

baseline_risk.m

s243a | PRO | 02/05/23 10:18:04 PM UTC | 0 ⭐ | 11723 👁️ | Never ⏰ | []
MatLab |

1.45 KB

|

None

|

0 👍

/

0 👎

 
#Let Bo be the baseline risk for time "To"
#The probability of not getting infected is exp(-kt)
#
#Therefore:
#Bo=exp(-kTo) -> k=-ln(1-Bo)/To
 
#0.01 was suggested as a low baseline risk in: https://www.thelancet.com/action/showPdf?pii=S0140-6736%2820%2931142-9
#Bo (Chu) =0.01
#
#Some (misguided people?) suggested 2 covid infections a year might not be so bad.
#So let's have the mean time to infection half a year.
#
#The mean of a binomial distribution is N*p, let N be days. So over a year
#N*p=2 -> p=2/365 (the probability of infection per day), To=2 day
#Therefore
Bo=2/365; #Baselinke risk (Bo) over time (To)
To=1;     
 
PFm=0.95; #is the Mask protection factor
m=(1-PFm)
 
#Calculate the decay constants
#Not that in matlab/octave log(x) is the natural log of f
ko=-log(1-Bo)/To;
km=-log(1-Bo*m)/To; 
 
#Let's consider what halps if we only wear the mask part time for the year
Tf_max=(365/2);
Tf_values=Tf_max/5:Tf_max/5:Tf_max;
y=zeros(length(Tf_values),101);
 
clf
hold on
 
#Commented code to consider other time frames
#for I=1:length(Tf_values)  
  I=5 #This is the index for the full time frame (half a year)
  Tf=Tf_values(I);
  t=[0 Tf/100:Tf/100:Tf];
  y(I,:)=exp(-ko*(Tf-t)).*exp(-km*(t));
  x=t/Tf;
  plot(x,y(I,:))
  
  Tf       #The end of the time interal
  y(I,100) #The probability of not getting infected at t=Tf w/100% mask use
  y(I,1)   #The probability of not getting infected with zero mask use 
#end
hold off

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎