On Sun, 16 Jan 2011, Hugo Mildenberger wrote:

Using R-2.12.1 and latticeExtra-0.6-14, I would like to understand
why a rootogram displaying samples from the Poisson distribution looks like I
expected it, whereas a rootogram using the normal distribution does not:

library(latticeExtra)
rootogram(~rpois(1000, lambda = 50), dfun = function(x) dpois(x, lambda = 50))

rootogram(~rnorm(1000), dfun = function(x) dnorm(x,mean(x),sd(x)))

I probably can't attach figures here. Thus a textual description of what I get may suffice: With increasing sample size, the rootogram using random samples from the Poisson distribution shows decreasing differences (bars are quickly approaching the zero line), whereas the displayed differences for random samples of the normal distribution are always large. The differences even increase with sample size, i.e, the hanging bars tend to vanish for very large samples.

The normal distribution is a continuous distribution, i.e., the frequency for each observed value will essentially be 1/n and not converge to the density function. Hence, you would need to look at histogram or smoothed densities. Rootograms, on the other hand, are intended for discrete distributions.
Z

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to