#!/usr/bin/python3 ##################### Edit your expectations below ################ # Effectivity against symptomatic disease of your first vaccination option: ve_1 = 0.66 # Janssen (global average) # Effectivity against symptomatic disease of your second vaccination option: ve_2 = 0.95 # BioNTech or Moderna # Weeks that you expect to wait longer when opting for the second vaccination option: vaccination_option_2_delay = 12 # weeks # Your expectation about what will be the "7-days incidence per 100,000" in your population # in the weeks following the time when my first vaccination option would become effective: # April May June July August September October # assuming a moderate "3rd wave": # incidences = [ 65, 70, 75, 80, 85, 90, 95, 100, 95, 80, 70, 60, 50, 40, 35, 30, 25, 20, 20, 15, 15, 10, 10 ] # assuming a constant incidence over the next 52 weeks: incidences = [ 65 for _ in range(52) ] # assuming three more "waves" going up to 200 and then down to 65 during every 3 months for a year: #incidences = [ 65 + i * (200-65)/8 for i in range(8) ] + [ 65 + (8-i) * (200-65)/8 for i in range(8) ] \ # + [ 65 + i * (200-65)/8 for i in range(8) ] + [ 65 + (8-i) * (200-65)/8 for i in range(8) ] \ # + [ 65 + i * (200-65)/8 for i in range(8) ] + [ 65 + (8-i) * (200-65)/8 for i in range(8) ] #################### Edit your expectations above ################ # now let's compute your chances of not getting infected during the # entire time you specified expected incidences for in above array p_noninfected_1 = 1.00 # for both vaccines we assume you are not infected at p_noninfected_2 = 1.00 # the time of your first chance to be vaccinated effectively for week in range(len(incidences)): # iterate over as many weeks as we have incidence estimates for # update the chance to stay not infected for the first vaccination option: p_noninfected_1 *= 1 - ((1.00 - ve_1) * incidences[week]/100000) # update the chance to stay not infected for the second vaccination option: if week >= vaccination_option_2_delay: p_noninfected_2 *= 1 - ((1.00 - ve_2) * incidences[week]/100000) else: # no protection by the second vaccine option during vaccination_option_2_delay p_noninfected_2 *= 1 - ( incidences[week]/100000) print(f"Your chance to stay not infected for the {len(incidences)} weeks following effectiveness of your first vaccination option is...") print(f"{p_noninfected_1 * 100} % when taking the first vaccination option") print(f"{p_noninfected_2 * 100} % when taking the second vaccination option")