Skip to content

Instantly share code, notes, and snippets.

@statwonk
Last active March 1, 2020 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save statwonk/70d65810ff90c3ffea859c3b47241633 to your computer and use it in GitHub Desktop.
Save statwonk/70d65810ff90c3ffea859c3b47241633 to your computer and use it in GitHub Desktop.
Showing that the number of deaths by coronavirus is somewhat robust to CFR restricted above 1% (South Korea lower bound at 0.4%).
set.seed(1)
N <- 1e7 # sims
quantiles_of_interest <- function(x) { quantile(x, c(0.0001, 0.25, 0.5, 0.75, 0.9999)) }
death_rate <- function() { pmin(pmax(rlnorm(N, log(0.02), 0.35), 0.001), 0.06) }
quantiles_of_interest(death_rate())
# very robust / ignorant belief of range of case 2.4k to 60M cases.
susceptible_cases <- function() { runif(N, 0.0024, 150) }
quantiles_of_interest(susceptible_cases())
death_rate()*susceptible_cases() -> cases
quantiles_of_interest(cases) # millions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment