Savage-Dickey density ratio (source code)

= Savage-Dickey density ratio
{c}

Compare an unrestricted model $H_1$ with parameters $(\psi,\lambda)$ to $H_0:\psi=\psi_0$. Suppose the likelihoods agree under that restriction, the priors are proper, and the nuisance prior under $H_0$ equals the conditional prior $\pi_1(\lambda\mid\psi_0)$ under $H_1$. Using compatible density versions with $0<\pi_1(\psi_0)<\infty$, Bayes' theorem gives
$$
B_{01}=\frac{m_0(y)}{m_1(y)}=\frac{\pi_1(\psi_0\mid y)}{\pi_1(\psi_0)}.
$$
Indeed, the numerator of the marginal posterior density at $\psi_0$ is $\pi_1(\psi_0)\int L(y\mid\psi_0,\lambda)\pi_1(\lambda\mid\psi_0)d\lambda=\pi_1(\psi_0)m_0(y)$.

This ratio concerns densities in the unrestricted model, not a posterior atom at the null. A separately chosen nuisance prior under the null can invalidate the simple ratio; matching marginal nuisance priors is insufficient when $\psi$ and $\lambda$ are prior-dependent. Density values on a measure-zero restriction also require an agreed continuous or otherwise specified version.<Bayes Factors by Robert E. Kass and Adrian E. Raftery>[Section 4.3, p. 780, conditional-prior qualification following the density-ratio identity]{ref}