Wednesday 2 October 2013

Overlay pmf of true Poisson distribution over histogram of randomly generated samples

Overlay pmf of true Poisson distribution over histogram of randomly
generated samples

I'm new to both statistics and R. I've generated 100 random samples from a
Poisson distribution with lambda = 2.5 using: samples <- rpois(100,2.5)
I've successfully created a relative frequency histogram of the samples:
hist(samples, prob=TRUE)
Now I need to overlay the pmf of the true Poisson distribution over the
histogram but don't know how to generate the true function. I think this
is probably very simple but just can't figure out what to do. Any help
would be really appreciated.
Thanks!

No comments:

Post a Comment