Hello fellow R users,
I wanted to view the density on the standard deviation scale of a gamma(0.001,
0.001) prior for the precision. I did this as seen in the code below and found
that for some reason rgamma is giving many values equal to zero, which is
strange since a gamma distribution is continuous. What is going on here?
Thanks for any help in advance.
Greg
> x1 <- rgamma(10000, shape=0.001, scale=0.001)
> sd1 <- 1/sqrt(x1)
> truehist(sd1, xlim=c(0, 1.5))
Error in truehist(sd1, xlim = c(0, 1.5)) :
'nbins' must result in a positive integer
> summary(sd1)
Min. 1st Qu. Median Mean 3rd Qu. Max.
2.266e+01 9.311e+66 3.250e+153 Inf Inf Inf
---------------------------------
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.