TL;DR
Bayesian model averaging (BMA) makes a prediction by asking several candidate models at once and mixing their answers. Each model gets a weight equal to its posterior probability, which combines how well it explained the data with how plausible it was before the data arrived. Models that explain the data poorly fade out smoothly instead of being discarded by a hard choice.
Picking one best model throws away the uncertainty about which model is right. BMA keeps that uncertainty and carries it into the prediction, so the answer is usually less overconfident.
Where you'll see it: in model selection for regression and forecasting, in ensembles whose members are weighted by their evidence, and in Bayesian variable selection.
Intuition
Do not bet on one model
Suppose three doctors look at the same patient and offer three diagnoses: a virus, a bacterial infection, an allergy. Picking one doctor at random ignores the disagreement. Trusting the most famous doctor ignores it too, and the cost is high if that doctor is wrong. A better approach is to weigh each diagnosis by how much its reasoning holds up, and act on the weighted combination.
BMA does this for statistical models. A "model" here is a full recipe: a family of probability distributions plus a prior over its parameters, such as "a straight line with Gaussian noise" or "a quadratic with Gaussian noise". Data arrives, each recipe is scored by how well it accounted for that data, and the prediction for something new is the average over recipes, weighted by those scores.
The score is the evidence, not the fit
The score that matters is not the best fit to the data. A flexible model can always fit the observed points more closely, but a closer fit does not make it a better explanation. The score BMA uses is the probability the model assigned to the observed data, averaged over every parameter value the model allows. A model that spreads its bets over many possibilities pays for the ones the data does not support. This is a built-in Occam's razor: flexibility that the data does not use is penalised.
- posterior over p under M2
The math
Where the sum comes from
Start from the law of total probability over the models. Assume exactly one of the candidates is the true one, so the events "model is true" split all possibilities between them, and
The second step is the product rule applied to each term: the probability of and together is the probability of times the probability of given , with held on the right of every bar. The factor is simply what model alone would predict after seeing the data, for example by averaging its likelihood over its own posterior for .
Posterior model probabilities
The weights are a Bayes' rule update where the hypothesis is the model:
Here is the prior probability of model , often the same for every model. is the evidence (also called the marginal likelihood) for model . The denominator is the same for every , so it only normalises the weights to sum to 1.
The evidence
The evidence averages the likelihood over the model's own parameters :
This is where the Occam effect lives. The integrand is large only where the parameters both fit the data and are plausible under the prior. A flexible model has a prior spread over a large region, so most of its prior mass sits where the data is unlikely.
Working in logs
Evidence values are often tiny, so they underflow if multiplied directly. Let and . Then
Subtracting the largest log value leaves the weights unchanged but keeps every exponent at zero or below.
The BIC approximation
When the integral has no closed form, a common shortcut is the Bayesian information criterion. With the maximum likelihood estimate, the number of free parameters in model , and the number of observations,
This comes from a Laplace approximation (replacing the integrand by a Gaussian bump centred on its peak), and it becomes accurate as grows. With equal model priors, the weights are then proportional to .
Worked examples
Model : the coin is fair, so . Model : is unknown, with a uniform prior on . Both models have prior probability . The data is one specific sequence of ten flips with seven heads.
- Evidence under . There are no parameters to integrate over, so .
- Evidence under . With a uniform prior (density 1), . This integral is the Beta function , which equals . The same integrand, divided by , is the Beta(8,4) posterior over used in step 5.
- Bayes factor. , so the data mildly favours the fair coin. The flexible model spreads its prior over every value of , and most of those values are a poor match for seven heads.
- Posterior weights. , and .
- Prediction that the next flip is heads. Under it is . Under the posterior for is Beta(8,4), with mean . The mixture gives .
Interpretation: the best single model says , and the flexible model's posterior mean says . BMA answers . That is a hedged number, and it reflects the fact that the data cannot yet tell the two models apart.
Three models predict a sales figure: is linear, is quadratic, is cubic. Equal prior on each. Suppose their log evidences, computed by integration or by BIC, are , , and .
- Subtract the largest value, . The shifted values are , , .
- Exponentiate. We get , , and .
- Normalise. The sum is , so the weights are , , .
- Predictions for the new input are , , . The BMA prediction is .
Interpretation: the quadratic dominates, but the linear model still pulls the answer down from to , because it has real weight. The cubic is effectively switched off. Its log evidence is nats lower than the quadratic's, which means about times less evidence, so its prediction barely counts.
Tradeoffs and failure modes
BMA is principled, but it only answers the question you asked. It is also not the same as ensembling by Bagging, which trains members on resampled data and averages them with equal weight. BMA's weights come from a probability argument about the models, and the members usually see the same data.
| Situation | What goes wrong | Better choice |
|---|---|---|
| The true model is not in the candidate set | The weights only compare the models you wrote down, so the average can be confidently wrong | Add more candidates, and treat the weights as relative, not absolute |
| Parameter priors are diffuse or chosen casually | Evidence depends heavily on the prior, so a model can lose weight just because its prior is wide | Use weakly informative priors and check how the weights change |
| The integral has no closed form | Exact evidence is expensive or impossible | BIC or Laplace approximations, Importance Sampling, or bridge sampling with Markov Chain Monte Carlo |
| Many models with negligible weights | Compute is spent on members that add nothing | Keep only the top models, or drop those far below the best (Occam's window) |
| Predictive accuracy is the real goal | Evidence measures how well the prior predicted the data, which can disagree with held-out accuracy | Compare models with cross-validation and weight them by their held-out performance |
History
Harold Jeffreys set out Bayes factors for comparing hypotheses in his 1939 book Theory of Probability. In 1978 Edward Leamer's book on specification searches in econometrics argued that ignoring model uncertainty leads to conclusions that are too confident. Through the 1990s Adrian Raftery and colleagues made averaging practical, promoting BIC-based approximations and Occam's window to drop implausible models. Computing the sums and integrals for larger models became feasible as sampling methods improved. The 1999 tutorial by Hoeting, Madigan, Raftery and Volinsky gathered the method and its practical issues, and it became the standard reference. The idea caught on because it turned an argument about which model to trust into a calculation that reports how much trust is warranted.
Check yourself
QuestionWhat is the difference between choosing the single best model and Bayesian model averaging?Show answer
Choosing the best model predicts with one model and discards the others, along with the uncertainty about which one is right. Bayesian model averaging gives every candidate a weight equal to its posterior probability , and the prediction is the weighted average of all their predictions. When one model dominates, BMA is close to the best-model choice. When several fit about equally well, BMA spreads the answer across them and reports the disagreement through the mixture.
QuestionTwo models have evidence and , with equal prior probability. Model A predicts for a new input and model B predicts . What is the BMA prediction?Show answer
The posterior weights are and . The BMA prediction is . Model B dominates because it explains the data four times better, but the answer is pulled towards A, not set to .
QuestionWhy does the evidence penalise a model that could fit the data more closely?Show answer
The evidence averages the likelihood over the model's prior on its parameters. A more flexible model spreads its prior over many parameter values, and most of them do not explain the observed data well. Its average likelihood can therefore be lower than a simpler model's, even when its best single fit is higher. Flexibility the data does not need costs probability, which is the Occam effect built into the calculation.
QuestionYou fit a model with 20 parameters and a model with 2 parameters to points. Their maximised log likelihoods are and . Which model does BIC prefer, and how much weight does it get under equal model priors?Show answer
BIC is . For the 20-parameter model, . For the 2-parameter model, . The lower BIC wins, so the 2-parameter model is preferred. The difference is , and the weights are proportional to , so the ratio is in favour of the simpler model. Its weight is effectively , and the 20-parameter model contributes nothing to the average.