The Marginal Data Density (MDD) — also called the marginal likelihood or model evidence — is the probability of observing the data under a given model, with parameters integrated out. It is the canonical Bayesian criterion for comparing models of any type (nested or non-nested).
Science as data reduction (Sims 1996). A model that compresses data without sacrificing predictive content is a good model; the MDD is the formal measure of this compression. Just as Newton's mechanics compressed Kepler's laws by subsuming them under fewer principles, a model with high MDD achieves the same explanatory content with less parameter freedom. This framing motivates MDD as the epistemologically correct criterion for Bayesian model evaluation in macroeconomics, where a single historically given time series — not repeated experiments — is the object of inference. See Sims (1996).
Key Ideas
The MDD penalizes overfitting automatically: a model that achieves a high likelihood only in a narrow region of parameter space is penalised by the prior volume.
For unrestricted reduced-form vector autoregressions (VARs), the MDD has a closed-form expression.
For restricted (identified or over-identified) structural VARs, it requires numerical approximation via the Chib (1995) Gibbs-sampler algorithm.
MDD comparisons between VARs and Dynamic Stochastic General Equilibrium (DSGE) models are the standard for evaluating whether theoretical restrictions compromise fit.
How It Works
Definition
p(YT∣M)=∫ΘL(ϕ∣YT)p(ϕ∣M)dϕ
where ϕ collects all model parameters, Θ is their domain, L(ϕ∣YT) is the likelihood, and p(ϕ∣M) is the prior under model M.
Bayes factor between two models M1 and M2:
BF12=p(YT∣M2)p(YT∣M1)
BF12>1 favors M1. Because the integral over Θ is typically evaluated in log space, the comparison is often reported as logp(YT∣M1)−logp(YT∣M2).
Closed Form for Unrestricted Reduced-Form VARs
With the Sims-Zha Prior, the reduced-form VAR has a Normal-Wishart posterior structure. The MDD has a closed-form expression involving the ratio of normalizing constants:
where (ν0,Ψ0,V0) are prior parameters and (νT,ΨT,VT) are posterior parameters. No Markov Chain Monte Carlo (MCMC) is needed.
Chib (1995) Algorithm for Restricted VARs
For over- or exactly-identified structural VARs with linear restrictions Qjaj=0, Rjfj=0, no closed form exists. The Chib algorithm exploits the identity:
logp(YT)=logL(ϕ∗∣YT)+logp(ϕ∗)−logp(ϕ∗∣YT)
evaluated at any point ϕ∗ (typically the posterior mode). The three terms on the right are:
Log-likelihood at ϕ∗: direct evaluation.
Log prior at ϕ∗: closed form given the Gaussian Sims-Zha Prior.
Log posterior at ϕ∗: requires evaluation of p(ϕ∗∣YT), which is itself approximated via the Gibbs sampler output using conditional posteriors.
Gibbs Sampler for Structural VARs (Waggoner-Zha 2003a)
Partition the free parameters into blocks {bj,gj}j=1n where aj=Ujbj and fj=Vjgj (see Structural Identification). The sampler alternates:
Draw gj∣bj,{bi,gi}i=j,YT — posterior of gj given bj is Gaussian (closed form).
Draw bj∣{bi}i=j,{gi}i=1n,YT — posterior of bj given all other blocks has a closed-form pdf and can be simulated exactly.
Because each conditional pdf is available in closed form, Chib's algorithm can evaluate p(ϕ∗∣YT) accurately without long chains. In practice, a 10-variable, 13-lag VAR completes in under one minute.
Carlin-Chib (1995) Augmented Sampler
An alternative to computing p(y∣Mj) separately for each model is to run a single MCMC that visits all K models simultaneously and reads off posterior model probabilities directly from visit frequencies.
The absorbing state problem. In a naive augmented sampler with model indicator M∈{1,…,K}, parameters of inactive models are "dropped" at each iteration. When a parameter is forced out of the model, the chain enters an absorbing state (the dropped parameter can never be regenerated by a standard Gibbs step), violating the irreducibility condition for convergence.
The fix: pseudo-priors. Introduce pseudo-priors (linking densities) p(θj∣M=j) — proper distributions for the parameters of model j when j is not the active model. Since y⊥θj∣(M=j), these densities are irrelevant to p(y∣M=j) and can be chosen freely. With pseudo-priors, the complete joint model is:
θj∣M=j,y: standard model-j posterior; when M=j, draw from pseudo-prior p(θj∣M=j).
M∣θ,y: discrete distribution proportional to f(y∣θj)p(θj∣M=j)πj.
No absorbing states exist; standard Gibbs convergence conditions apply.
Bayes factor estimation. At convergence, visit frequencies estimate posterior model probabilities:
P^(M=j∣y)=Gj/G,B12=P^(M=2∣y)P^(M=1∣y)⋅π1π2
Standard errors follow from batching the autocorrelated M-chain.
Pseudo-prior tuning. Mixing depends on how closely pseudo-priors approximate the model-specific posteriors p(θj∣M=j,y). Recommended workflow: run K individual model-specific chains first; use first-order normal approximations to these posteriors as pseudo-priors. Diffuse pseudo-priors produce competitive proposals only rarely → high autocorrelation in M-chain → slow convergence. Prior weights πj can be tuned to rebalance a badly skewed chain; the estimated Bayes factor adjusts accordingly.
Contrast with Chib (1995). Chib computes logp(y∣Mj) via an identity evaluated at a single point from one model's MCMC output; Carlin-Chib runs a combined sampler spanning all models. Both target the same quantity. Carlin-Chib is more direct for small K (2–5 models); Chib scales better to large K and avoids pseudo-prior design. For the cointegrated vector error correction model (VECM) application of Warne (2006), the Chib identity is preferred because K is the full (r,k) grid.
Sensitivity note. When the likelihood does not identify a model's parameters well (e.g., a 4-component mixture where components 2 and 3 nearly overlap), Bayes factors are sensitive to the prior. In the galaxy example (Carlin-Chib 1995), replacing Dirichlet(1,1,1,1.5) with Dirichlet(3,8,3,3) shifts B^12 from 0.57 to 284 — a reversal of the model ranking driven entirely by prior specification.
Lewis and Raftery (1997) apply the Laplace approximation to the marginal likelihood integral using quantities estimated from existing MCMC output — no additional simulation runs required.
Mode θ∗: the multivariate median (L1 center) of the MCMC draws — robust to the occasional distant excursions that MCMC chains exhibit, where the posterior mean and direct maximization can fail.
Variance H∗: the minimum volume ellipsoid weighted variance matrix (Rousseeuw-van Zomeren 1990) — also robust to outliers.
Compound LM estimator (hierarchical/random-effects models): For models with nuisance random effects ai per subject, marginalizing directly over all ai is infeasible. The compound LM uses a nested Laplace approximation (inner Laplace over each ai at its Newton-step conditional mode ai∗, outer LM over the remaining parameters (η,ξ)). For the logistic hierarchical model this is fully closed-form.
Uncertainty via batch means: Divide MCMC output into B batches; compute a separate LM estimate per batch; treat the B estimates as approximately independent to form a 95% interval.
Validation — Iran Fertility Survey (29 women, mixed logistic): compound LM gives logf^≈−220.5 against gold-standard −221.8 (50 million prior draws); 95% credible interval (CI) (−222.0,−219.0) covers the true value.
Practical position: requires no additional MCMC runs (unlike Chib 1995 and Chib-Jeliazkov [CJ] 2001); more stable than the harmonic mean estimator; extendable to hierarchical models (unlike basic Chib). Main limitation: assumes approximate posterior unimodality — fails for multimodal or heavy-tailed posteriors. See Lewis-Raftery (1997).
Alternative Marginal Likelihood (ML) Estimators (Amisano-Federico 2004)
When Ω is high-dimensional, Chib's method requires (q−1) separate Gibbs runs (one per parameter block) and can return numerically unstable results. Two alternatives are:
where f(θ) is a truncated multivariate normal integrating to one over the parameter space (chosen to have thinner tails than the posterior). The estimate is a single pass over the Gibbs output. More numerically stable than Chib but slightly less precise.
where θ~ is the posterior mode and Σ~ the inverse negative Hessian (approximated by the posterior mean and covariance from the Gibbs output). Requires no additional Gibbs runs and agrees closely with Chib for low-dimensional models; precision degrades as the parameter space grows.
Savage-Dickey density ratio: For a nested comparison M0:θ1=θ1,0 vs. unrestricted M:
BF(M0,M)=p(θ1,0∣M)p(θ1,0∣yT,M)
The prior density in the denominator is analytic; the posterior density in the numerator is estimated by Rao-Blackwellization from the Gibbs output. Exact for the nested case and requires no additional simulation.
Practical ranking (Amisano-Federico 2004): Chib ≈ Laplace > Gelfand-Dey for low-dimensional models; all three break down (diverge) when p(θ∗∣yT,M) concentrates in a region the Gibbs sampler visits rarely — which happens for the Kronecker model M3.
Chib-Greenberg (1998): Kernel Density When Normalising Constants Are Unknown
When a full conditional density π(σ∣Z,β) has an intractable normalising constant — as in the multivariate probit where σ lies in the convex set C of valid correlation matrices — the Rao-Blackwell estimator of Chib (1995) is unavailable for that block. Chib and Greenberg (1998) estimate π(σ∗∣y) via kernel density smoothing (eq. 10):
where bj=sjG−1/(p+4) (Scott 1992) and K=ϕ (standard Normal kernel). For p=J(J−1)/2 large (e.g., p=21 for J=7), the ordinate is factored into blocks and each estimated sequentially from reduced runs: π(σ∗∣y)=π1(σ1∗∣y)π2(σ2∗∣y,σ1∗)⋯. The normalising constant of the prior π(σ∗) is found by MC proportion of draws from ϕp(σ∣σ0,G0−1) satisfying positive definiteness.
Limitation. Kernel density estimation is biased in high dimensions and yields numerical standard error (NSE) an order of magnitude larger than Rao-Blackwellisation. This motivated Chib-Jeliazkov (2001), which replaces kernel density with a two-expectation estimator derived from the detailed balance identity of the Metropolis-Hastings (M-H) kernel — applicable whenever M-H is used and requiring no tractable normalising constant.
Chib-Jeliazkov (2001): Extension to M-H Output
Chib and Jeliazkov (2001) resolve the central limitation of Chib (1995) — which fails when any parameter block uses a M-H step because the Rao-Blackwell estimator requires tractable full conditionals. The fix exploits the local reversibility of every M-H subkernel.
Local reversibility identity (eq. 7): for any M-H kernel with proposal q and acceptance probability α,
p(θ,θ∗∣y)π(θ∣y)=π(θ∗∣y)p(θ∗,θ∣y)
Integrating over θ and rearranging gives the CJ estimator for the posterior ordinate at the fixed point θ∗:
π^(θ∗∣y)=E2{α(θ∗,θ∣y)}E1{α(θ,θ∗∣y)q(θ,θ∗∣y)}
E1: expectation over the posterior π(θ∣y) — estimated by averaging α(θ(g),θ∗∣y)q(θ(g),θ∗∣y) over the G draws from the main MCMC run (no extra simulation).
E2: expectation over the proposal q(θ∗,⋅∣y) at fixed θ∗ — estimated by drawing J proposal values θ~(j)∼q(θ∗,⋅∣y) in a short reduced run and averaging α(θ∗,θ~(j)∣y). Cost: J likelihood evaluations.
Log marginal likelihood (eq. 10):
logm^(y)=logf(y∣θ∗)+logπ(θ∗)−logπ^(θ∗∣y)
Multi-block with latent variables (eq. 11–15): For a two-block sampler with latent data z where block 1 uses M-H and block 2 uses Gibbs, the reduced conditional ordinate for block 1 is:
where E1 averages over {(θ1(g),θ2(g),z(g))} from the main run and E2 averages J proposal draws at θ1∗ holding (θ2(g),z(g)) fixed. Placing M-H blocks first avoids M-H steps during the reduced run.
Each ordinate π^(θi∗∣⋅) is computed by Rao-Blackwell if block i is Gibbs, or by the CJ two-expectation formula if block i is M-H. The reduced run for block i conditions on all previously estimated blocks (θ1∗,…,θi−1∗).
NSE and efficiency (§2.4): Collect into the vector process h(g) all simulation quantities entering logm^(y). Estimate var(h^) by Newey-West with m=40 lags. NSE follows from the Delta method: a′var(h^)a. Validated by 50 independent replications. Lower MCMC inefficiency factors translate directly into smaller NSE.
Four empirical examples:
Example
Sampler
logm^
NSE
Binary logit (Mroz 1987, n=200, 8 params)
Tailored M-H
−144.756
~0.03
Binary logit
Random-walk M-H
−144.756
~0.30 (10× larger)
AIDS CD4 longitudinal (467 subjects)
Multi-block Gibbs
−3577.57
small
AIDS CD4 longitudinal
Single-block M-H
−3577.57
larger
Poisson longitudinal (epilepsy, n=58)
CJ
−915.23
≈0.1
Poisson longitudinal
Kernel density
−915.49
≈0.1
Multivariate probit (PSID 520×7, 21 σ params)
One σ-block
−1550.533
0.842
Multivariate probit
Four σ-blocks
−1550.45
0.278
Single likelihood evaluation for the multivariate probit ≈ 2 min at 550 MHz CPU, making Gelfand-Dey / Meng-Wong importance sampling prohibitively expensive.
Comparison to alternatives: Kernel density — biased in high dimensions; NSE order-of-magnitude larger than CJ. Gelfand-Dey / Meng-Wong — too expensive when likelihood evaluation is costly. Reversible-jump — essential when model dimension varies; unnecessary here. CJ is the preferred method for comparing fixed-dimensional models fit by any MCMC scheme.
Han-Carlin (2001): Comparative Benchmark of Six Methods
Han and Carlin (2001) evaluate six MCMC approaches to computing B21=p(y∣M2)/p(y∣M1) on three empirical datasets of increasing scale.
The six methods:
Method
Abbrev
Key idea
Carlin-Chib (1995) product space
CC
Single Gibbs chain over all K model spaces with pseudo-priors; M updated via full conditional (eq. 2)
Metropolized CC
MCC
Replace Gibbs step for M with Metropolis step; draw only from proposed model's pseudo-prior (eq. 4)
Reversible Jump (Green 1995)
RJ
Dimension-matching bijection gj,j′(θj,u) with Jacobian; MH acceptance (eq. 5)
Partial Analytic Structure (Godsill 2001)
PAS
Integrate out analytically tractable subvectors within RJ acceptance ratio (eq. 6)
Chib (1995) Marginal Likelihood Identity (MLI)
Chib
logp(y)=logf(y∣θ~)+logp(θ~)−logp(θ~∣y); posterior density by Rao-Blackwellization (eq. 7)
Chib-Jeliazkov (2001)
CJ
p(θ~∣y)=E1{αq}/E2{α} via two MH expectations; extends Chib to non-Gibbs samplers (eq. 11)
Empirical results:
Radiata pine (n=42, linear regression, Table 2): all six methods give accurate estimates; true B21=4862, estimates 4782–4943. No performance differences at this scale.
AIDS CD4 counts (467 subjects, random-effects model): CC and MCC fail completely — after 1.5 million iterations the chain never mixes across models; RJ: B^21=67.83; Chib and CJ succeed. Failure of CC/MCC is not a tuning problem; it is structural: the high-dimensional random-effect vectors make cross-model proposals essentially impossible under pseudo-priors.
Prostate cancer binary (n=53, logistic regression with latent data): RJ with Albert-Chib latent variable augmentation gives B^21=6.67 [6.61, 6.73].
Practical guidance: Marginal likelihood methods (Chib, CJ) are preferred for standard hierarchical models with fixed parameter dimension. Reversible jump is essential when parameter dimension differs across models. CC/MCC should not be applied to models with many random effects.
Chib MLI for Cointegrated VAR (Warne 2006)
The Chib (1995) identity takes a specific form when applied to the VECM at a fixed rank r. Evaluated at posterior estimates (α~,Ψ~) (typically the posterior mean from the Gibbs sampler):
(i) Log-likelihood.p(Y∣α~,Ψ~,r)=∏tN(Δxt;μ^t,Ω~) evaluated at the Gibbs posterior mean of Ω. Analytic.
(ii) Log prior.logp(α~,Ψ~∣r)=logp(Ψ~)+logp(α~∣Ψ~,r). Both are analytic: p(Ψ~) is the matrix-t Grassmann prior; p(α~∣Ψ~,r) is Gaussian under the Villani/Warne prior.
(iii) Posterior of Ψ.p(Ψ~∣α~,Y,r) is the full conditional from the Gibbs sampler, which is a matrix-t distribution with known parameters. Analytic.
(iv) Posterior of α.p(α~∣Y,r)=∫p(α~∣Ψ,Y,r)p(Ψ∣Y,r)dΨ has no closed form. Estimated by Rao-Blackwellization over Gibbs draws: p^(α~∣Y,r)=G−1∑i=1Gp(α~∣Ψ(i),Y,r), where each p(α~∣Ψ(i),Y,r) is an analytic Gaussian evaluated at the draw Ψ(i).
The full posterior p(r,k∣Y) is then obtained by running the sampler for each (r,k) combination and combining via Bayes' theorem with a (typically uniform) prior over (r,k). The closed-form at full rank (Corollary 1 of Warne 2006) eliminates the need for MCMC when r=n, so MCMC cost is incurred only for r<n candidate ranks.
Why It Matters
MDD is the only model-comparison criterion that is simultaneously consistent, automatic in its complexity penalty, and applicable to non-nested models.
Enables systematic evaluation of whether DSGE-implied restrictions degrade empirical fit (Smets-Wouters 2003; Del Negro-Schorfheide 2004).
The Chib algorithm makes it feasible to compare large numbers of identified VARs with different restriction patterns.
Open Questions
MDD is sensitive to the prior, especially its tails; poorly calibrated hyperparameters can reverse model rankings.
For very large VAR systems, posterior sampling remains computationally demanding even with the Chib algorithm.