Skip to content
Learn
Sign up

Quantitative Methods & RiskProbability & Distributions for Traders

Random Variables, Returns & Expectation

13 min read

A price move is a draw from a distribution

Before you can manage risk you have to model uncertainty, and the language for that is probability. A trader treats tomorrow's return not as a number to be predicted but as a random variable — a quantity that takes different values with different probabilities. You will never know which value you get. What you can know, and what the rest of this course is built on, is the shape of the distribution those values are drawn from: where it is centred, how wide it is, and how heavy its tails are.

Random variable

Term

A quantity whose value is determined by the outcome of a random process. Tomorrow's EUR/USD return is a random variable: it has a range of possible values, each with some probability, and you observe exactly one realization per day.

Return (and why log returns)

Term

A simple return is (P_t − P_{t-1}) / P_{t-1}. A log return is ln(P_t / P_{t-1}). Log returns are preferred in quant work because they are additive across time — the log return over a week is the sum of the daily log returns — and they are roughly symmetric, which matters for the statistics that follow.

Formula

Expected value (the mean of a distribution)

E[X] = Σ pᵢ · xᵢ      (discrete)      E[X] = ∫ x · f(x) dx   (continuous)
Heads up

The mean is not the mode is not the median

For a symmetric distribution these three coincide. For the skewed, fat-tailed distributions that real returns follow, they diverge — and confusing them is how people talk themselves into bad bets. 'I win most days' (high median, positive mode) is fully compatible with 'I lose money on average' (negative mean) if the rare losing days are large enough.

Formula

Variance and standard deviation (dispersion)

Var(X) = E[(X − μ)²] = E[X²] − μ²        σ = √Var(X)

Independence, and why it is usually a lie

Two events are independent if knowing one tells you nothing about the other. Almost every clean formula in statistics assumes the observations are independent and identically distributed — i.i.d. Returns are emphatically not i.i.d.: volatility clusters (a big move today makes a big move tomorrow more likely), and correlations spike toward 1 exactly when you least want them to, in a crash. Hold on to this. Most of the ways risk models fail trace back to an i.i.d. assumption that the market quietly violated.

i.i.d.

Term

Independent and identically distributed. Each observation is drawn from the same distribution and is statistically independent of the others. It is the assumption behind the square-root-of-time scaling, the central limit theorem, and most VaR formulas — and it is routinely false for financial returns.

expectation_and_variance.py
python
1import numpy as np
2
3rets = np.array([0.02, -0.01, 0.01, -0.02, 0.0])
4
5mu = rets.mean() # sample estimate of E[X]
6var = rets.var(ddof=1) # ddof=1 -> unbiased (divide by n-1)
7sd = rets.std(ddof=1)
8
9print(f"mean = {mu:.4%}") # 0.0000%
10print(f"stdev = {sd:.4%}") # 1.5811% (n-1 denominator)
11# Note: var() with ddof=0 divides by n and is biased low for small n.
ddof=1 uses the n−1 (Bessel-corrected) denominator. For small samples the difference between dividing by n and n−1 is large — and small samples are exactly where traders get fooled.
Note

What expectation buys you

Everything downstream is a function of the mean and the shape around it. Expectancy (Module 2) is E[P&L per trade]. Volatility (Module 3) is √Var of returns. VaR is a quantile of the loss distribution. Kelly sizing (Module 4) maximizes E[log(wealth)]. Master expectation and variance here and the rest is bookkeeping.

Knowledge check

A strategy wins $100 on 90% of trades and loses $1,500 on the other 10%. What is its expected value per trade?