Sampling from the prior - why am I seeing divergent transitions?

I thought the usual “non-informative” prior was gamma(0.001,0.001) (which is even worse!).

I must say I am rather skeptical of any plot whose x-axis goes from \log y = -1000 to \log y = +1000, even if the only discernible feature is a single peak. Doubly so, if that feature happens to be suspiciously close to \log y \approx -750, i.e. the region where floating-point arithmetic typically over-/underflows.

My own calculation gives

\begin{eqnarray*} \mathrm{d}P & = & \frac{\beta^{\alpha}}{\Gamma\left(\alpha\right)}y^{\alpha-1}e^{-\beta y}\mathrm{d}y & = & \frac{0.5^{0.5}}{\Gamma\left(0.5\right)}y^{0.5-1}e^{-0.5y}\mathrm{d}y\\ & = & \frac{1}{\sqrt{2\pi}}\frac{1}{\sqrt{y}}e^{-\frac{1}{2}y}\mathrm{d}y & = & \frac{1}{\sqrt{2\pi}}\sqrt{y}e^{-\frac{1}{2}y}\frac{\mathrm{d}y}{y}\\ & = & \frac{1}{\sqrt{2\pi}}\sqrt{e^{z}}e^{-\frac{1}{2}e^{z}}\mathrm{d}z\\ & = & \frac{1}{\sqrt{2\pi}}e^{\frac{1}{2}z-\frac{1}{2}e^{z}}\mathrm{d}z \end{eqnarray*}

and the peak is a bit closer to zero
prob
I suspect the divergencies caused by the steep cliff on the right. It’s even more pronounced when plotting log-probability
logprob

5 Likes