This 8 schools data is from Gelman 2006 paper: http://www.stat.columbia.edu/~gelman/research/published/taumain.pdf. In Figure 1 (c), the prior density of inverse gamma (0.001,0.001) was overlain on the posterior histogram. The author claims that "This prior distribution is even more sharply peaked near zero and further distorts posterior inferences", which I find difficult to understand because inverse gamma (0.001,0.001) only has a very small probability near 0, e.g., $P(\sigma < 1 | \alpha =\beta=.001) = 0.006$ for the prior but the posterior $P(\sigma < 1) = .487$. So how does this prior distort the posterior towards 0?

UPDATE: Thanks so much for your reproducible code. I have accepted it as an answer. It appears that the prior density in the plot has been scaled to the range (0,30), that's why we see a spike of inv-Gamma(0.001, 0.001) near 0. But the issue is that if you draw samples from inv-Gamma(0.001, 0.001), you are going to see the probability $\sigma < 1$ is quite small and most values would be very large, so I do not understand how this prior can still distort the posterior to have a spike near 0. PS: the CDF of the inverse gamma distribution on Wiki page is defined using UPPER incomplete gamma function, so you should look at the "uppinc" when you run pracma::gammainc(shape, scale / 1) / gamma(shape)

## Best Answer

Figure 1 in the "Priors for variances" paper compares three prior distributions for the hierarchical standard deviation, $\sigma_\alpha$, in a two-level normal hierarchical model. It illustrates the drawbacks of the supposedly non-informative inverse gamma prior on the eight schools example.

As the answers by @Eoin and @Eli point out, the three priors are ordered so that, from left to right, each prior puts more probability mass near zero. In practice the inverse gamma priors suggest that we expect the school effects $\alpha_j$ shrink towards 0

even beforelooking at the data. In other words, the uniform prior is the least informative and the inverse-gamma($\epsilon$, $\epsilon$) prior is the most informative.The

informativenessof priors is to some extent defined with respect to the likelihood: a prior is strongly informative if it doesn't support values that are consistent with the data. For the eight schools, the likelihood is close to flat in the range [0,10], so any prior that concentrates only on a part of this range ends up being much more informative than the likelihood and the data.This is perhaps easier to see in the plots below which show the prior (red curve), the likelihood (blue curve) and the posterior (histogram) because $$ posterior \propto prior \times likelihood $$ With the uniform prior, the posterior is informed mostly by the likelihood, ie, by the data. But with the inverse gamma prior, the posterior doesn't look like much different from the prior even after observing the data from the eight schools. Why bother with collecting data if we are not prepared to update our prior in the face of evidence?

Note: The likelihood for eight schools is a function of both the overall effect $\mu$ and the hierarchical standard deviation $\sigma_\alpha$. I picked $\mu$ = 10 to plot the likelihood as a function of $\sigma_\alpha$ but the choice doesn't matter: for any value of $\mu$ in [0,15] the likelihood supports values for $\sigma_\alpha$ in the range [0,10].

Finally, the inverse-gamma($\epsilon$, $\epsilon$) has most of its probability mass close to zero. It seems you have inadvertently computed the upper-tail probability

P{X > x}instead of the lower-tail probabilityP{X ≤ x}.I'm sure you've looked up the definition: The CDF of the inverse gamma distribution with parameters shape $\alpha$ and scale $\beta$ is $F(x;\alpha,\beta) = \Gamma(\alpha,\beta/x) / \Gamma(\alpha)$. The numerator is the incomplete gamma function, the numerator is the (complete) gamma function.

Let's do the computation in R; we will use the

pracma::gammaincfunction which helpfully returns both the upper and lower incomplete gammas, so any confusion is avoided.The code to reproduce the figures, in all its gory details: