Created
May 17, 2019 20:40
-
-
Save leobarone/7df6235a2e9e5789058cdb859f221dd3 to your computer and use it in GitHub Desktop.
Probabilidade condicional do nascimento
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prob_diaria <- function(dias_passados){ | |
dia_quantile <- seq(from = -2, | |
to = 2, | |
length.out = 30) | |
prob <- pnorm(dia_quantile) | |
prob <- c(prob[1], prob[2:29] - prob[1:28], prob[1]) | |
d <- data.frame(dia = (40 * 7 - 15):(40 * 7 + 14), | |
prob) | |
d <- d[(dias_passados + 1):nrow(d),] | |
d$prob <- d$prob / sum(d$prob) | |
return(d) | |
} | |
prob_diaria(7) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment