Normal-inverse-gamma prior (source code)

= Normal-inverse-gamma prior

For a <normal linear model> with coefficient vector $\eta$ and residual <variance> $\sigma^2$, a normal-inverse-gamma prior has $\eta\mid\sigma^2\sim N(m,\sigma^2V)$ and $\sigma^2\sim\operatorname{IG}(a,b)$, with $V$ a <positive-definite matrix> and $a,b>0$. The inverse-gamma density is proportional to $(\sigma^2)^{-a-1}e^{-b/\sigma^2}$. Multiplying by the <normal linear model> <likelihood function> and completing the square preserves the family, giving an analytic posterior and evidence integral.