Skip to content

Instantly share code, notes, and snippets.

@bionicles
Created December 21, 2020 02:55
Show Gist options
  • Save bionicles/a35a1e921c9dae3599cc2995c0673f13 to your computer and use it in GitHub Desktop.
Save bionicles/a35a1e921c9dae3599cc2995c0673f13 to your computer and use it in GitHub Desktop.
second-order expected value of covid vaccine
def compute_value_of_vaccine(
number_of_people_you_would_infect=1.1, # rt.live
value_of_a_human_life=10000000, # your life is worth ten million bucks
vaccine_efficacy=0.95, # the vaccine is 95% effective
covid_death_rate=0.01, # 1% of infected people die
):
expected_cost_of_death = value_of_a_human_life * covid_death_rate
expected_cost_of_family_death = (
expected_cost_of_death * number_of_people_you_would_infect
)
expected_cost_of_infection = expected_cost_of_death + expected_cost_of_family_death
covid_death_rate_with_vaccine = covid_death_rate * (1.0 - vaccine_efficacy)
expected_cost_of_death_with_vaccine = (
value_of_a_human_life * covid_death_rate_with_vaccine
)
expected_cost_of_family_death_with_vaccine = (
expected_cost_of_death_with_vaccine * number_of_people_you_would_infect
)
expected_cost_with_vaccine = (
expected_cost_of_death_with_vaccine + expected_cost_of_family_death_with_vaccine
)
# difference in cost
value_of_vaccine = expected_cost_of_infection - expected_cost_with_vaccine
return value_of_vaccine
if __name__ == "__main__":
value = compute_value_of_vaccine()
print(f"the value of a vaccine is {value}")
# the value of a vaccine is 199500.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment