Skip to main content

Probability and statistics · 13 min read

Bayesian updating

How belief should change as evidence arrives: Bayes' rule, why most good-looking backtests are false, and how many trades it takes to trust a small edge.

Before you start

  • Conditional expectation (this track)
  • Basic Python (NumPy arrays)

By the end you'll be able to

  • Apply Bayes' rule and explain why base rates dominate when effects are rare
  • Update a Beta prior on a hit rate with wins and losses
  • Explain shrinkage and why it improves estimates from small samples
  • Compute a posterior on a grid for any prior, with only NumPy

A new strategy has won 110 of its first 200 trades. Does it have an edge, or was it lucky? A confidence interval answers a slightly different question from the one you're asking. Bayes' rule answers yours directly: given these results, how likely is it that the hit rate is above 50%? This lesson shows how belief should change as evidence arrives, and why a sensible prior protects you from the backtests that look too good.

SymbolMeaning
ppThe strategy's true hit rate (unknown)
kk, nnWins, and total trades, observed so far
P(A∣B)\mathbb{P}(A \mid B)The probability of AA given BB
Beta⁡(a,b)\operatorname{Beta}(a, b)A distribution on [0,1][0, 1], used for beliefs about pp
prior, posteriorBelief before, and after, seeing the data

The rest of this lesson needs lifetime access

It will be part of lifetime access, which is coming soon: every lesson in all four tracks, including lessons added later, for one payment.

See pricing

Already have access? Sign in