Skip to content

Instantly share code, notes, and snippets.

@tvladeck
Last active February 20, 2018 15:21
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 tvladeck/511a0d23ddea4e31f756c116ae1ccbfd to your computer and use it in GitHub Desktop.
Save tvladeck/511a0d23ddea4e31f756c116ae1ccbfd to your computer and use it in GitHub Desktop.
# draw from an exponential distribution with mean 90
payment_failures <- rexp(1000, rate = 1/90)
# number of payment failures after 90 days
pf_90 <- (payment_failures < 90) %>% sum
# number of payment failures after 60 days (assuming same distribution)
pf_60 <- (payment_failures < 60) %>% sum
# number of 90 day payment failures observed relative to 60 day payment failures
pf_90 / pf_60
# 1.33833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment