From updating to estimating
Bayes' rule for discrete hypotheses (which coin, which die) is familiar from probability. Bayesian estimation applies it to a continuous parameter: put a prior density on the parameter, multiply by the likelihood, and normalise,
The output is a whole distribution over , from which you read a point estimate, an interval and any probability you like ("what is the chance this strategy's edge is positive?"). The objective of this lesson is to compute posteriors in closed form for the standard models, to see why the posterior mean is a shrinkage estimator, and to connect this to regularisation, which is where Bayesian ideas show up most often in quant research.
Why it matters in practice: with noisy data and many units (hundreds of strategies, thousands of stocks, dozens of traders), raw estimates are dominated by noise and the extremes are mostly luck. A prior centred on the population pulls each estimate back towards it, in proportion to how noisy that estimate is.
Conjugate families
A prior is conjugate to a likelihood when the posterior is in the same family, so updating just changes the parameters.
| Model | Prior | Data | Posterior | Posterior mean |
|---|---|---|---|---|
| Binomial() | successes | |||
| Normal mean, known | from draws | below | ||
| Poisson() | (rate ) | counts summing to over periods |
The Beta prior acts like prior successes and prior failures; the Gamma prior acts like events seen over prior periods. For the normal case precisions add:
The posterior mean is shrinkage
Each posterior mean is a weighted average of the data estimate and the prior mean. For the normal case, writing for the sampling variance of ,
The shrinkage factor is the share of the total variance that is noise. Precise data () means and the posterior follows the data; noisy data means and it stays at the prior. For the Beta–Binomial the weight on is : the prior is worth observations. This is the same formula as the best linear predictor of a signal from signal plus noise, and as the empirical-Bayes (James–Stein) estimator when and are estimated from the cross-section.
With enough data the prior washes out: by the Bernstein–von Mises theorem the posterior is approximately for any smooth prior that puts positive density on the truth, so Bayesian and frequentist intervals agree in large samples. The prior matters exactly when the data are weak, which in finance is often.
Worked example
shrinking a manager's alpha
A manager reports 6% average annual alpha over 4 years, with 8% annual tracking error. Across managers, true alphas are roughly . Find the posterior mean and a 95% credible interval for this manager's alpha, and compare with the classical 95% confidence interval.
Show solutionHide solution
The sampling variance of the 4-year average is (in ), so its standard error is 4%. The prior variance is .
Shrinkage factor: . The posterior mean is .
Posterior precision: , so the posterior variance is and the posterior SD is . The 95% credible interval is .
The confidence interval from the data alone is .
The data's precision () is only a quarter of the prior's (), so 80% of the apparent alpha is attributed to luck. The interval is also much narrower, because the prior adds information. Whether that is honest depends on whether the prior is right: if this manager really belongs to a population with wider alphas, a prior over-shrinks.
Worked example
a win rate with a sceptical prior
A strategy wins 30 of 50 trades. You believe win rates near 50% are typical and encode that as a prior. Give the posterior, its mean, mode and SD, a 95% credible interval and . Repeat with a flat prior.
Show solutionHide solution
The posterior is .
- Mean: . The MLE gets weight and the prior mean gets : .
- Mode (MAP): .
- SD: .
- The 95% equal-tailed credible interval (Beta quantiles) is , and .
With the flat prior the posterior is : mean , interval , . The Wald interval is , very close to the flat-prior answer, as Bernstein–von Mises predicts.
The sceptical prior is worth 100 trades, double the data, so it dominates. Being explicit about that is the advantage: the prior is a number you can argue about, rather than an implicit judgement made after looking at the backtest.
Credible intervals versus confidence intervals
- A 95% credible interval satisfies : given this data and this prior, the parameter lies in with probability 95%. This is the statement most people wrongly attach to confidence intervals.
- A 95% confidence interval is a procedure: over repeated samples, 95% of the intervals it produces contain the fixed true . For the one interval you computed, the true value is either in it or not.
They coincide numerically for the normal mean with a flat prior, and approximately in large samples. They differ when the prior is informative, when the sample is small, or near a boundary (a win rate after 0 losses in 10 trades). Credible intervals can be equal-tailed or highest posterior density (the shortest interval with 95% mass); for skewed posteriors these differ.
Which point estimate?
A posterior is a distribution, and the point estimate depends on the loss you care about:
| Loss | Optimal estimate |
|---|---|
| Squared error | posterior mean |
| Absolute error $ | \hat\theta - \theta |
| 0–1 loss (being exactly right) | posterior mode (MAP) |
MAP is attractive computationally (it is just penalised maximum likelihood: maximise , no integral needed) but it has drawbacks. It is not invariant under reparametrisation, since the density of picks up a Jacobian and its mode moves; the posterior median is invariant under monotone maps. And it can sit at a boundary that is unrepresentative: with a flat prior and 0 successes in 5 trials, the MAP of is 0 while the posterior mean of is .
Ridge regression is a Gaussian prior
Take with and prior . The log-posterior is, up to a constant,
so maximising it is minimising with . The solution is the ridge estimator, and because the posterior is Gaussian it is the posterior mean as well as the MAP. The penalty has a meaning: a tight prior (small ) or noisy data (large ) means heavy shrinkage.
A Laplace (double-exponential) prior gives the lasso penalty instead. Here the lasso estimate is the MAP, which can be exactly zero; the posterior mean under a Laplace prior is never exactly zero, so "lasso is Bayesian" is only true in the MAP sense.
Knowledge check
A desk's count of large errors per year is Poisson() with prior (rate parametrisation, prior mean 2). Over three years you observe 1, 0 and 2 errors. What is the posterior mean of ?
Knowledge check
In a regression with noise SD you put an independent prior on each coefficient. Which ridge penalty in gives the posterior mean?
Knowledge check
A colleague reports a 95% confidence interval of [0.2%, 1.4%] for a strategy's mean daily return and says: there is a 95% chance the true mean is in this range. Which statement is correct?
Key takeaways
- Posterior likelihood prior. Conjugate updates: Beta , Gamma , Normal with precisions adding.
- The posterior mean is a precision-weighted average of the data and the prior; the shrinkage factor is noise variance over total variance. The prior is worth a known number of observations.
- Credible intervals are probability statements about ; confidence intervals are statements about the procedure. They agree in large samples (Bernstein–von Mises).
- Posterior mean for squared loss, median for absolute loss, MAP for 0–1 loss; MAP is penalised MLE and not invariant to reparametrisation.
- Ridge is the posterior mean under a Gaussian prior with ; lasso is the MAP under a Laplace prior.
Practice problems
Finished reading?
Answer the 3 knowledge checks to complete this lesson (0 done).