Skip to content

Instantly share code, notes, and snippets.

@seantalts
Last active June 5, 2018 11:52
Show Gist options
  • Save seantalts/f5b5ca3ccf37488316a8fd80cc99b9b1 to your computer and use it in GitHub Desktop.
Save seantalts/f5b5ca3ccf37488316a8fd80cc99b9b1 to your computer and use it in GitHub Desktop.
cdf = function(x, pdf) {
sapply(x, function(x) {
integrate(pdf, -Inf, x)$value
})
}
u = cdf(rnorm(1e5), dnorm)
hist(u, breaks=100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment