I have some Poisson data {${y_1,...,y_n}$} and a Gamma prior, and I wish to construct a predictive posterior distribution.
As I understand, if my Gamma hyperparameters are $\alpha$ (the prior number of occurrences) and $\beta$ (the prior number of observations), the predictive posterior is: ${y\space|\space y_1...y_n,\alpha,\beta}\space\tilde\space NegBin({\sum\limits_{i=1}^n y_i+\alpha}, \frac{1}{1+\beta+n})$
However, because of the multiple parametrizations of both Gamma and negative binomial, my attempts to actually implement this in R were so far futile.
Am I right that in the above formula $\alpha$ is shape
and $\beta$ is rate
in dgamma()
? Am I right then that $\sum\limits_{i=1}^n y_i+\alpha$ is size
in dnbinom()
? And what is prob
then? I thought it was $\frac{1}{1+\beta+n}$, but the resulting distribution doesn't seem to make sense.