Free lesson · Statistics
Conditional probability: update a belief with evidence
Open interactive lessonPractice calculationsExplore labs
Start with the idea
A forecast changes when new evidence arrives. Begin with counts: among all cases showing the evidence, what fraction belong to the event you care about?
Symbols, units & horizon
- S: stressed state
- C: calm state, the only alternative in this example
- E: observed large-move indicator
- P: probability between 0 and 1
- vertical bar: given or conditional on
- P(S): prior stress probability
- P(E|S): evidence likelihood under stress
- P(S|E): posterior stress probability
- all quantities: dimensionless probabilities for the stated daily event
When and why to use this
Use conditional probabilities for regime probabilities, event forecasts and signal calibration before turning a probability into a cost-sensitive action.
A prior is a probability before the new observation. A likelihood describes how often that observation occurs under a proposed state. A posterior is the probability after combining the two. A high likelihood is not automatically a high posterior: the event’s base rate also matters.
Use a two-state example. Of 1,000 imagined comparable days, 100 are stressed and 900 calm. A large-move indicator occurs on 80 stressed days and 180 calm days. Observing it leaves 260 candidate days, of which only 80 are stressed. This counting argument leads directly to Bayes’ rule.
In a trading model the states and likelihoods are estimates, not known facts. Learn them from data available before the forecast. Later, a hidden Markov model will predict the prior from yesterday’s state distribution and then perform this same evidence update.
Calibration asks whether cases assigned a probability near 30% realize the event roughly 30% of the time across a suitable held-out sample. A 70% forecast is not a 70% confidence interval and does not guarantee profit. Group related events together when estimating calibration uncertainty; many contracts on one event are not independent evidence.
Conditional probability: update a belief with evidence
- The joint probability of stress and evidence is P(E|S)P(S). Here it is .8×.1=.08.
- The evidence may also occur in calm conditions, with probability .2×.9=.18. Add the mutually exclusive routes to obtain P(E)=.26.
- Divide the joint stress-and-evidence probability by the total evidence probability: .08/.26=4/13. This is the conditional fraction.
Prior stress=.1; indicator likelihood=.8 under stress and .2 under calm. Posterior stress=.307692, about 30.8%, not 80%. The new observation raises the estimate but leaves substantial uncertainty.
Apply it in a strategy
- Define an event with an observable resolution rule and horizon.
- Estimate priors and likelihoods only from training data.
- Check held-out calibration and stability across base-rate changes before sizing positions.
Research deliverable
Create a two-by-two count table and recover its posterior both by counting and by Bayes’ rule.
Sources & evidence · reviewed 12 September 2026
The following event-contract lesson records the supplied 2026 prediction-market working paper. Treat calibration as an empirical question, and keep conditional-probability identities separate from claims about trading performance.
Further reading: Probability and prediction-market evidence ↗
Python implementation
Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.
from math import isfinite
def posterior_stress(prior, evidence_stress, evidence_calm):
if not all(isfinite(x) and 0<=x<=1 for x in [prior,evidence_stress,evidence_calm]):
raise ValueError("Probabilities must lie in [0,1]")
numerator=prior*evidence_stress
total=numerator+(1-prior)*evidence_calm
if total==0: raise ValueError("Evidence is impossible under the model")
return numerator/total
print(posterior_stress(.1,.8,.2))Continue learning
Statistics & Probability — all lessons- Start with counts, probabilities and averages
- Random outcomes, sample averages and the limits of the bell curve
- Conditional probability: update a belief with evidence
- Prediction markets: probability, price and net expected value
- Expected value: measure the payoff before choosing the risk
- Correlation: how many strategies do you really have?
- Conditional probability and Bayes: where the edge actually lives
- The central limit theorem: sampling means under explicit assumptions
- Estimation uncertainty and Bayesian updating
Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations