Created
March 25, 2010 00:05
-
-
Save fonnesbeck/342994 to your computer and use it in GitHub Desktop.
Truncated Poisson random numbers in R
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
rtpois <- function(N, lambda, k) qpois(runif(N, ppois(k, lambda), 1), lambda) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment