QUANT MATH EXPLAINED

math_with_quant

Quant Math Explained: A Step-by-Step Guide to the Mathematics of Quantitative Finance

From probability and statistics to Brownian motion, Itô's Lemma, and the Black–Scholes equation — built up one step at a time.

Quantitative finance ("quant math") sits at the intersection of probability theory, calculus, linear algebra, and stochastic processes. Rather than throwing every formula at you at once, this post builds the ideas up layer by layer, the way a quant researcher would actually learn them — starting from basic statistics and ending at the Black–Scholes option pricing equation.

1. Foundations — Probability & Statistics

Step 1.1 — Random variables
A random variable X represents an uncertain quantity — a stock return, a price change, a payoff. In quant finance we almost always work with its distribution rather than a single guessed value.
Step 1.2 — Mean and variance
The expected value (mean) measures the "center" of outcomes, and variance measures how spread out they are.
\( \mu = E[X] = \sum_i p_i x_i \qquad\qquad \sigma^2 = E[(X-\mu)^2] \)

In finance, μ is the expected return and σ (the square root of variance) is volatility — the single most important risk number in quant math.

Step 1.3 — Covariance and correlation
When you hold more than one asset, you need to know how they move together.
\( \text{Cov}(X,Y) = E[(X-\mu_X)(Y-\mu_Y)] \qquad \rho_{X,Y} = \frac{\text{Cov}(X,Y)}{\sigma_X \sigma_Y} \)

Correlation (ρ, between −1 and 1) is what makes diversification work: combining assets that are not perfectly correlated reduces portfolio risk without necessarily reducing expected return.

Step 1.4 — The normal distribution
Many quant models assume returns (or log-returns) are approximately normally distributed, which is convenient because the normal distribution is fully described by just μ and σ.
\( f(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{-\frac{(x-\mu)^2}{2\sigma^2}} \)
Caveat: real market returns have "fat tails" — extreme moves happen more often than a normal distribution predicts. This is why models built purely on normality (like early VaR models) can underestimate crash risk.

2. Linear Algebra for Portfolios

Step 2.1 — Representing a portfolio as vectors
A portfolio of n assets is a weight vector w = (w₁, w₂, ..., wₙ), where each wᵢ is the fraction of capital in asset i.
Step 2.2 — The covariance matrix
Instead of tracking pairwise covariances one at a time, quants store them in an n × n covariance matrix Σ, where entry (i,j) is Cov(rᵢ, rⱼ).
Step 2.3 — Portfolio return and risk in matrix form
\( E[R_p] = w^T \mu \qquad\qquad \sigma_p^2 = w^T \Sigma w \)

This compact notation is what lets optimization software scale to portfolios with hundreds of assets — it's just matrix multiplication.

3. Calculus Refresher

Step 3.1 — Derivatives as sensitivity
In finance, a derivative (the calculus kind) measures how sensitive a price is to a small change in an input — this is exactly what option "Greeks" like Delta and Gamma are.
\( \Delta = \frac{\partial V}{\partial S} \qquad \Gamma = \frac{\partial^2 V}{\partial S^2} \)
Step 3.2 — Taylor expansion
A Taylor series approximates a function using its derivatives at a point. This is the mathematical seed that Itô's Lemma (Step 6) grows out of.
\( f(x+dx) \approx f(x) + f'(x)\,dx + \tfrac{1}{2}f''(x)\,dx^2 + \dots \)

4. Stochastic Processes & Random Walks

Step 4.1 — What is a stochastic process?
A stochastic process is a sequence of random variables indexed by time — essentially, a random variable that evolves. Stock prices are modeled as stochastic processes because their future value is uncertain.
Step 4.2 — The random walk
The simplest building block: at each time step, the price moves up or down by a small random amount.
\( X_{t+1} = X_t + \varepsilon_t, \qquad \varepsilon_t \sim N(0, \sigma^2) \)

Stitch together infinitely many, infinitely small steps like this, and you arrive at continuous-time Brownian motion.

5. Brownian Motion

Step 5.1 — Definition
A process Wₜ is standard Brownian motion (a Wiener process) if:
\( W_0 = 0, \quad W_t - W_s \sim N(0, t-s), \quad \text{increments are independent} \)
Step 5.2 — Geometric Brownian Motion (GBM)
Stock prices can't go negative, so instead of modeling the price directly with Brownian motion, quants model the log of the price. This gives the standard stock price model:
\( dS_t = \mu S_t\,dt + \sigma S_t\,dW_t \)

Here μ is the drift (expected return) and σ is volatility. This single equation is the starting point for almost all classical option-pricing theory.

6. Itô's Lemma

Step 6.1 — Why ordinary calculus breaks down
Because Brownian motion is nowhere differentiable, you can't apply the normal chain rule to a function of Wₜ. Itô's Lemma is the "chain rule" adapted for stochastic processes — it keeps a second-order term that ordinary calculus would drop.
Step 6.2 — The lemma
For a function f(t, Sₜ) where Sₜ follows the GBM above:
\( df = \left( \frac{\partial f}{\partial t} + \mu S \frac{\partial f}{\partial S} + \tfrac{1}{2}\sigma^2 S^2 \frac{\partial^2 f}{\partial S^2} \right) dt \; + \; \sigma S \frac{\partial f}{\partial S}\, dW_t \)
The extra term, ½σ²S²·∂²f/∂S², exists because (dWₜ)² = dt — a quirk of Brownian motion that has no equivalent in ordinary calculus. This single term is what makes Itô's Lemma the engine behind derivative pricing.

7. Deriving the Black–Scholes Equation

Step 7.1 — Set up a hedged portfolio
Construct a portfolio Π that is long one option V(S,t) and short Δ = ∂V/∂S shares of the underlying stock. This "delta hedge" is chosen specifically to cancel out the random term.
\( \Pi = V - \frac{\partial V}{\partial S} S \)
Step 7.2 — Apply Itô's Lemma to the option value
Expand dV using Itô's Lemma from Step 6, then compute . The stochastic (dWₜ) terms cancel exactly because of the hedge ratio chosen above — the portfolio becomes momentarily riskless.
Step 7.3 — No-arbitrage condition
A riskless portfolio must earn exactly the risk-free rate r, otherwise arbitrage would be possible.
\( d\Pi = r\,\Pi\, dt \)
Step 7.4 — The Black–Scholes PDE
Combining the last three steps and simplifying yields the famous partial differential equation:
\( \frac{\partial V}{\partial t} + \tfrac{1}{2}\sigma^2 S^2 \frac{\partial^2 V}{\partial S^2} + rS\frac{\partial V}{\partial S} - rV = 0 \)
Step 7.5 — Solving for a European call option
Solving this PDE with the payoff condition V(S,T) = max(S−K, 0) gives the closed-form Black–Scholes formula:
\( C = S_0 N(d_1) - K e^{-rT} N(d_2) \)

\( d_1 = \frac{\ln(S_0/K) + (r + \sigma^2/2)T}{\sigma\sqrt{T}}, \qquad d_2 = d_1 - \sigma\sqrt{T} \)

Here N(·) is the cumulative normal distribution, K is the strike price, and T is time to expiry. Every step above — probability, matrix notation, Taylor series, Brownian motion, Itô's Lemma — feeds directly into this one formula.

8. Risk Measures — Volatility, VaR, Sharpe Ratio

Step 8.1 — Value at Risk (VaR)
VaR answers: "What's the most I could lose over a given period, at a given confidence level?" For normally distributed returns:
\( \text{VaR}_{\alpha} = \mu - z_\alpha \sigma \)

where z_α is the z-score for confidence level α (e.g., 1.65 for 95%).

Step 8.2 — Sharpe ratio
Measures risk-adjusted return — how much excess return you earn per unit of volatility.
\( \text{Sharpe} = \frac{E[R_p] - R_f}{\sigma_p} \)
MetricWhat it tells you
Volatility (σ)Dispersion of returns; basic risk measure
VaRWorst expected loss at a confidence level
Sharpe RatioReturn earned per unit of risk taken
BetaSensitivity of an asset to overall market moves

9. Portfolio Optimization (Markowitz Mean-Variance)

Step 9.1 — The optimization problem
Harry Markowitz's insight: for a target expected return, find the portfolio weights that minimize variance.
\( \min_w \; w^T \Sigma w \quad \text{subject to} \quad w^T \mu = R_{\text{target}}, \;\; \sum_i w_i = 1 \)
Step 9.2 — The efficient frontier
Solving this for a range of target returns traces out the "efficient frontier" — the set of portfolios offering the highest possible return for each level of risk. Every well-diversified portfolio should sit on (or near) this curve.

10. Putting It All Together

Notice the chain: probability and statistics gave us the language of uncertainty (Step 1). Linear algebra let that language scale to many assets at once (Step 2). Calculus gave us sensitivity and approximation tools (Step 3). Stochastic processes and Brownian motion modeled how prices actually move through time (Steps 4–5). Itô's Lemma adapted calculus to that randomness (Step 6), which is exactly what was needed to derive the Black–Scholes equation (Step 7). Finally, risk measures and portfolio optimization (Steps 8–9) turn all of this theory into decisions about what to actually buy and hold.

Where to go next: stochastic calculus (Itô integrals, martingales), numerical methods (Monte Carlo simulation, finite differences), time-series econometrics (ARIMA, GARCH for volatility forecasting), and optimization theory (convex optimization, quadratic programming solvers) are the natural follow-on topics once these foundations are solid.

Post a Comment

0 Comments