Hierarchical Bayesian Model Averaging

Statistics
Introduced by
Extension formalised by Hoeting, Madigan, Raftery, and Volinsky; hierarchical application developed through 1990s–2000s Bayesian literature
Year
1999–2000s
Type
Bayesian model averaging within hierarchical models
Family
Bayesian / computational

What does it do?

Hierarchical Bayesian model averaging (HBMA) applies Bayesian model averaging to a set of candidate hierarchical models.

Each candidate is weighted by its posterior model probability, and the quantities of interest are averaged across candidates. The result therefore reflects uncertainty about which model structure is correct as well as uncertainty within each model.

The intuition behind the method

When the data have a grouped structure and it is unclear which hierarchical specification fits best, HBMA avoids betting on a single one. Each candidate model acts like a member of a committee, and its answer counts in proportion to how well it explains the observed data. Models that fit poorly receive little weight, and models that fit well receive more. The averaged answer carries the spread between candidates, so model-selection uncertainty is included in the final predictions and intervals rather than ignored.

History

Bayesian model averaging was systematised in the 1999 Statistical Science tutorial by Hoeting, Madigan, Raftery, and Volinsky. That tutorial addresses model averaging in general rather than hierarchical models specifically. The extension to multilevel structures is best understood as the combination of standard Bayesian model averaging with hierarchical models, and no single originator of that combination is identified here. Fragoso, Bertoli, and Louzada (2018) reviewed 820 BMA articles published between 1996 and 2016 and proposed a conceptual classification of that literature.

When to use it

Choose HBMA when the data have a grouped or multilevel structure, when several plausible hierarchical specifications exist (for example, different covariate sets or random-effects structures), and when the quantity of interest depends on which specification is correct. Partial pooling is useful when some groups have few observations, and averaging avoids basing predictions on a single specification selected from the same data. Do not use HBMA when the model space is too large to enumerate or sample reliably, when marginal likelihoods cannot be computed or approximated with defensible accuracy, or when the data have no meaningful grouping, in which case a non-hierarchical model average is simpler.

Limitations and considerations

  • Marginal likelihoods are often analytically intractable and must be approximated (for example with BIC, a Laplace approximation, or bridge sampling), and the approximation error propagates into the model weights.
  • The number of candidate models grows quickly with the number of covariates and random-effect options; exhaustive averaging over large model spaces requires strategies such as MC3 or stochastic search.
  • Results depend on the prior over models. Vague or poorly justified model priors can shift weight toward overly complex candidates.
  • Averaged coefficients are hard to interpret when a variable appears in some candidate models but not others, so inclusion probabilities should be reported alongside them.
  • Key assumptions: the candidate set contains a reasonable approximating model, because posterior weight cannot move to a structure that was never specified; the model priors and within-model priors are justified and are varied in a sensitivity analysis; the marginal likelihood approximations are accurate enough for the sample size; and exchangeability holds within each grouping structure, so that partial pooling is appropriate.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Posterior model probabilities are propagated into the averaged quantity, so predictions and intervals include disagreement between candidate hierarchical structures rather than reflecting one chosen model.
  • Marginal likelihoods integrate over all parameters, so model complexity is penalised within the calculation itself.
  • Inclusion probabilities summarise how much of the posterior model weight supports each variable, which is informative when candidate models differ in their covariates.
  • Group-level parameters share information across groups through the hierarchical component, which helps where some groups are sparsely observed.
  • The prior over models is explicit, so the analyst's assumptions about model plausibility are stated and can be varied in a sensitivity analysis.

Applications

  • Multilevel comparisons of student outcomes across schools, where it is uncertain whether school-level covariates or random slopes should be included and the target is a school-level prediction.
  • Clustered clinical data in which both the covariate set and the random-effects structure are uncertain and a patient-level risk prediction informs a decision.
  • Ecological abundance models across sites where competing spatial or temporal random-effect structures are plausible and site-level data are sparse.
  • Forecasting with several multilevel structural models that differ in their included variables, reported as a model-averaged predictive distribution.

How it works

How it works

1

Assign a prior probability to each candidate model. These priors encode how plausible each model structure is before seeing the data. In a hierarchical setting, candidates may differ in their grouping structure, their covariates, or their random-effects specification.

Formula
p(M_k) \text{ for } k = 1, \ldots, K
2

