Advertisement
s243a

baseline_risk.m

Feb 5th, 2023
1,427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 1.45 KB | None | 0 0
  1.  
  2. #Let Bo be the baseline risk for time "To"
  3. #The probability of not getting infected is exp(-kt)
  4. #
  5. #Therefore:
  6. #Bo=exp(-kTo) -> k=-ln(1-Bo)/To
  7.  
  8. #0.01 was suggested as a low baseline risk in: https://www.thelancet.com/action/showPdf?pii=S0140-6736%2820%2931142-9
  9. #Bo (Chu) =0.01
  10. #
  11. #Some (misguided people?) suggested 2 covid infections a year might not be so bad.
  12. #So let's have the mean time to infection half a year.
  13. #
  14. #The mean of a binomial distribution is N*p, let N be days. So over a year
  15. #N*p=2 -> p=2/365 (the probability of infection per day), To=2 day
  16. #Therefore
  17. Bo=2/365; #Baselinke risk (Bo) over time (To)
  18. To=1;    
  19.  
  20. PFm=0.95; #is the Mask protection factor
  21. m=(1-PFm)
  22.  
  23. #Calculate the decay constants
  24. #Not that in matlab/octave log(x) is the natural log of f
  25. ko=-log(1-Bo)/To;
  26. km=-log(1-Bo*m)/To;
  27.  
  28. #Let's consider what halps if we only wear the mask part time for the year
  29. Tf_max=(365/2);
  30. Tf_values=Tf_max/5:Tf_max/5:Tf_max;
  31. y=zeros(length(Tf_values),101);
  32.  
  33. clf
  34. hold on
  35.  
  36. #Commented code to consider other time frames
  37. #for I=1:length(Tf_values)  
  38.   I=5 #This is the index for the full time frame (half a year)
  39.   Tf=Tf_values(I);
  40.   t=[0 Tf/100:Tf/100:Tf];
  41.   y(I,:)=exp(-ko*(Tf-t)).*exp(-km*(t));
  42.   x=t/Tf;
  43.   plot(x,y(I,:))
  44.  
  45.   Tf       #The end of the time interal
  46.   y(I,100) #The probability of not getting infected at t=Tf w/100% mask use
  47.   y(I,1)   #The probability of not getting infected with zero mask use
  48. #end
  49. hold off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement