Algorithm Search⌘K

Theoremadvanced

Savage-Dickey density ratio

Also called Savage-Dickey ratio.

For nested models with compatible priors, the Bayes factor for a point null equals the posterior density at the null value divided by the prior density there.

The Savage-Dickey density ratio is a formula for the Bayes factor of a nested point null. If the null model M0M_0 fixes a parameter ϕ\phi at ϕ0\phi_0 inside a larger model M1M_1, and the priors of the two models agree on the other parameters, then B01B_{01} equals the posterior density of ϕ\phi at ϕ0\phi_0 under M1M_1 divided by the prior density of ϕ\phi at ϕ0\phi_0. So a Bayes factor can be read from the posterior of the larger model alone, without computing any marginal likelihood.

Statement

Model M1M_1 has parameters (ϕ,ψ)(\phi, \psi), a sampling density f(x∣ϕ,ψ)f(x \mid \phi, \psi) and a proper prior density π1(ϕ,ψ)\pi_1(\phi, \psi). Model M0M_0 is the same model with ϕ=ϕ0\phi = \phi_0: its sampling density is f(x∣ϕ0,ψ)f(x \mid \phi_0, \psi) and its prior density on ψ\psi is π0(ψ)\pi_0(\psi). Write

π1(ϕ)=∫π1(ϕ,ψ) dψ,π1(ψ∣ϕ0)=π1(ϕ0,ψ)π1(ϕ0),π1(ϕ∣x)=∫f(x∣ϕ,ψ)π1(ϕ,ψ) dψm1(x).\pi_1(\phi) = \int \pi_1(\phi, \psi)\, d\psi, \qquad \pi_1(\psi \mid \phi_0) = \frac{\pi_1(\phi_0, \psi)}{\pi_1(\phi_0)}, \qquad \pi_1(\phi \mid x) = \frac{\int f(x \mid \phi, \psi)\pi_1(\phi, \psi)\, d\psi}{m_1(x)}.

These three formulas fix the versions of the densities at the single point ϕ0\phi_0; see the remark at the end of the proof.

Theorem (Savage-Dickey). Assume 0<π1(ϕ0)<∞0 < \pi_1(\phi_0) < \infty, 0<m0(x)0 < m_0(x), m1(x)<∞m_1(x) < \infty, and the compatibility condition

π0(ψ)=π1(ψ∣ϕ0)for almost every ψ.\pi_0(\psi) = \pi_1(\psi \mid \phi_0) \quad \text{for almost every } \psi.

Then

B01(x)=m0(x)m1(x)=π1(ϕ0∣x)π1(ϕ0).B_{01}(x) = \frac{m_0(x)}{m_1(x)} = \frac{\pi_1(\phi_0 \mid x)}{\pi_1(\phi_0)}.

If there is no nuisance parameter ψ\psi, the condition is empty and the identity always holds. If ϕ\phi and ψ\psi are independent under π1\pi_1, the condition says that M0M_0 uses the same prior on ψ\psi as M1M_1.

Theorem (Verdinelli and Wasserman). Drop the compatibility condition, and assume that π0(ψ)>0\pi_0(\psi) > 0 implies π1(ψ∣ϕ0)>0\pi_1(\psi \mid \phi_0) > 0. Then

B01(x)=π1(ϕ0∣x)π1(ϕ0)⋅E[π0(ψ)π1(ψ∣ϕ0)],B_{01}(x) = \frac{\pi_1(\phi_0 \mid x)}{\pi_1(\phi_0)} \cdot \mathbb{E}\Big[\frac{\pi_0(\psi)}{\pi_1(\psi \mid \phi_0)}\Big],

where the expectation is over ψ∼π1(ψ∣ϕ0,x)∝f(x∣ϕ0,ψ) π1(ψ∣ϕ0)\psi \sim \pi_1(\psi \mid \phi_0, x) \propto f(x \mid \phi_0, \psi)\, \pi_1(\psi \mid \phi_0), the posterior of ψ\psi under M1M_1 with ϕ\phi fixed at ϕ0\phi_0. Under compatibility the factor is 1.

In plain words

Before seeing data, the larger model gives some belief to the value in the null. After seeing data, it gives that value more or less belief. If the belief went up, the data favour the null, and if it went down, they favour the larger model. The theorem says that the size of this change is exactly the Bayes factor, as long as both models describe the remaining parameters in the same way. So one fit of the larger model is enough: you look at how high its posterior is at the null value and compare it with how high its prior was there.

Proof

Savage-Dickey. By the definition of π1(ϕ∣x)\pi_1(\phi \mid x) at ϕ0\phi_0, then the definition of π1(ψ∣ϕ0)\pi_1(\psi \mid \phi_0), then compatibility,

π1(ϕ0∣x)=1m1(x)∫f(x∣ϕ0,ψ) π1(ϕ0) π1(ψ∣ϕ0) dψ=π1(ϕ0)m1(x)∫f(x∣ϕ0,ψ) π0(ψ) dψ=π1(ϕ0) m0(x)m1(x).\pi_1(\phi_0 \mid x) = \frac{1}{m_1(x)}\int f(x \mid \phi_0, \psi)\, \pi_1(\phi_0)\, \pi_1(\psi \mid \phi_0)\, d\psi = \frac{\pi_1(\phi_0)}{m_1(x)}\int f(x \mid \phi_0, \psi)\, \pi_0(\psi)\, d\psi = \frac{\pi_1(\phi_0)\, m_0(x)}{m_1(x)}.

The last integral is m0(x)m_0(x) by definition. Divide by π1(ϕ0)>0\pi_1(\phi_0) > 0. □\square

Verdinelli and Wasserman. Let c(x)=∫f(x∣ϕ0,ψ) π1(ψ∣ϕ0) dψc(x) = \int f(x \mid \phi_0, \psi)\, \pi_1(\psi \mid \phi_0)\, d\psi. The first equality above, without the compatibility step, says c(x)=m1(x) π1(ϕ0∣x)/π1(ϕ0)c(x) = m_1(x)\, \pi_1(\phi_0 \mid x)/\pi_1(\phi_0). Also π1(ψ∣ϕ0,x)=f(x∣ϕ0,ψ)π1(ψ∣ϕ0)/c(x)\pi_1(\psi \mid \phi_0, x) = f(x \mid \phi_0, \psi)\pi_1(\psi \mid \phi_0)/c(x). By the support assumption,

m0(x)=∫f(x∣ϕ0,ψ) π1(ψ∣ϕ0) π0(ψ)π1(ψ∣ϕ0) dψ=c(x) E[π0(ψ)π1(ψ∣ϕ0)].m_0(x) = \int f(x \mid \phi_0, \psi)\, \pi_1(\psi \mid \phi_0)\, \frac{\pi_0(\psi)}{\pi_1(\psi \mid \phi_0)}\, d\psi = c(x)\, \mathbb{E}\Big[\frac{\pi_0(\psi)}{\pi_1(\psi \mid \phi_0)}\Big].

Divide by m1(x)m_1(x) and substitute c(x)c(x). □\square

Remark on versions. A density is defined only up to a set of measure zero, and {ϕ0}\{\phi_0\} has measure zero. If one changes π1(ϕ)\pi_1(\phi) at the single point ϕ0\phi_0, the prior is the same distribution, but the right side of the identity changes and the left side does not. In the same way, the conditional density π1(ψ∣ϕ=ϕ0)\pi_1(\psi \mid \phi = \phi_0) is not determined by the joint distribution, which is the Borel-Kolmogorov problem. The proof uses the three formulas of the statement at ϕ0\phi_0, so it holds for those versions. When π1(ϕ,ψ)\pi_1(\phi, \psi) and ff are continuous, these are the continuous versions, which is what any practical computation uses. Marin and Robert (2010) show that with other versions the "identity" can give any value, and they recommend fixing the versions in this way.

Consequences

A Bayes factor from one posterior. Only the posterior of ϕ\phi under M1M_1 is needed, at one point. With Markov chain draws (ϕ(s),ψ(s))(\phi^{(s)}, \psi^{(s)}) from M1M_1, for example by Gibbs sampling, the posterior density at ϕ0\phi_0 can be estimated by a kernel density estimate of the ϕ(s)\phi^{(s)}, or better by the Rao-Blackwell average 1S∑sπ1(ϕ0∣ψ(s),x)\frac1S\sum_s \pi_1(\phi_0 \mid \psi^{(s)}, x) when the full conditional of ϕ\phi has a closed form. In contrast, bridge sampling and nested sampling estimate m0m_0 and m1m_1 separately, and they work for models that are not nested and for priors that are not compatible.

Exact check: a coin. Toss a coin n=20n = 20 times and see y=15y = 15 heads. M1:θ∼M_1: \theta \sim Beta(1,1)(1, 1) and M0:θ=1/2M_0: \theta = 1/2; there is no nuisance parameter. The posterior is Beta(16,6)(16, 6), and its density at 1/21/2 is

21!15! 5! 2−20=21⋅155041048576=2034965536,\frac{21!}{15!\, 5!}\, 2^{-20} = \frac{21 \cdot 15504}{1048576} = \frac{20349}{65536},