For each candidate, compute the marginal likelihood: the probability of the observed data after integrating over all parameters of that model, including the group-level parameters. Because the integral averages over the parameter space, models that spread their prior mass over many unsupported parameter values are penalised without a separate penalty term.

Formula
p(y \mid M_k) = \int p(y \mid \theta_k, M_k)\, p(\theta_k \mid M_k)\, d\theta_k
3

Apply Bayes' rule at the model level by multiplying each marginal likelihood by its model prior and normalising across all candidates. The resulting posterior model probabilities sum to one. Models with high marginal likelihoods and reasonable priors receive the largest weights.

Formula
p(M_k \mid y) = \frac{p(y \mid M_k)\, p(M_k)}{\sum_{j=1}^{K} p(y \mid M_j)\, p(M_j)}
4

Compute the quantity of interest, such as a predicted value, a regression coefficient, or a variance component, within each candidate model. Then take the average across models, weighting each by its posterior model probability. The averaged quantity reflects both parameter uncertainty within models and disagreement between models.

Formula
p(\Delta \mid y) = \sum_{k=1}^{K} p(\Delta \mid y, M_k)\, p(M_k \mid y)
5

Within each candidate, group-level parameters are typically given a population-level distribution governed by hyperparameters, so groups with few observations borrow information from the other groups. The usual working assumption is exchangeability: before seeing the data, the groups within a given grouping structure are treated as draws from a common population, so no group is distinguished a priori from another. The hyperparameters receive their own priors, and these are part of each candidate's specification and therefore of its marginal likelihood. Candidates may differ in which grouping or random-effect terms they include, and the averaging is applied to these whole hierarchical models rather than only to the fixed-effects part.

Common pitfalls

  • Reading posterior model probabilities as absolute evidence for a model. They are relative weights within the specified candidate set.
  • Reporting averaged coefficient estimates without the variable inclusion probabilities that show how consistently each variable is supported.
  • Using BIC-based approximations to marginal likelihoods without checking them when the sample size is small or the model is strongly nonlinear.
  • Specifying a candidate set that omits the data-generating structure. Averaging then concentrates weight on the best of the wrong models, and the averaged results can be biased.
  • Treating HBMA as model selection. It keeps all candidates and averages over them rather than choosing the highest-weighted one.

Frequently asked questions

How is HBMA different from just picking the best hierarchical model by BIC?

BIC-based selection picks one model and discards the others, ignoring uncertainty about whether that model is correct. HBMA keeps all candidate models weighted by their posterior probability, so predictions reflect both parameter uncertainty within each model and uncertainty about which model is right. When several models are similarly supported, averaging can widen credible intervals compared with selection.

What is a variable's inclusion probability in HBMA?

The inclusion probability of a variable is the sum of posterior model probabilities over the candidate models that contain it. Reporting it alongside averaged coefficients shows how consistently the candidate set supports the variable. There is no fixed convention for what counts as strong support, so the value should be read relative to the candidate set and the prior over models.

Can I use HBMA with MCMC if marginal likelihoods are intractable?

Yes. Markov chain Monte Carlo model composition (MC3) or reversible-jump MCMC allows the sampler to move between models as well as between parameter values. The proportion of MCMC iterations spent in each model estimates its posterior probability. This avoids explicit marginal likelihood computation but requires care in designing the between-model moves.

How large can the candidate model set be?

With p predictors, the full set of models that include or exclude each predictor has 2^p members, so exhaustive enumeration becomes impractical quickly as predictors are added. Stochastic search, MC3, or candidate sets built from domain theory are the usual remedies. The hierarchical component adds further candidates if random-effects structures are also averaged over.

When do all model weights concentrate on one model?

When the sample is large, the marginal likelihoods become highly discriminating and the posterior probability of the best candidate can approach one, so HBMA behaves much like ordinary model selection. In this regime averaging adds little, but the procedure remains valid.

Related methods

Sources

  1. Hoeting, J. A., Madigan, D., Raftery, A. E., & Volinsky, C. T. (1999). Bayesian model averaging: A tutorial. Statistical Science, 14(4), 382–417.

    Open publication reference
  2. Fragoso, T. M., Bertoli, W., & Louzada, F. (2018). Bayesian model averaging: A systematic review and conceptual classification. International Statistical Review, 86(1), 1–28.

    Open DOI reference