Search code examples
rnormal-distributiontidyversegamma-distribution

Empirical Bayes in R


David Robinson gave a great example of empirical Bayes updating with the beta distribution. He

  1. found the prior from the distribution and
  2. used that prior to update estimates for each batter.

This had the remarkable effect of weighting averages based on the amount of data present and shrinking low-data observations closer to the mean.

How do we update estimates for counts and the normal case. I am assuming that the Gamma is used for counts and the Gaussian is used for normal, but I would love to see examples of this in R if anyone has any.


Solution

  • Many simulations, particularly in Empirical Bayes Deconvolution can be found here, Empirical Bayes Deconvolution. You will find a Poisson, two normal, and one binomial case.