while the prior density is 1. This is exactly B01B_{01} on the Bayes factor page. With the priors Beta(2,2)(2, 2), Beta(3,1)(3, 1) and Beta(5,5)(5, 5) the ratio is 0.27280.2728, 0.19250.1925 and 0.30320.3032, and in exact rational arithmetic it equals m0/m1m_0/m_1 in each case.

Example with a nuisance parameter. Fit yi=ψ+ϕ ti+eiy_i = \psi + \phi\, t_i + e_i, ei∼N(0,1)e_i \sim N(0, 1), at t=(−2,−1,0,1,2)t = (-2, -1, 0, 1, 2) with y=(0.1,0.9,1.2,2.3,2.4)y = (0.1, 0.9, 1.2, 2.3, 2.4), and test M0:ϕ=0M_0: \phi = 0. Take independent priors ψ∼N(0,4)\psi \sim N(0, 4) and ϕ∼N(0,1)\phi \sim N(0, 1) under M1M_1, and ψ∼N(0,4)\psi \sim N(0, 4) under M0M_0, so the priors are compatible. Because ∑ti=0\sum t_i = 0, the posterior of ϕ\phi is N(6/11,1/11)N(6/11, 1/11): precision 1+∑ti2=111 + \sum t_i^2 = 11 and mean ∑tiyi/11=6/11\sum t_i y_i / 11 = 6/11. Its density at 0 is 0.257600.25760, the prior density there is 0.398940.39894, and the ratio 0.645700.64570 equals m0/m1m_0/m_1 computed from the two marginal normal densities of yy. The least squares slope is 0.60.6, and the data mildly favour the slope, with B10≈1.55B_{10} \approx 1.55.

The Lindley paradox in one line. If the prior of ϕ\phi under M1M_1 is spread out, π1(ϕ0)\pi_1(\phi_0) goes to 0 while the posterior density at ϕ0\phi_0 does not, so B01→∞B_{01} \to \infty. This is Part 3 of the Lindley paradox.

Several parameters. The statement and proof do not use the dimension of ϕ\phi, so the identity holds for a vector ϕ\phi with joint densities. Testing several coefficients of a Bayesian linear regression at once is an example.

Tightness

Compatibility cannot be dropped. In the regression example, change only the prior of M0M_0 to ψ∼N(0,1)\psi \sim N(0, 1). The density ratio is still 0.645700.64570, because it does not look at π0\pi_0, but the true B01B_{01} is 0.685350.68535. The Verdinelli-Wasserman factor is E[2e−3ψ2/8]\mathbb{E}[2e^{-3\psi^2/8}] over ψ∼N(6.9/5.25,1/5.25)\psi \sim N(6.9/5.25, 1/5.25), which is 1.061411.06141, and 0.64570×1.06141=0.685350.64570 \times 1.06141 = 0.68535.

The prior density must be positive at ϕ0\phi_0. If π1(ϕ0)=0\pi_1(\phi_0) = 0, as for non-local priors, the ratio is 0/00/0 and the theorem says nothing. The Bayes factor is still defined through the marginal likelihoods.

The prior must be proper. If π1(ϕ)\pi_1(\phi) is improper, π1(ϕ0)\pi_1(\phi_0) has no fixed scale, and neither has the Bayes factor; see improper prior. An improper prior on the shared parameter ψ\psi is allowed, because it cancels in the proof as long as both models use it.

The version matters. As the remark in the proof shows, the identity is about the densities defined by the formulas of the statement, not about every version.

History

Dickey (1971) gave the density ratio form of the Bayes factor for linear hypotheses on normal means and credited the idea to L. J. Savage, which gave the name. Verdinelli and Wasserman (1995) removed the compatibility condition with the correction factor above and used it with Markov chain Monte Carlo output. Marin and Robert (2010) pointed out that the identity depends on the choice of version of the densities, which they called the Savage-Dickey paradox, and showed how to fix it. Kass and Raftery (1995) list the ratio among the ways to compute Bayes factors.

References

  1. James M. Dickey, The weighted likelihood ratio, linear hypotheses on normal location parameters, Annals of Mathematical Statistics 42(1), 1971, the density ratio form of the weighted likelihood ratio, credited to L. J. Savage (general locator)
  2. Verdinelli and Wasserman 1995, pages 614 to 618 (the correction factor when the priors are not compatible; general locator)
  3. Jean-Michel Marin and Christian P. Robert, On resolving the Savage-Dickey paradox, Electronic Journal of Statistics 4, 2010, pages 643 to 654 (the dependence on the version of the densities and how to fix it; general locator)
  4. Robert E. Kass and Adrian E. Raftery, Bayes factors, Journal of the American Statistical Association 90(430), 1995, the section on computing marginal likelihoods (general locator)

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/WCSA76/text.yaml