Reference sheet

Financial Engineering for Quants reference sheet

The main definitions, pricing formulas, models and conventions of the financial engineering course on one page, unit by unit, with links to the lessons that explain each topic in full.

This sheet follows the fourteen units of the course in order. Each unit starts with the big idea in a few sentences, then gives the definitions, formulas, models and theorems you will look up most often, each with the assumptions it needs. When you want the full explanation, a derivation or more examples, follow the lesson links under each topic. The numerical examples use small constructed inputs, not market data, chosen so that every number can be checked by hand or with a few lines of code.

Time is measured in years. The current date is tt, a maturity is TT and the time remaining is τ=T−t\tau = T - t. The asset price StS_t is ex-dividend, KK is a strike, rr an interest rate, qq a continuous dividend yield and σ\sigma an annualized volatility. Rates are continuously compounded unless a topic states another compounding convention, and one basis point is 1 bp=0.00011\,\text{bp} = 0.0001. The money-market account BtB_t is a positive numeraire, D(t,T)D(t,T) is a deterministic discount factor, and P(t,T)P(t,T) is the time tt price of a zero-coupon bond paying 1 at TT, which is random once interest rates are random. Prices, cash flows and profit and loss (PnL) are in currency units and are written as plain numbers.

The physical measure P\mathbb{P} describes how prices actually move and is the one used for forecasts and risk. A pricing measure Q\mathbb{Q} is equivalent to P\mathbb{P}, makes discounted traded prices martingales and need not be unique, and QT\mathbb{Q}^{T} is the TT-forward measure, whose numeraire is the bond maturing at TT. Expectations name the measure and the information they condition on, as in EQ[X∣Ft]\mathbb{E}^{\mathbb{Q}}[X \mid \mathcal{F}_t], and a Brownian motion under Q\mathbb{Q} is written WtQW^{\mathbb{Q}}_t. The functions Φ\Phi and φ\varphi are the standard normal distribution function and density, (x)+=max⁡(x,0)(x)^{+} = \max(x, 0) is the positive part and 1A\mathbf{1}_{A} is the indicator of an event AA. Vectors are plain letters with transpose ⊤^{\top}, 1\mathbf{1} is also the vector of ones, and a hat marks an estimate. A loss LL is positive for an adverse outcome, so L=−PnLL = -\text{PnL} wherever a topic converts one into the other.

An equals sign means exact under the stated hypotheses, and ≈\approx marks a Taylor truncation, an asymptotic formula, a grid result or a statistical estimate. Every model statement on this page is a mathematical result under its assumptions, not a claim about real markets, and nothing here is investment advice.

Mathematical financial models

A contract is a schedule of dated cash flows that depend on the state of the world, and its price is a separate number assigned to that schedule. The absence of arbitrage ties the prices of different contracts together, while discount factors and returns record the time value of money and the growth of wealth under stated conventions. The unit also collects the calculus, linear algebra, optimization and probability that the later units use.

Contracts, payoffs and valuation

In a finite model the possible states are Ω={ω1,…,ωm}\Omega = \{\omega_1, \ldots, \omega_m\}, and a contract is the list of amounts Ct1(ω),…,Ctn(ω)C_{t_1}(\omega), \ldots, C_{t_n}(\omega) it pays at fixed dates in each state ω\omega. Positive amounts are receipts of the holder and negative amounts are payments, so the counterparty holds the negative of the same list. A payoff function is a rule, such as the call payoff X=(ST−K)+X = (S_T - K)^{+}, while a present value is one number assigned to the whole rule. Changing a term of the contract, such as the strike, gives a different object with its own value.

For terminal claims in a one-period model, the state price πj\pi_j is the time 0 price of one currency unit paid in state ωj\omega_j and nowhere else. State prices define the valuation operator

Π(X)=∑j=1mπj X(ωj).\Pi(X) = \sum_{j=1}^{m} \pi_j\,X(\omega_j).

It is linear, Π(aX+bY)=a Π(X)+b Π(Y)\Pi(aX + bY) = a\,\Pi(X) + b\,\Pi(Y), and when every πj>0\pi_j > 0 it is strictly positive, so X≥0X \ge 0 with X≠0X \ne 0 gives Π(X)>0\Pi(X) > 0. The sum of the state prices is the price of a sure unit, the one-period discount factor. With constructed state prices 0.450.45 and 0.50.5 and a stock that ends at 8080 or 120120, a sure unit costs 0.950.95 and the stock 9696. The call with strike 100100 pays (0,20)(0, 20) and costs 1010, and the call with strike 110110 pays (0,10)(0, 10) and costs 55.

Lessons Financial contracts as mathematical objects

Arbitrage and the law of one price

Take nn securities with time 0 prices c∈Rnc \in \mathbb{R}^{n} and an m×nm \times n payoff matrix AA whose row jj lists their payoffs in state ωj\omega_j, where every state has positive probability. A portfolio θ∈Rn\theta \in \mathbb{R}^{n} costs c⊤θc^{\top}\theta and pays AθA\theta. Trading is frictionless and any real holding is allowed, including short sales and borrowing.

  • Arbitrage. A portfolio with c⊤θ≤0c^{\top}\theta \le 0 and Aθ≥0A\theta \ge 0 in every state, and with c⊤θ<0c^{\top}\theta < 0 or Aθ≠0A\theta \ne 0. It costs nothing or less, never loses later, and gains either today or in at least one state.
  • Law of one price. If Aθ=AϕA\theta = A\phi then c⊤θ=c⊤ϕc^{\top}\theta = c^{\top}\phi. No arbitrage implies it, because buying the cheaper and selling the dearer of two equal payoffs is an arbitrage. The converse fails. A market with one security that pays (1,0)(1, 0) and costs 00 satisfies the law of one price, yet buying that security is an arbitrage.
  • Replication and linear pricing. Under the law of one price, a claim XX with Aθ=XA\theta = X for some θ\theta has the well defined price c⊤θc^{\top}\theta, whatever replicating portfolio is used, and this price is linear on the attainable claims.
  • Dominance. Under no arbitrage, attainable claims with X≥YX \ge Y in every state satisfy Π(X)≥Π(Y)\Pi(X) \ge \Pi(Y), with strict inequality when X≠YX \ne Y.

A stock costs 100100 and pays 8080 or 120120, and a bond costs 100100 and pays 105105 in both states. The call payoff (0,20)(0, 20) is replicated by Δ=12\Delta = \frac{1}{2} share and b=−821b = -\frac{8}{21} bond, a borrowing, at the cost 50−80021=25021≈11.904850 - \frac{800}{21} = \frac{250}{21} \approx 11.9048. At a quoted call price of 1414, selling the call and buying the replicating portfolio receives 4421≈2.0952\frac{44}{21} \approx 2.0952 today and leaves no obligation later. If short sales of the call are not allowed, that trade is unavailable, and a constraint of this kind turns the price equality into an inequality.

Lessons Arbitrage and the law of one price

Discount factors, compounding and forward rates

A deterministic discount function gives the time 0 value D(0,T)>0D(0,T) > 0 of one currency unit paid at TT, with D(0,0)=1D(0,0) = 1. A fixed schedule of amounts CkC_k paid at times tkt_k is worth

V0=∑kCk D(0,tk).V_0 = \sum_{k} C_k\,D(0, t_k).

A rate is a way of reporting the factor, so one discount factor gives different rates under different compounding conventions. For T>0T > 0 and D=D(0,T)D = D(0,T),

ConventionDiscount factorRate
simpleD=(1+yT)−1D = (1 + yT)^{-1}y=(1/D−1)/Ty = (1/D - 1)/T
mm times a yearD=(1+ym/m)−mTD = (1 + y_m/m)^{-mT}ym=m (D−1/(mT)−1)y_m = m\,(D^{-1/(mT)} - 1)
continuousD=e−z(T) TD = e^{-z(T)\,T}z(T)=−ln⁡D/Tz(T) = -\ln D/T

The time TT is a year fraction under a stated day count, such as actual/365 or actual/360, and a different day count gives a different rate for the same factor. For T1<T2T_1 < T_2 with accrual fraction δ\delta between them, the simple forward rate and, where DD is differentiable, the instantaneous forward rate are

1+δ F(0;T1,T2)=D(0,T1)D(0,T2),f(0,T)=−∂∂Tln⁡D(0,T).\begin{gathered} 1 + \delta\,F(0; T_1, T_2) = \frac{D(0,T_1)}{D(0,T_2)}, \\[0.4em] f(0,T) = -\frac{\partial}{\partial T}\ln D(0,T). \end{gathered}

With D(0,1)=0.96D(0,1) = 0.96 and D(0,2)=0.90D(0,2) = 0.90, the forward rate for the second year is F(0;1,2)=115≈0.0667F(0;1,2) = \frac{1}{15} \approx 0.0667 and the continuous spot rate is z(2)≈0.0527z(2) \approx 0.0527, while the same D(0,2)D(0,2) reports as 0.05560.0556 simple, 0.05410.0541 annually compounded and 0.05340.0534 semiannually compounded. A bond paying 55 after one year and 105105 after two is worth 5(0.96)+105(0.90)=99.35(0.96) + 105(0.90) = 99.3. If instead D(0,2)=0.98D(0,2) = 0.98, the forward rate is about −0.0204-0.0204, and the curve has to allow negative forward rates.

Lessons Time value of money and discount functions

Returns and self-financing portfolios

For a positive price StS_t and a cash dividend Div⁡t+1\operatorname{Div}_{t+1} paid at t+1t + 1,

ReturnDefinition
price return(St+1−St)/St(S_{t+1} - S_t)/S_t
total (simple) returnRt+1=(St+1−St+Div⁡t+1)/StR_{t+1} = (S_{t+1} - S_t + \operatorname{Div}_{t+1})/S_t
gross return1+Rt+11 + R_{t+1}
log returnln⁡(1+Rt+1)\ln(1 + R_{t+1}), defined only when 1+Rt+1>01 + R_{t+1} > 0

Gross returns multiply over consecutive periods, 1+R0,T=∏t(1+Rt,t+1)1 + R_{0,T} = \prod_{t}(1 + R_{t,t+1}), so log returns add. This is exact algebra under a consistent reinvestment convention and needs no assumption about distributions. For fixed initial weights, a portfolio’s simple return is the weighted sum of its components’ simple returns, but its log return is not the weighted sum of their log returns. A gain of 10 percent followed by a loss of 10 percent gives the gross return 1.1×0.9=0.991.1 \times 0.9 = 0.99 and the log return ln⁡0.99≈−0.01005\ln 0.99 \approx -0.01005.

A strategy holds θt\theta_t shares and βt\beta_t units of the cash account BtB_t after trading at tt, chosen with the information available at tt, so its wealth is Vt=θtSt+βtBtV_t = \theta_t S_t + \beta_t B_t. It is self-financing when every rebalance is paid for from inside the portfolio,

(θt−θt−1) St+(βt−βt−1) Bt=θt−1Div⁡t.\begin{aligned} &(\theta_t - \theta_{t-1})\,S_t + (\beta_t - \beta_{t-1})\,B_t \\[0.4em] &\quad = \theta_{t-1}\operatorname{Div}_t . \end{aligned}

Sales, borrowing (a negative βt\beta_t) and the dividend on the shares held over the last period fund the purchases, and no outside cash enters or leaves. Start with 2 shares at 100100 and 1 cash unit worth 5050. At t=1t = 1 the share is worth 102102 and pays a dividend of 33, and the cash unit is worth 5151, so the wealth is 2(102)+51+2(3)=2612(102) + 51 + 2(3) = 261. Buying a third share at 102102 without outside cash needs β1=(261−306)/51=−1517\beta_1 = (261 - 306)/51 = -\frac{15}{17}, a borrowing of 4545. If the price then rises to 110110 and the cash account grows by 2 percent, the wealth is 3(110)−45(1.02)=284.13(110) - 45(1.02) = 284.1.

Lessons Returns and self-financing portfolio accounting

Gradients, Hessians and Taylor expansions

For a value function VV of the risk factors x∈Rdx \in \mathbb{R}^{d}, the gradient ∇V(x)\nabla V(x) lists the first-order price sensitivities, in currency units per unit of each factor, and the Hessian H(x)H(x) has the entries Hij=∂i∂jV(x)H_{ij} = \partial_i\partial_j V(x). The change along a direction hh has the first-order rate ∇V(x)⊤h\nabla V(x)^{\top}h. If VV is twice continuously differentiable on an open set containing the segment from xx to x+hx + h, then HH is symmetric there and

V(x+h)=V(x)+∇V(x)⊤h+12 h⊤H(x) h+R2,\begin{aligned} V(x + h) &= V(x) + \nabla V(x)^{\top}h \\[0.4em] &\quad + \tfrac{1}{2}\,h^{\top}H(x)\,h + R_2, \end{aligned}

where, with ΔH(s)=H(x+sh)−H(x)\Delta H(s) = H(x + sh) - H(x),

R2=∫01(1−s) h⊤ΔH(s) h ds.R_2 = \int_0^1 (1 - s)\,h^{\top}\Delta H(s)\,h\,ds .

The remainder follows from the one-variable expansion of g(s)=V(x+sh)g(s) = V(x + sh), since g′′(s)=h⊤H(x+sh) hg''(s) = h^{\top}H(x + sh)\,h. It is o(∥h∥2)o(\lVert h \rVert^2) as h→0h \to 0 and is exactly zero when VV is quadratic. For V(x)=x12+2x1x2+3x22V(x) = x_1^2 + 2x_1x_2 + 3x_2^2 at x=(1,2)x = (1, 2) with h=(0.1,−0.2)h = (0.1, -0.2), the value is 1717, the gradient is (6,14)(6, 14), the linear term is −2.2-2.2 and the quadratic term is 0.090.09, which gives exactly V(x+h)=14.89V(x + h) = 14.89.

A kink breaks the hypothesis. The call payoff (s−K)+(s - K)^{+} has slope 00 below KK and 11 above it, so it has no Taylor expansion at s=Ks = K, and an expansion at a nearby point fails once the move crosses KK.

Lessons Multivariable calculus and Taylor expansions

Covariance matrices, projection and hedging

For a random vector RR with finite second moments and mean μ\mu, the covariance matrix Σ=E[(R−μ)(R−μ)⊤]\Sigma = \mathbb{E}[(R - \mu)(R - \mu)^{\top}] is symmetric and positive semidefinite, because w⊤Σw=Var⁡(w⊤R)≥0w^{\top}\Sigma w = \operatorname{Var}(w^{\top}R) \ge 0 for every ww. By the spectral theorem, a real symmetric matrix has the form Σ=QΛQ⊤\Sigma = Q\Lambda Q^{\top} with orthonormal eigenvectors qjq_j as the columns of QQ and real eigenvalues λj\lambda_j, which are nonnegative here, and

w⊤Σw=∑jλj (qj⊤w)2.w^{\top}\Sigma w = \sum_{j} \lambda_j\,(q_j^{\top}w)^2 .

A zero eigenvalue is a combination with zero variance, and then Σ\Sigma is singular.

The minimum-error hedge of a centered target XX with centered instruments YY minimizes E[(X−h⊤Y)2]\mathbb{E}[(X - h^{\top}Y)^2]. Its solutions are those of the normal equations ΣYh=Cov⁡(Y,X)\Sigma_Y h = \operatorname{Cov}(Y, X), which always have a solution, and h⊤Yh^{\top}Y is the orthogonal projection of XX onto the span of YY. When ΣY\Sigma_Y is invertible the hedge is unique, h=ΣY−1Cov⁡(Y,X)h = \Sigma_Y^{-1}\operatorname{Cov}(Y, X), and the residual variance is Var⁡(X)−Cov⁡(X,Y) h\operatorname{Var}(X) - \operatorname{Cov}(X, Y)\,h. When ΣY\Sigma_Y is singular, the pseudoinverse ΣY+=Qdiag⁡(λj+)Q⊤\Sigma_Y^{+} = Q\operatorname{diag}(\lambda_j^{+})Q^{\top}, with λj+=1/λj\lambda_j^{+} = 1/\lambda_j for λj>0\lambda_j > 0 and 00 otherwise, gives the solution of smallest norm.

With ΣY=(4224)\Sigma_Y = \begin{pmatrix} 4 & 2 \\ 2 & 4 \end{pmatrix} the eigenvalues are 66 and 22, and the equally weighted combination has variance 33. For Cov⁡(Y,X)=(3,1)\operatorname{Cov}(Y, X) = (3, 1) and Var⁡(X)=5\operatorname{Var}(X) = 5, the hedge is h=(56,−16)h = (\frac{5}{6}, -\frac{1}{6}) with residual variance 83\frac{8}{3}. Two identical instruments with ΣY=(1111)\Sigma_Y = \begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix} and Cov⁡(Y,X)=(2,2)\operatorname{Cov}(Y, X) = (2, 2) admit every hh with h1+h2=2h_1 + h_2 = 2, and the pseudoinverse picks h=(1,1)h = (1, 1).

Lessons Linear algebra for covariance and hedging

Convex optimization and duality

Consider minimizing f(x)f(x) subject to gi(x)≤0g_i(x) \le 0 for i=1,…,pi = 1, \ldots, p and Ax=bAx = b, with optimal value p∗p^{*}. The Lagrangian and the dual function are

L(x,λ,ν)=f(x)+∑iλigi(x)+ν⊤(Ax−b),q(λ,ν)=inf⁡xL(x,λ,ν).\begin{aligned} L(x, \lambda, \nu) &= f(x) + \sum_{i} \lambda_i g_i(x) \\[0.4em] &\quad + \nu^{\top}(Ax - b), \\[0.4em] q(\lambda, \nu) &= \inf_{x} L(x, \lambda, \nu). \end{aligned}
  • Weak duality. For every λ≥0\lambda \ge 0 and every feasible xx, q(λ,ν)≤f(x)q(\lambda, \nu) \le f(x), so the dual optimum satisfies d∗≤p∗d^{*} \le p^{*}. No convexity is needed.
  • KKT conditions. Stationarity ∇f(x∗)+∑iλi∗∇gi(x∗)+A⊤ν∗=0\nabla f(x^{*}) + \sum_i \lambda_i^{*}\nabla g_i(x^{*}) + A^{\top}\nu^{*} = 0, primal feasibility, λ∗≥0\lambda^{*} \ge 0 and complementary slackness λi∗ gi(x∗)=0\lambda_i^{*}\,g_i(x^{*}) = 0.
  • Sufficiency. If ff and the gig_i are convex and differentiable, any point satisfying the KKT conditions is a global minimizer and its multipliers solve the dual.
  • Necessity. Multipliers need a constraint qualification. Slater’s condition, a point with Ax=bAx = b and gi(x)<0g_i(x) < 0 for every nonaffine gig_i, gives strong duality d∗=p∗d^{*} = p^{*} for a convex problem, and KKT multipliers exist at every minimizer. Without it they can fail to exist. Minimizing xx subject to x2≤0x^2 \le 0 has the minimizer 00, where 1+2λ⋅0≠01 + 2\lambda \cdot 0 \ne 0 for every λ\lambda.

A constraint is binding, or active, when gi(x∗)=0g_i(x^{*}) = 0, and a positive multiplier forces it to bind. Minimizing 12(x−3)2\frac{1}{2}(x - 3)^2 subject to x−1≤0x - 1 \le 0 gives the Lagrangian minimizer x=3−λx = 3 - \lambda and the dual function q(λ)=2λ−12λ2q(\lambda) = 2\lambda - \frac{1}{2}\lambda^2. Its maximum q(2)=2q(2) = 2 equals f(1)=2f(1) = 2, so x∗=1x^{*} = 1 and λ∗=2\lambda^{*} = 2, with the constraint binding. With the bound x≤4x \le 4 instead, x∗=3x^{*} = 3 and λ∗=0\lambda^{*} = 0.

Lessons Convex optimization and duality

Probability spaces and Bayes’ theorem

A probability space (Ω,F,P)(\Omega, \mathcal{F}, \mathbb{P}) has a sigma algebra F\mathcal{F} of events, which contains Ω\Omega and is closed under complements and countable unions, and a probability measure with P(Ω)=1\mathbb{P}(\Omega) = 1 that adds over countably many disjoint events. Information that reveals which block of a partition {B1,…,Bk}\{B_1, \ldots, B_k\} of Ω\Omega has occurred corresponds to the sigma algebra of all unions of blocks. For P(B)>0\mathbb{P}(B) > 0,

P(A∣B)=P(A∩B)P(B),P(A∣B)=P(B∣A) P(A)P(B),\begin{gathered} \mathbb{P}(A \mid B) = \frac{\mathbb{P}(A \cap B)}{\mathbb{P}(B)}, \\[0.4em] \mathbb{P}(A \mid B) = \frac{\mathbb{P}(B \mid A)\,\mathbb{P}(A)}{\mathbb{P}(B)}, \end{gathered}

with P(B)=P(B∣A) P(A)+P(B∣Ac) P(Ac)\mathbb{P}(B) = \mathbb{P}(B \mid A)\,\mathbb{P}(A) + \mathbb{P}(B \mid A^{c})\,\mathbb{P}(A^{c}) by the law of total probability. Conditioning on an event of probability zero needs regular conditional distributions, beyond these formulas.

The base rate matters. If a default has prior probability 0.020.02 and a warning signal fires with probability 0.900.90 before a default and 0.100.10 otherwise, then P(+)=0.018+0.098=0.116\mathbb{P}(+) = 0.018 + 0.098 = 0.116 and P(D∣+)=958≈0.155\mathbb{P}(D \mid +) = \frac{9}{58} \approx 0.155. With the prior 0.20.2 the same signal gives about 0.6920.692.

Lessons Probability spaces and conditional information

Probability and financial econometrics

Prices and returns are modeled as random variables, and the questions about them are about distributions, conditional expectations and dependence. Estimation, regression and time-series models turn finite data into statements about those objects, and each statement holds only under its own conditions, such as integrability, exogeneity or stationarity. The measure here is the physical one, P\mathbb{P}, unless a topic says otherwise.

Distributions and change of variables

The distribution function FX(x)=P(X≤x)F_X(x) = \mathbb{P}(X \le x) is nondecreasing and right-continuous with limits 00 and 11. A density fXf_X satisfies FX(x)=∫−∞xfX(u) duF_X(x) = \int_{-\infty}^{x} f_X(u)\,du, and it exists only for an absolutely continuous law, not for laws with atoms. If Y=g(X)Y = g(X) with gg strictly monotone and differentiable with g′≠0g' \ne 0 on the support of XX, then on the image of that support

fY(y)=fX(g−1(y)) ∣ddyg−1(y)∣,f_Y(y) = f_X\big(g^{-1}(y)\big)\,\left\lvert \frac{d}{dy}g^{-1}(y) \right\rvert,

and fY=0f_Y = 0 elsewhere. For a one-to-one differentiable map of a random vector, the absolute value of the Jacobian determinant of the inverse map takes the place of the derivative.

If Z∼N(μ,σ2)Z \sim N(\mu, \sigma^2) with σ>0\sigma > 0 and S=S0eZS = S_0e^{Z} with S0>0S_0 > 0, then SS is lognormal. With u=ln⁡(s/S0)u = \ln(s/S_0) its density for s>0s > 0 is

fS(s)=1sσ2π e−(u−μ)2/(2σ2).f_S(s) = \frac{1}{s\sigma\sqrt{2\pi}}\,e^{-(u - \mu)^2/(2\sigma^2)} .

Completing the square gives E[eaZ]=eaμ+a2σ2/2\mathbb{E}[e^{aZ}] = e^{a\mu + a^2\sigma^2/2} for every real aa, and therefore

E[S]=S0eμ+σ2/2,Var⁡(S)=S02e2μ+σ2(eσ2−1),\begin{gathered} \mathbb{E}[S] = S_0e^{\mu + \sigma^2/2}, \\[0.4em] \operatorname{Var}(S) = S_0^2e^{2\mu + \sigma^2}(e^{\sigma^2} - 1), \end{gathered}

while the median is S0eμS_0e^{\mu}. For S0=100S_0 = 100, μ=0\mu = 0 and σ=0.2\sigma = 0.2, the median is 100100, the mean is about 102.02102.02 and the variance about 424.76424.76. Doubling σ\sigma to 0.40.4 leaves the median at 100100 and raises the mean to about 108.33108.33.

Lessons Random variables and distribution transformations

Expectation, conditional expectation and variance

The expectation E[X]\mathbb{E}[X] exists when XX is integrable, E∣X∣<∞\mathbb{E}\lvert X \rvert < \infty, and the variance Var⁡(X)=E[X2]−(E[X])2\operatorname{Var}(X) = \mathbb{E}[X^2] - (\mathbb{E}[X])^2 needs E[X2]<∞\mathbb{E}[X^2] < \infty. A Cauchy variable has no mean, and no sample average estimates one. For integrable XX and a sigma algebra G⊆F\mathcal{G} \subseteq \mathcal{F}, the conditional expectation Y=E[X∣G]Y = \mathbb{E}[X \mid \mathcal{G}] is the G\mathcal{G}-measurable random variable with E[1AX]=E[1AY]\mathbb{E}[\mathbf{1}_{A}X] = \mathbb{E}[\mathbf{1}_{A}Y] for every A∈GA \in \mathcal{G}. It exists and is unique up to null sets. For a partition into blocks BiB_i with P(Bi)>0\mathbb{P}(B_i) > 0, it equals E[X1Bi]/P(Bi)\mathbb{E}[X\mathbf{1}_{B_i}]/\mathbb{P}(B_i) on BiB_i.

The tower property says that if H⊆G\mathcal{H} \subseteq \mathcal{G}, then E[E[X∣G]∣H]=E[X∣H]\mathbb{E}\big[\mathbb{E}[X \mid \mathcal{G}] \mid \mathcal{H}\big] = \mathbb{E}[X \mid \mathcal{H}], and in particular E[E[X∣G]]=E[X]\mathbb{E}\big[\mathbb{E}[X \mid \mathcal{G}]\big] = \mathbb{E}[X]. If E[X2]<∞\mathbb{E}[X^2] < \infty, the law of total variance splits the variance into a within-group part and a between-group part,

Var⁡(X)=E[Var⁡(X∣G)]+Var⁡(E[X∣G]).\begin{aligned} \operatorname{Var}(X) &= \mathbb{E}\big[\operatorname{Var}(X \mid \mathcal{G})\big] \\[0.4em] &\quad + \operatorname{Var}\big(\mathbb{E}[X \mid \mathcal{G}]\big). \end{aligned}

Four equally likely states pay X=(0,2,4,10)X = (0, 2, 4, 10), and the information reveals whether the state is one of the first two or one of the last two. Then E[X]=4\mathbb{E}[X] = 4 and E[X∣G]=(1,1,7,7)\mathbb{E}[X \mid \mathcal{G}] = (1, 1, 7, 7). The conditional variances are 11 and 99, so the within-group part is 55, the between-group part is 99 and Var⁡(X)=14\operatorname{Var}(X) = 14.

Lessons Expectation conditional expectation and variance

Joint distributions, correlation and copulas

For XX and YY with finite second moments, Cov⁡(X,Y)=E[XY]−E[X] E[Y]\operatorname{Cov}(X, Y) = \mathbb{E}[XY] - \mathbb{E}[X]\,\mathbb{E}[Y], and when both standard deviations are positive the correlation ρ=Cov⁡(X,Y)/(σXσY)\rho = \operatorname{Cov}(X, Y)/(\sigma_X\sigma_Y) lies in [−1,1][-1, 1]. Independence implies zero covariance, but not conversely. If XX is −1-1, 00 or 11 with probability 13\frac{1}{3} each and Y=X2Y = X^2, then Cov⁡(X,Y)=E[X3]=0\operatorname{Cov}(X, Y) = \mathbb{E}[X^3] = 0, yet P(X=0,Y=0)=13\mathbb{P}(X = 0, Y = 0) = \frac{1}{3} while P(X=0) P(Y=0)=19\mathbb{P}(X = 0)\,\mathbb{P}(Y = 0) = \frac{1}{9}.

A random vector is jointly Gaussian when X=μ+LZX = \mu + LZ with Z∼N(0,I)Z \sim N(0, I), and then Σ=LL⊤\Sigma = LL^{\top} and every combination a⊤X∼N(a⊤μ,a⊤Σa)a^{\top}X \sim N(a^{\top}\mu, a^{\top}\Sigma a). For jointly Gaussian vectors, zero correlation implies independence, but two Gaussian variables that are not jointly Gaussian can be uncorrelated and dependent. A portfolio with weights ww and return covariance Σ\Sigma has variance w⊤Σww^{\top}\Sigma w, which for two assets is w12σ12+w22σ22+2w1w2ρ σ1σ2w_1^2\sigma_1^2 + w_2^2\sigma_2^2 + 2w_1w_2\rho\,\sigma_1\sigma_2. Equal weights on volatilities 0.20.2 and 0.30.3 give the variance 0.04750.0475 when ρ=0.5\rho = 0.5 and 0.01750.0175 when ρ=−0.5\rho = -0.5.

A copula is a joint distribution function on [0,1]2[0,1]^2 with uniform marginals. By Sklar’s theorem, every joint distribution function has a copula CC with

FX,Y(x,y)=C(FX(x),FY(y)),F_{X,Y}(x, y) = C\big(F_X(x), F_Y(y)\big),

and CC is unique when the marginals are continuous. The copula carries the dependence and the marginals carry the scales, so one set of marginals is compatible with many joint laws.

Lessons Multivariate distributions and dependence

Likelihood, estimation and limit theorems

For observations x1,…,xnx_1, \ldots, x_n that are independent with density fθf_\theta, the likelihood is L(θ;x)=∏jfθ(xj)L(\theta; x) = \prod_j f_\theta(x_j), a function of the parameter, and the maximum likelihood estimator maximizes the log-likelihood ℓ(θ;x)=∑jln⁡fθ(xj)\ell(\theta; x) = \sum_j \ln f_\theta(x_j). For independent N(μ,σ2)N(\mu, \sigma^2) data, μ^=xˉ\hat{\mu} = \bar{x} and σ^MLE2=1n∑j(xj−xˉ)2\hat{\sigma}^2_{\text{MLE}} = \frac{1}{n}\sum_j (x_j - \bar{x})^2, which is biased, while s2=1n−1∑j(xj−xˉ)2s^2 = \frac{1}{n-1}\sum_j (x_j - \bar{x})^2 is unbiased. An estimator is consistent when it converges in probability to the true parameter as n→∞n \to \infty.

  • Law of large numbers. For independent, identically distributed XjX_j with E∣X∣<∞\mathbb{E}\lvert X \rvert < \infty, the sample mean Xˉn\bar{X}_n converges to E[X]\mathbb{E}[X], in probability and almost surely. With finite variance, Chebyshev’s inequality gives P(∣Xˉn−μ∣>ε)≤σ2/(nε2)\mathbb{P}(\lvert \bar{X}_n - \mu \rvert > \varepsilon) \le \sigma^2/(n\varepsilon^2).
  • Central limit theorem. If moreover 0<σ2<∞0 < \sigma^2 < \infty, then n (Xˉn−μ)/σ\sqrt{n}\,(\bar{X}_n - \mu)/\sigma converges in distribution to N(0,1)N(0, 1).

The standard error of Xˉ\bar{X} is σ/n\sigma/\sqrt{n}. For normal data with known σ\sigma, the interval Xˉ±z0.975 σ/n\bar{X} \pm z_{0.975}\,\sigma/\sqrt{n} with z0.975≈1.96z_{0.975} \approx 1.96 covers μ\mu with probability exactly 0.950.95. With ss in place of σ\sigma, normal data call for the tt quantile with n−1n - 1 degrees of freedom, and for other data the central limit theorem gives approximate coverage. The probability describes the procedure over repeated samples, not one computed interval. For the sample (1,2,3,4)(1, 2, 3, 4) with known σ=2\sigma = 2, xˉ=2.5\bar{x} = 2.5, the standard error is 11 and the interval is about [0.540,4.460][0.540, 4.460], while σ^MLE2=1.25\hat{\sigma}^2_{\text{MLE}} = 1.25 and s2=53s^2 = \frac{5}{3}.

Lessons Statistical estimation and likelihood

Least squares regression and identification

Ordinary least squares chooses β^\hat{\beta} to minimize ∥y−Xb∥22\lVert y - Xb \rVert_2^2. The minimizers solve the normal equations X⊤Xβ^=X⊤yX^{\top}X\hat{\beta} = X^{\top}y, and when XX has full column rank

β^=(X⊤X)−1X⊤y.\hat{\beta} = (X^{\top}X)^{-1}X^{\top}y .

The fitted vector Xβ^X\hat{\beta} is the orthogonal projection of yy onto the column space of XX, so the residuals are orthogonal to every column. This is algebra and holds for any data. Interpreting β^\hat{\beta} as a model parameter needs identifying assumptions. In the model y=Xβ+εy = X\beta + \varepsilon with exogeneity E[ε∣X]=0\mathbb{E}[\varepsilon \mid X] = 0, the error β^−β=(X⊤X)−1X⊤ε\hat{\beta} - \beta = (X^{\top}X)^{-1}X^{\top}\varepsilon has conditional mean zero, and with Ω=Var⁡(ε∣X)\Omega = \operatorname{Var}(\varepsilon \mid X)

Var⁡(β^∣X)=(X⊤X)−1X⊤ΩX×(X⊤X)−1.\begin{aligned} \operatorname{Var}(\hat{\beta} \mid X) &= (X^{\top}X)^{-1}X^{\top}\Omega X \\[0.4em] &\quad \times (X^{\top}X)^{-1}. \end{aligned}

Under homoskedasticity, Ω=σ2I\Omega = \sigma^2I, this reduces to σ2(X⊤X)−1\sigma^2(X^{\top}X)^{-1}. Under heteroskedasticity the sandwich form stays valid, and replacing Ω\Omega by the diagonal matrix of squared residuals gives the heteroskedasticity-consistent sandwich estimator, which is consistent under regularity conditions.

If the true model is Y=α+βX+γZ+εY = \alpha + \beta X + \gamma Z + \varepsilon with E[ε∣X,Z]=0\mathbb{E}[\varepsilon \mid X, Z] = 0 and ZZ is left out, the slope of YY on XX alone targets β+γCov⁡(X,Z)/Var⁡(X)\beta + \gamma\operatorname{Cov}(X, Z)/\operatorname{Var}(X), the omitted variable bias. With β=1\beta = 1, γ=2\gamma = 2, Cov⁡(X,Z)=0.5\operatorname{Cov}(X, Z) = 0.5 and Var⁡(X)=1\operatorname{Var}(X) = 1, it targets 22. For the data x=(0,1,2,3)x = (0, 1, 2, 3) and y=(1,2,2,5)y = (1, 2, 2, 5), the fitted line is y^=0.7+1.2x\hat{y} = 0.7 + 1.2x, with residuals (0.3,0.1,−1.1,0.7)(0.3, 0.1, -1.1, 0.7) and residual sum of squares 1.81.8.

Lessons Regression and statistical identification

Stationarity and ARMA models

A process is weakly stationary when its mean is constant, its variance is finite and Cov⁡(Xt,Xt−h)=γ(h)\operatorname{Cov}(X_t, X_{t-h}) = \gamma(h) depends only on the lag hh. The autocorrelation is ρ(h)=γ(h)/γ(0)\rho(h) = \gamma(h)/\gamma(0). Let εt\varepsilon_t be white noise with variance σε2\sigma_\varepsilon^2. The AR(1) equation Xt=ϕXt−1+εtX_t = \phi X_{t-1} + \varepsilon_t with ∣ϕ∣<1\lvert \phi \rvert < 1 has a unique causal stationary solution,

Xt=∑j=0∞ϕjεt−j,γ(0)=σε21−ϕ2,γ(h)=ϕ∣h∣γ(0).\begin{gathered} X_t = \sum_{j=0}^{\infty} \phi^{j}\varepsilon_{t-j}, \\[0.4em] \gamma(0) = \frac{\sigma_\varepsilon^2}{1 - \phi^2}, \\[0.4em] \gamma(h) = \phi^{\lvert h \rvert}\gamma(0). \end{gathered}

If the shocks have conditional mean zero and constant conditional variance given the past, then E[Xt+h∣Ft]=ϕhXt\mathbb{E}[X_{t+h} \mid \mathcal{F}_t] = \phi^{h}X_t and the forecast error variance is σε2(1−ϕ2h)/(1−ϕ2)\sigma_\varepsilon^2(1 - \phi^{2h})/(1 - \phi^2), which rises toward γ(0)\gamma(0) as hh grows. An ARMA(pp, qq) model is Φ(L)Xt=Θ(L)εt\Phi(L)X_t = \Theta(L)\varepsilon_t with the lag operator LL, Φ(z)=1−ϕ1z−⋯−ϕpzp\Phi(z) = 1 - \phi_1z - \cdots - \phi_pz^{p} and Θ(z)=1+θ1z+⋯+θqzq\Theta(z) = 1 + \theta_1z + \cdots + \theta_qz^{q}. When the two polynomials have no common root, it has a causal stationary solution exactly when every root of Φ\Phi lies outside the unit circle, and it is invertible when every root of Θ\Theta does.

The random walk Xt=Xt−1+εtX_t = X_{t-1} + \varepsilon_t with X0=0X_0 = 0 has a unit root. Its variance tσε2t\sigma_\varepsilon^2 grows without bound, so it is not stationary, while its difference ΔXt=εt\Delta X_t = \varepsilon_t is. With ϕ=0.6\phi = 0.6 and σε2=4\sigma_\varepsilon^2 = 4, the autocovariances are 6.256.25, 3.753.75 and 2.252.25 at lags 00, 11 and 22. From Xt=10X_t = 10 the two-step forecast is 3.63.6 with error variance 5.445.44, and the random walk with the same shocks has variance 2020 at t=5t = 5.

Lessons Stationarity autocovariance and ARMA models

Conditional volatility and GARCH

Write the shock as εt=ht zt\varepsilon_t = \sqrt{h_t}\,z_t, where the ztz_t are independent with mean 00 and variance 11, ztz_t is independent of Ft−1\mathcal{F}_{t-1}, and the conditional variance ht=Var⁡(εt∣Ft−1)h_t = \operatorname{Var}(\varepsilon_t \mid \mathcal{F}_{t-1}) is known at t−1t - 1. The ARCH(qq) model sets ht=ω+∑j=1qαjεt−j2h_t = \omega + \sum_{j=1}^{q}\alpha_j\varepsilon_{t-j}^2 with ω>0\omega > 0 and αj≥0\alpha_j \ge 0. The GARCH(1,1) model adds persistence,

ht=ω+α εt−12+β ht−1,h_t = \omega + \alpha\,\varepsilon_{t-1}^2 + \beta\,h_{t-1},

with ω>0\omega > 0, α≥0\alpha \ge 0 and β≥0\beta \ge 0. When α+β<1\alpha + \beta < 1, the stationary solution has the finite unconditional variance hˉ=ω/(1−α−β)\bar{h} = \omega/(1 - \alpha - \beta), and for k≥1k \ge 1

E[ht+k∣Ft]−hˉ=(α+β)k−1(ht+1−hˉ).\begin{gathered} \mathbb{E}[h_{t+k} \mid \mathcal{F}_t] - \bar{h} \\[0.4em] = (\alpha + \beta)^{k-1}(h_{t+1} - \bar{h}). \end{gathered}

The sum α+β\alpha + \beta measures persistence. At α+β=1\alpha + \beta = 1 the unconditional variance is infinite, although a strictly stationary solution can still exist, since strict stationarity of GARCH(1,1) holds exactly when E[ln⁡(αzt2+β)]<0\mathbb{E}[\ln(\alpha z_t^2 + \beta)] < 0. With ω=0.1\omega = 0.1, α=0.1\alpha = 0.1, β=0.8\beta = 0.8, h0=1h_0 = 1 and ε0=2\varepsilon_0 = 2, the long-run variance is hˉ=1\bar{h} = 1, the next variance is h1=1.3h_1 = 1.3 and the forecast is E[h2∣F0]=1.27\mathbb{E}[h_2 \mid \mathcal{F}_0] = 1.27. If the next shock turns out to be ε1=0\varepsilon_1 = 0, the realized h2h_2 is 1.141.14.

Lessons Conditional volatility and GARCH

State space models and the Kalman filter

A linear Gaussian state space model has a latent state equation and an observation equation,

xt=Axt−1+wt,yt=Hxt+vt,\begin{gathered} x_t = Ax_{t-1} + w_t, \\[0.4em] y_t = Hx_t + v_t, \end{gathered}

with wt∼N(0,Q)w_t \sim N(0, Q) and vt∼N(0,R)v_t \sim N(0, R) independent of each other, over time and of the initial state x0∼N(m0,P0)x_0 \sim N(m_0, P_0). The Kalman filter alternates a prediction step, the first two lines below, and an update step.

mt−=Amt−1,Pt−=APt−1A⊤+Q,St=HPt−H⊤+R,Kt=Pt−H⊤St−1,mt=mt−+Kt(yt−Hmt−),Pt=(I−KtH) Pt−.\begin{aligned} m_t^{-} &= Am_{t-1}, \\[0.4em] P_t^{-} &= AP_{t-1}A^{\top} + Q, \\[0.4em] S_t &= HP_t^{-}H^{\top} + R, \\[0.4em] K_t &= P_t^{-}H^{\top}S_t^{-1}, \\[0.4em] m_t &= m_t^{-} + K_t(y_t - Hm_t^{-}), \\[0.4em] P_t &= (I - K_tH)\,P_t^{-}. \end{aligned}

Here yt−Hmt−y_t - Hm_t^{-} is the innovation, StS_t its covariance and KtK_t the Kalman gain. Under the Gaussian assumptions mtm_t and PtP_t are the exact conditional mean and covariance of xtx_t given y1,…,yty_1, \ldots, y_t. Without normality, the same recursion still gives the best linear estimator in mean square. In the scalar case with H=1H = 1 and Pt−>0P_t^{-} > 0, the gain tends to 00 as R→∞R \to \infty and to 11 as R→0R \to 0. With A=H=1A = H = 1, Q=0.25Q = 0.25, R=1R = 1, m0=0m_0 = 0 and P0=1P_0 = 1, the observation y1=2y_1 = 2 gives P1−=1.25P_1^{-} = 1.25, K1=59K_1 = \frac{5}{9}, m1=109m_1 = \frac{10}{9} and P1=59P_1 = \frac{5}{9}, and then y2=0y_2 = 0 gives K2=2965K_2 = \frac{29}{65} and m2=813m_2 = \frac{8}{13}.

Lessons State space models and the Kalman filter

Cash flows instruments and curves

Bonds, forwards, futures, swaps and currency and commodity contracts are schedules of dated cash flows. With deterministic discount factors and frictionless trading, their values follow from discounting and from replication, and every formula depends on stated conventions for compounding, day counts, settlement and quotation. Discounting is deterministic throughout this unit except where futures meet random interest rates.

Bond prices, accrued interest and yield

A default-free bond with fixed amounts CkC_k at times tkt_k, coupons plus the principal at maturity, has the full price V=∑kCk D(0,tk)V = \sum_k C_k\,D(0, t_k) for settlement at time 0. Quotes are usually clean prices, and between coupon dates the full (dirty) price is the clean price plus accrued interest,

Vfull=Vclean+AI,AI=c×days accrueddays in period,\begin{gathered} V_{\text{full}} = V_{\text{clean}} + \text{AI}, \\[0.4em] \text{AI} = c \times \frac{\text{days accrued}}{\text{days in period}}, \end{gathered}

where cc is the coupon per period and the days are counted under the bond’s day count. A full price of 99.399.3 with a coupon of 55 that is 40 percent accrued has AI=2\text{AI} = 2 and a clean price of 97.397.3.

On a coupon date with annual payments C1,…,CnC_1, \ldots, C_n after 1,…,n1, \ldots, n years, the yield to maturity is the y>−1y > -1 that solves

V=∑k=1nCk(1+y)k.V = \sum_{k=1}^{n} \frac{C_k}{(1 + y)^{k}} .

It is the internal rate of return of the cash flows. If every Ck≥0C_k \ge 0 and some Ck>0C_k > 0, the right side decreases strictly from +∞+\infty to 00 on (−1,∞)(-1, \infty), so every positive price has exactly one yield. Cash flows of mixed sign can have several. The yield is a summary of the price, not a forecast of the return, and the return over the life of the bond equals yy only if the bond is held to maturity and every coupon is reinvested at yy. The bond paying 55 and 105105 is worth 98.166698.1666 at y=0.06y = 0.06, and a bond whose coupon rate equals its yield is priced at par on a coupon date.

Lessons Bond cash flows and yield mathematics

Bootstrapping a discount curve

Order default-free instruments by maturity so that instrument kk pays CkjC_{kj} at the curve nodes TjT_j for j≤kj \le k and costs VkV_k. The pricing equations Vk=∑j≤kCkjDjV_k = \sum_{j \le k} C_{kj}D_j form a triangular system, solved in order when every Ckk≠0C_{kk} \ne 0,

Dk=Vk−∑j<kCkjDjCkk.D_k = \frac{V_k - \sum_{j<k} C_{kj}D_j}{C_{kk}} .

A zero-coupon bond paying 100100 in one year at price 9595 gives D1=0.95D_1 = 0.95. Annual 4 percent coupon bonds with two and three years to maturity at prices 9797 and 9696 give

97=4D1+104D2,96=4D1+4D2+104D3,\begin{gathered} 97 = 4D_1 + 104D_2, \\[0.4em] 96 = 4D_1 + 4D_2 + 104D_3, \end{gathered}

so D2≈0.896154D_2 \approx 0.896154 and D3≈0.852071D_3 \approx 0.852071, and the forward rate for the second year is D1/D2−1≈0.0601D_1/D_2 - 1 \approx 0.0601. Quotes fix the curve only at its nodes, and values in between come from an interpolation rule, which is a modeling choice. Log-linear interpolation of discount factors, ln⁡D(t)=(1−w)ln⁡D(T1)+wln⁡D(T2)\ln D(t) = (1 - w)\ln D(T_1) + w\ln D(T_2) with w=(t−T1)/(T2−T1)w = (t - T_1)/(T_2 - T_1), keeps the instantaneous forward rate constant between nodes and gives D(1.5)=D1D2≈0.922684D(1.5) = \sqrt{D_1D_2} \approx 0.922684. A consistent curve reprices every input instrument exactly and has positive discount factors. A two-year price of 105105 instead would give D2≈0.973>D1D_2 \approx 0.973 > D_1 and a negative forward rate of about −0.0237-0.0237, which a curve check should flag.

Lessons Bootstrapping discount curves

Duration, convexity and key rates

For fixed positive cash flows CtC_t at t=1,…,nt = 1, \ldots, n years, priced with an annually compounded yield as V(y)=∑tCt(1+y)−tV(y) = \sum_t C_t(1 + y)^{-t}, the Macaulay duration, the modified duration and the convexity are

DMac=1V∑tt Ct(1+y)−t,Dmod=DMac1+y=−V′(y)V,C=V′′(y)V.\begin{gathered} D_{\text{Mac}} = \frac{1}{V}\sum_{t} t\,C_t(1 + y)^{-t}, \\[0.4em] D_{\text{mod}} = \frac{D_{\text{Mac}}}{1 + y} = -\frac{V'(y)}{V}, \\[0.4em] \mathcal{C} = \frac{V''(y)}{V}. \end{gathered}

With mm payments a year and a yield compounded mm times a year, Dmod=DMac/(1+y/m)D_{\text{mod}} = D_{\text{Mac}}/(1 + y/m), and with continuous compounding the two durations coincide. For a parallel change Δy\Delta y of the yield, the second-order Taylor approximation is

ΔVV≈−Dmod Δy+12 C (Δy)2,\frac{\Delta V}{V} \approx -D_{\text{mod}}\,\Delta y + \tfrac{1}{2}\,\mathcal{C}\,(\Delta y)^2,

and the DV01, the price fall for a rise of one basis point to first order, is VDmod×0.0001V D_{\text{mod}} \times 0.0001. For the bond paying 55 and 105105 at y=0.06y = 0.06, V=98.1666V = 98.1666, DMac≈1.9519D_{\text{Mac}} \approx 1.9519, Dmod≈1.8415D_{\text{mod}} \approx 1.8415, C≈5.1689\mathcal{C} \approx 5.1689 and the DV01 is about 0.01810.0181. After a rise of 1 percent the exact price is 96.384096.3840, the first-order estimate 96.358996.3589 and the second-order estimate 96.384396.3843.

Key rate durations measure the response to a change at one node of the zero curve. If each cash flow sits on a node and V=∑jCje−zjtjV = \sum_j C_je^{-z_jt_j} with continuously compounded zero rates zjz_j,

KRDj=−1V∂V∂zj=tjCje−zjtjV,\text{KRD}_j = -\frac{1}{V}\frac{\partial V}{\partial z_j} = \frac{t_jC_je^{-z_jt_j}}{V},

and the key rate durations add up to the duration for a parallel shift of the zero curve. These formulas assume fixed cash flows. A callable bond or any instrument whose cash flows depend on rates needs a sensitivity computed from a pricing model.

Lessons Duration convexity and key rate sensitivities

Forwards and cost of carry

A long forward with delivery price KK pays ST−KS_T - K at TT. Assume frictionless trading, short sales of the asset, deterministic interest rates and a known income stream. Replication by buying the asset with borrowed money gives the forward price, the KK that makes a new contract worth zero.

Asset incomeForward price F0,TF_{0,T}
noneS0/D(0,T)=S0erTS_0/D(0,T) = S_0e^{rT}
known cash dividends Div⁡k\operatorname{Div}_k at tk≤Tt_k \le T(S0−I0)/D(0,T)(S_0 - I_0)/D(0,T), with I0=∑kDiv⁡k D(0,tk)I_0 = \sum_k \operatorname{Div}_k\,D(0,t_k)
continuous yield qqS0e(r−q)TS_0e^{(r - q)T}

The prepaid forward, paid today for delivery at TT, is S0−I0S_0 - I_0 or S0e−qTS_0e^{-qT}. An existing forward with delivery price KK is worth D(0,T) (F0,T−K)D(0,T)\,(F_{0,T} - K), which is S0e−qT−Ke−rTS_0e^{-qT} - Ke^{-rT} in the yield case. The value of a contract and its forward price are different numbers, and the value is zero only when K=F0,TK = F_{0,T}. With S0=100S_0 = 100, r=0.05r = 0.05 and T=1T = 1, a dividend of 22 at t=0.5t = 0.5 gives F=100e0.05−2e0.025≈103.0765F = 100e^{0.05} - 2e^{0.025} \approx 103.0765, and a yield q=0.02q = 0.02 gives F=100e0.03≈103.0455F = 100e^{0.03} \approx 103.0455. A contract in the yield case with K=104K = 104 is worth about −0.9080-0.9080 to the long side.

Lessons Forwards and cost of carry

Futures and daily settlement

A futures position is marked to the futures price FtF_t at every settlement date, and the long side receives the variation margin Ft−Ft−1F_t - F_{t-1}, positive or negative, so the contract is worth zero after each settlement. Margin flows earn or pay interest until TT. On the path 100100, 110110, 105105 with the first gain of 1010 invested at 2 percent for the remaining period, the long side ends with 10(1.02)−5=5.210(1.02) - 5 = 5.2, not the 55 of a forward.

In a frictionless model with settlement at each period, cash-account numeraire and pricing measure Q\mathbb{Q},

F0,Tfut=EQ[ST],F0,Tfwd=EQ[ST/BT]EQ[1/BT],\begin{gathered} F^{\text{fut}}_{0,T} = \mathbb{E}^{\mathbb{Q}}[S_T], \\[0.4em] F^{\text{fwd}}_{0,T} = \frac{\mathbb{E}^{\mathbb{Q}}[S_T/B_T]}{\mathbb{E}^{\mathbb{Q}}[1/B_T]}, \end{gathered}

so the difference is

F0,Tfwd−F0,Tfut=Cov⁡Q(1/BT, ST)EQ[1/BT].F^{\text{fwd}}_{0,T} - F^{\text{fut}}_{0,T} = \frac{\operatorname{Cov}^{\mathbb{Q}}(1/B_T,\, S_T)}{\mathbb{E}^{\mathbb{Q}}[1/B_T]} .

With deterministic interest rates the two prices are equal. When the covariance is negative, as it typically is when STS_T tends to rise with interest rates, the futures price exceeds the forward price. Take two equally likely states with ST=120S_T = 120 and 1/BT=11.11/B_T = \frac{1}{1.1} in the first and ST=80S_T = 80 and 1/BT=11/B_T = 1 in the second. Then Ffut=100F^{\text{fut}} = 100 while Ffwd=208021≈99.0476F^{\text{fwd}} = \frac{2080}{21} \approx 99.0476. For interest rate futures, the gap between a futures rate and the forward rate is the convexity adjustment, and its size depends on the rate model.

Lessons Futures daily settlement and convexity

Forward rate agreements and swaps

On a single deterministic curve, the simple forward rate for an accrual period [T1,T2][T_1, T_2] of year fraction δ\delta is F=(D(0,T1)/D(0,T2)−1)/δF = (D(0,T_1)/D(0,T_2) - 1)/\delta. A forward rate agreement that receives the floating rate and pays the fixed rate KK on notional NN at T2T_2 is worth Nδ D(0,T2)(F−K)N\delta\,D(0,T_2)(F - K). A swap exchanges fixed payments at rate KK for floating payments on the dates T1,…,TnT_1, \ldots, T_n with accrual fractions δk\delta_k, starting at T0T_0. With the annuity A0=∑kδk D(0,Tk)A_0 = \sum_k \delta_k\,D(0,T_k), the two legs and the par swap rate, the fixed rate that gives a new swap zero value, are

PVfixed=NKA0,PVfloat=N∑kδkFk D(0,Tk),Kpar=D(0,T0)−D(0,Tn)A0.\begin{gathered} \text{PV}_{\text{fixed}} = NK A_0, \\[0.4em] \text{PV}_{\text{float}} = N\sum_{k}\delta_kF_k\,D(0,T_k), \\[0.4em] K_{\text{par}} = \frac{D(0,T_0) - D(0,T_n)}{A_0}. \end{gathered}

The floating leg telescopes to N(D(0,T0)−D(0,Tn))N(D(0,T_0) - D(0,T_n)) only when the floating rates are projected from the same curve used for discounting. A receiver swap, which receives fixed, is worth N(K−Kpar)A0N(K - K_{\text{par}})A_0, and a payer swap is worth the negative. With D(0,1)=0.96D(0,1) = 0.96, D(0,2)=0.90D(0,2) = 0.90 and annual accruals, the forwards are 124\frac{1}{24} and 115\frac{1}{15}, A0=1.86A_0 = 1.86 and Kpar=593≈0.05376K_{\text{par}} = \frac{5}{93} \approx 0.05376. On notional 100100, a receiver swap at 5 percent is worth −0.7-0.7, and a forward rate agreement on the second year that receives floating against 5 percent is worth 1.51.5.

Lessons Interest rate swaps and forward rate agreements

Currency forwards and covered interest parity

Quote the exchange rate StS_t as domestic currency units per foreign unit. The reciprocal quote 1/St1/S_t exchanges the roles of the two currencies and their rates. Assume deterministic continuously compounded rates rdr_d and rfr_f, frictionless borrowing and lending in both currencies and no default. Covered interest parity follows from replication,

F0,T=S0 Df(0,T)Dd(0,T)=S0e(rd−rf)T.\begin{gathered} F_{0,T} = S_0\,\frac{D_f(0,T)}{D_d(0,T)} \\[0.4em] = S_0e^{(r_d - r_f)T}. \end{gathered}

Under the domestic pricing measure, with the domestic account as numeraire, the foreign account converted into domestic currency is a traded asset, so StBf(t)/Bd(t)S_tB_f(t)/B_d(t) is a martingale and EQd[ST]=S0e(rd−rf)T\mathbb{E}^{\mathbb{Q}_d}[S_T] = S_0e^{(r_d - r_f)T} when rates are deterministic. With S0=1.2S_0 = 1.2, rd=0.05r_d = 0.05, rf=0.02r_f = 0.02 and T=1T = 1, F=1.2e0.03≈1.236545F = 1.2e^{0.03} \approx 1.236545, and the reciprocal quote has forward 1/F≈0.8087051/F \approx 0.808705. Market forwards can differ from parity, and a cross-currency basis bb records the gap under a stated convention. Adding b=0.005b = 0.005 to the foreign rate gives F=S0e(rd−rf−b)T≈1.230378F = S_0e^{(r_d - r_f - b)T} \approx 1.230378.

Lessons Foreign exchange and covered interest parity

Commodity forwards, storage and convenience yield

For a storable commodity with deterministic rate rr, proportional storage cost uu and convenience yield yy, both continuous annual rates, the net carrying rate is r+u−yr + u - y and

F0,T=S0e(r+u−y)T.F_{0,T} = S_0e^{(r + u - y)T}.

With storage costs of present value U0U_0 and no benefit from holding inventory, F0,T=(S0+U0)/D(0,T)F_{0,T} = (S_0 + U_0)/D(0,T). Buying, storing and delivering always gives the upper bound F0,T≤(S0+U0)/D(0,T)F_{0,T} \le (S_0 + U_0)/D(0,T). The reverse cash-and-carry trade needs inventory that can be borrowed and sold, which is often unavailable, so the lower bound can fail, and the convenience yield measures the benefit of holding the physical good. A curve is in contango when forward prices rise with maturity and in backwardation when they fall. With S0=50S_0 = 50, r=0.04r = 0.04, u=0.03u = 0.03, y=0.02y = 0.02 and T=1T = 1, F≈52.5636F \approx 52.5636, in contango. A convenience yield of 0.100.10 gives F≈48.5223F \approx 48.5223, in backwardation, and an upfront storage cost of 1.51.5 without convenience yield gives F=51.5e0.04≈53.6018F = 51.5e^{0.04} \approx 53.6018.

Lessons Commodity forwards storage and convenience yield

Discrete arbitrage pricing

In a market with finitely many states and trading dates, prices follow from replication and the absence of arbitrage. Replication is a linear system, its dual gives state prices and a pricing measure, and the fundamental theorem says that no arbitrage is the same as the existence of an equivalent martingale measure. Pricing probabilities are weights tied to a numeraire, not forecasts. Throughout, every state has positive physical probability and trading is frictionless unless a topic adds costs.

One-period replication and state prices

With mm states, nn securities, payoff matrix AA and price vector cc, a claim XX is replicated by any θ\theta with Aθ=XA\theta = X, and its price is V0=c⊤θV_0 = c^{\top}\theta. The dual system asks for state prices π\pi with

A⊤π=c,V0=π⊤XA^{\top}\pi = c, \qquad V_0 = \pi^{\top}X

for every attainable XX. The market is free of arbitrage exactly when such a π\pi exists with every πj>0\pi_j > 0. Dividing by the physical probabilities pj>0p_j > 0 gives the pricing kernel, or stochastic discount factor, mj=πj/pjm_j = \pi_j/p_j, with V0=EP[mX]V_0 = \mathbb{E}^{\mathbb{P}}[mX]. The kernel uses physical probabilities, but it is not a probability.

A stock costs 100100 and pays 8080 or 120120, and one unit of cash grows to 1.051.05. The call (0,20)(0, 20) is replicated by 12\frac{1}{2} share and a cash position of −80021≈−38.10-\frac{800}{21} \approx -38.10, so V0=25021≈11.905V_0 = \frac{250}{21} \approx 11.905. The state prices solve 1.05(πd+πu)=11.05(\pi_d + \pi_u) = 1 and 80πd+120πu=10080\pi_d + 120\pi_u = 100, giving πd=514≈0.357\pi_d = \frac{5}{14} \approx 0.357 and πu=2542≈0.595\pi_u = \frac{25}{42} \approx 0.595. With physical probabilities 0.60.6 down and 0.40.4 up, the kernel is about (0.595,1.488)(0.595, 1.488), and a sure payoff of 1010 costs 101.05≈9.524\frac{10}{1.05} \approx 9.524.

Lessons One period replication and state prices

Binomial trees and backward induction

In each period the stock moves from SS to uSuS or dSdS and cash grows by the factor RR, for example R=erΔtR = e^{r\Delta t}. The local no-arbitrage condition is d<R<ud < R < u, and then

q=R−du−d∈(0,1).q = \frac{R - d}{u - d} \in (0, 1).

A claim is priced backward from its payoff. At each node, with VuV_u and VdV_d the values at the two successor nodes,

V=qVu+(1−q)VdR,Δ=Vu−Vd(u−d)S,\begin{gathered} V = \frac{qV_u + (1 - q)V_d}{R}, \\[0.4em] \Delta = \frac{V_u - V_d}{(u - d)S}, \end{gathered}

and the replicating portfolio holds Δ\Delta shares and V−ΔSV - \Delta S in cash. The hedge changes from node to node. For S0=100S_0 = 100, u=1.2u = 1.2, d=0.8d = 0.8, R=1.05R = 1.05 and a two-period call with K=100K = 100, q=58q = \frac{5}{8}, the payoffs are 4444, 00 and 00, Vu=55021V_u = \frac{550}{21}, Vd=0V_d = 0 and V0=6875441≈15.590V_0 = \frac{6875}{441} \approx 15.590, with hedge ratios Δ0=5584\Delta_0 = \frac{55}{84} and Δu=1112\Delta_u = \frac{11}{12}. A tree that approximates a continuous model needs a scaling rule, such as u=eσΔtu = e^{\sigma\sqrt{\Delta t}}, d=e−σΔtd = e^{-\sigma\sqrt{\Delta t}} and R=erΔtR = e^{r\Delta t}, which satisfies d<R<ud < R < u when ∣r∣Δt<σ\lvert r \rvert\sqrt{\Delta t} < \sigma. As the number of steps grows, European prices for suitable payoffs converge to their Black-Scholes values, a result the course states without proof.

Lessons Binomial trees and backward induction

Risk-neutral and physical probabilities

The physical measure P\mathbb{P} describes outcomes and is used for forecasts. A pricing measure Q\mathbb{Q} with the cash account as numeraire must be equivalent to P\mathbb{P}, meaning both give probability zero to the same events, and must make discounted traded prices martingales. In a finite model where every pj>0p_j > 0, equivalence means every qj>0q_j > 0, and the likelihood ratio Zj=qj/pjZ_j = q_j/p_j is positive with EP[Z]=1\mathbb{E}^{\mathbb{P}}[Z] = 1. With a deterministic cash growth factor RR,

V0=EQ[X]R=EP ⁣[Z XR].V_0 = \frac{\mathbb{E}^{\mathbb{Q}}[X]}{R} = \mathbb{E}^{\mathbb{P}}\!\left[\frac{Z\,X}{R}\right].

In the one-period example with P(up)=0.8\mathbb{P}(\text{up}) = 0.8, the physical means are EP[S1]=112\mathbb{E}^{\mathbb{P}}[S_1] = 112 and EP[X]=16\mathbb{E}^{\mathbb{P}}[X] = 16 for the call, while EQ[X]=12.5\mathbb{E}^{\mathbb{Q}}[X] = 12.5 and V0=12.51.05≈11.905V_0 = \frac{12.5}{1.05} \approx 11.905. The likelihood ratio is Z=(1.875,0.78125)Z = (1.875, 0.78125) in the down and up states. Changing the forecast to P(up)=0.4\mathbb{P}(\text{up}) = 0.4 changes the physical mean of the call to 88 but leaves its price unchanged, because the call is replicated.

Lessons Risk neutral probabilities and physical probabilities

Martingales and conditional pricing

A filtration F0⊆F1⊆⋯\mathcal{F}_0 \subseteq \mathcal{F}_1 \subseteq \cdots records what is known at each date, and a trading strategy is predictable, so the holding over (t,t+1](t, t+1] is chosen with the information Ft\mathcal{F}_t. A process MM is a Q\mathbb{Q}-martingale when it is adapted and integrable with EQ[Mt+1∣Ft]=Mt\mathbb{E}^{\mathbb{Q}}[M_{t+1} \mid \mathcal{F}_t] = M_t. A claim XX paid at TT has the price process

Vt=Bt EQ ⁣[XBT | Ft],V_t = B_t\,\mathbb{E}^{\mathbb{Q}}\!\left[\frac{X}{B_T} \,\middle|\, \mathcal{F}_t\right],

so Vt/BtV_t/B_t is a Q\mathbb{Q}-martingale, and in a finite model the discounted gains of every self-financing strategy are martingales too. For a stock that pays dividends, the martingale is the discounted gain process St/Bt+∑k≤tDiv⁡k/BkS_t/B_t + \sum_{k \le t}\operatorname{Div}_k/B_k, not the discounted price. The martingale property belongs to the measure, and under P\mathbb{P} discounted prices usually drift. In the two-period tree with Bt=1.05tB_t = 1.05^{t}, the direct expectation EQ[X/B2]=(58)2⋅44/1.052\mathbb{E}^{\mathbb{Q}}[X/B_2] = (\frac{5}{8})^2 \cdot 44/1.05^2 gives the same 6875441\frac{6875}{441} as backward induction.

Lessons Martingales and discrete conditional pricing

The fundamental theorem of asset pricing

In a finite market with finitely many trading dates, a positive numeraire BB, frictionless trading and every state of positive physical probability, there is no arbitrage if and only if there is a measure Q\mathbb{Q} with qj>0q_j > 0 for every state under which every discounted price S/BS/B is a martingale. In one period this reads

qj>0,∑jqj=1,EQ ⁣[S1B1]=S0B0.\begin{gathered} q_j > 0, \qquad \sum_j q_j = 1, \\[0.4em] \mathbb{E}^{\mathbb{Q}}\!\left[\frac{S_1}{B_1}\right] = \frac{S_0}{B_0}. \end{gathered}

If such a Q\mathbb{Q} exists, every discounted gain vector gg has q⊤g=0q^{\top}g = 0, so no gain can be nonnegative and nonzero. Conversely, if there is no arbitrage, the subspace of discounted gains misses the probability simplex, and the separating hyperplane theorem gives a vector orthogonal to the gains with all entries positive, which normalizes to Q\mathbb{Q}. A multiperiod tree is handled one node at a time. With S0=100S_0 = 100, S1∈{80,120}S_1 \in \{80, 120\} and R=1.05R = 1.05, qu=105−8040=58q_u = \frac{105 - 80}{40} = \frac{5}{8}. If instead S0=1201.05≈114.29S_0 = \frac{120}{1.05} \approx 114.29, the only martingale weights are qu=1q_u = 1 and qd=0q_d = 0, which are not equivalent, and shorting the stock while investing the proceeds pays 4040 in the down state and 00 in the up state at zero cost, an arbitrage.

Lessons The fundamental theorem of asset pricing

Completeness and price intervals

The attainable claims form the column space of AA, and the market is complete when every claim is attainable, which in a one-period model with mm states means rank⁡(A)=m\operatorname{rank}(A) = m. Under no arbitrage, a finite market is complete if and only if the equivalent martingale measure is unique. In an incomplete market, a claim that is not attainable has no single arbitrage-free price. Its arbitrage-free prices form the open interval between the infimum and the supremum of EQ[X/BT]\mathbb{E}^{\mathbb{Q}}[X/B_T] over the equivalent martingale measures. The superhedging price, the least cost of a portfolio with Aθ≥XA\theta \ge X, is the upper end, and the subhedging price is the lower end.

With S0=100S_0 = 100, S1∈{80,100,120}S_1 \in \{80, 100, 120\} and zero interest, the martingale measures are Q=(a,1−2a,a)\mathbb{Q} = (a, 1 - 2a, a) with 0<a<120 < a < \frac{1}{2}. The claim (0,0,20)(0, 0, 20) then has arbitrage-free prices 20a20a, the open interval (0,10)(0, 10). Half a share with a cash position of −40-40 costs 1010 and pays (0,10,20)≥X(0, 10, 20) \ge X, the cheapest superhedge, and the zero portfolio is the best subhedge. Adding a traded security whose payoff is not in the column space completes this market.

Lessons Market completeness and nonunique prices

American options and optimal stopping

An exercise rule is a stopping time τ\tau, a random time with {τ≤t}∈Ft\{\tau \le t\} \in \mathcal{F}_t for every tt, taking values among the allowed exercise dates. With exercise value HtH_t and discounted payoff Zt=Ht/BtZ_t = H_t/B_t, the Snell envelope is computed backward,

YT=ZT,Yt=max⁡(Zt, EQ[Yt+1∣Ft]),\begin{gathered} Y_T = Z_T, \\[0.4em] Y_t = \max\big(Z_t,\ \mathbb{E}^{\mathbb{Q}}[Y_{t+1} \mid \mathcal{F}_t]\big), \end{gathered}

and the price is Vt=BtYtV_t = B_tY_t. The process YY is the smallest Q\mathbb{Q}-supermartingale above ZZ, and exercising at the first date with Yt=ZtY_t = Z_t is optimal. The continuation value is Bt EQ[Yt+1∣Ft]B_t\,\mathbb{E}^{\mathbb{Q}}[Y_{t+1} \mid \mathcal{F}_t], and the early exercise premium VAm−VEurV^{\text{Am}} - V^{\text{Eur}} is nonnegative. Without dividends and with r≥0r \ge 0, early exercise of an American call is never optimal, so its price equals the European price. For the put with K=100K = 100 in the two-period tree, the terminal payoffs are 00, 44 and 3636. At the down node, exercise pays 2020 against a continuation value of 161.05≈15.24\frac{16}{1.05} \approx 15.24, so the holder exercises. The American price is about 7.9937.993 and the European price about 6.2936.293.

Lessons American options and optimal stopping

Transaction costs and price bounds

With proportional costs λ\lambda, shares are bought at the ask (1+λ)S(1 + \lambda)S and sold at the bid (1−λ)S(1 - \lambda)S, so long positions are liquidated at the bid and short positions are covered at the ask. The seller’s bound, the superreplication price V‾(X)\overline{V}(X), is the least initial cost of a strategy whose terminal liquidation value is at least XX in every state, and the buyer’s bound is V‾(X)=−V‾(−X)\underline{V}(X) = -\overline{V}(-X). A price outside [V‾,V‾][\underline{V}, \overline{V}] allows an arbitrage, and prices inside are consistent with some shadow price, a frictionless price process between the bid and the ask that admits an equivalent martingale measure.

With S0=100S_0 = 100, ST∈{80,120}S_T \in \{80, 120\}, R=1.05R = 1.05, λ=0.01\lambda = 0.01 and the cash-settled call (0,20)(0, 20), the seller buys 20118.8−79.2=5099\frac{20}{118.8 - 79.2} = \frac{50}{99} shares at 101101 and borrows 80021\frac{800}{21}, so V‾≈12.915\overline{V} \approx 12.915. The buyer’s hedge shorts 50101\frac{50}{101} shares at 9999 and lends 80021\frac{800}{21}, so V‾≈10.915\underline{V} \approx 10.915. The frictionless price 11.90511.905 lies inside.

Lessons Transaction costs and no arbitrage price intervals

Stochastic calculus

Continuous-time models need precise rules for information, noise and integration. Brownian motion has independent Gaussian increments and a nonzero quadratic variation, and that one fact produces the second-order term in Itô’s lemma. The Itô integral uses left endpoints, so it is a martingale for suitable integrands, and Girsanov’s theorem changes the drift of a Brownian motion when the measure changes. Statements are on a filtered probability space (Ω,F,(Ft),P)(\Omega, \mathcal{F}, (\mathcal{F}_t), \mathbb{P}) on a finite horizon [0,T][0, T].

Filtrations, predictable processes and stopping times

A filtration (Ft)(\mathcal{F}_t) is an increasing family of sigma algebras, Fs⊆Ft\mathcal{F}_s \subseteq \mathcal{F}_t for s≤ts \le t, and a process is adapted when each XtX_t is Ft\mathcal{F}_t-measurable. A discrete strategy is predictable when the holding HkH_k used over (tk,tk+1](t_k, t_{k+1}] is Ftk\mathcal{F}_{t_k}-measurable, and its gain is Gn=∑k=0n−1Hk(Sk+1−Sk)G_n = \sum_{k=0}^{n-1}H_k(S_{k+1} - S_k). In continuous time the predictable sigma algebra is generated by the adapted left-continuous processes. A stopping time is a random time with {τ≤t}∈Ft\{\tau \le t\} \in \mathcal{F}_t for every tt, so whether it has occurred is known at each date. The first time τH=inf⁡{t≥0:St≤H}\tau_H = \inf\{t \ge 0 : S_t \le H\} that a continuous adapted price falls to a level HH is one. The usual conditions ask that F0\mathcal{F}_0 contain the null sets and that the filtration be right-continuous.

If SS is a martingale and HH is bounded and predictable, then E[Gn]=0\mathbb{E}[G_n] = 0. With two fair increments of ±1\pm 1, holding 11 share first and then 22 shares after an up move or none after a down move gives the gains 33, −1-1, −1-1, −1-1 with mean 00. A rule that holds a share over the second period only when that period’s increment will be +1+1 uses future information. It is anticipatory, not admissible, and earns a mean gain of 12\frac{1}{2}.

Lessons Stochastic processes filtrations and stopping times

Brownian motion

A standard Brownian motion with respect to (Ft)(\mathcal{F}_t) has W0=0W_0 = 0, continuous paths, and increments Wt−Ws∼N(0,t−s)W_t - W_s \sim N(0, t - s) for s<ts < t that are independent of Fs\mathcal{F}_s. Consequently

Cov⁡(Ws,Wt)=min⁡(s,t),ph(x,y)=12πh e−(y−x)2/(2h),\begin{gathered} \operatorname{Cov}(W_s, W_t) = \min(s, t), \\[0.4em] p_h(x, y) = \frac{1}{\sqrt{2\pi h}}\,e^{-(y - x)^2/(2h)}, \end{gathered}

where php_h is the transition density over a time step h>0h > 0. For c>0c > 0, the scaled process (c−1/2Wct)t≥0(c^{-1/2}W_{ct})_{t \ge 0} is again a standard Brownian motion, an equality in law of whole paths. That Brownian motion exists and that its paths are nowhere differentiable are theorems the course states. Brownian motion is a model of noise, not a claim that prices have this law. Over a step of 0.250.25 years a standard normal draw of 1.21.2 moves WW by 0.25⋅1.2=0.6\sqrt{0.25}\cdot 1.2 = 0.6, and

P(Ws+0.25>1∣Ws=0.3)=1−Φ(1.4)≈0.0808.\begin{gathered} \mathbb{P}(W_{s+0.25} > 1 \mid W_s = 0.3) \\[0.4em] = 1 - \Phi(1.4) \approx 0.0808 . \end{gathered}

Lessons Brownian motion and Gaussian increments

Quadratic variation

For a partition π\pi of [0,T][0, T] with mesh ∣π∣\lvert \pi \rvert, the sum Qπ=∑k(Wtk+1−Wtk)2Q_\pi = \sum_k (W_{t_{k+1}} - W_{t_k})^2 has mean TT and variance 2∑k(Δtk)2≤2T∣π∣2\sum_k(\Delta t_k)^2 \le 2T\lvert \pi \rvert. Hence Qπ→TQ_\pi \to T in mean square, and in probability by Chebyshev’s inequality, as the mesh goes to 00. This limit is the quadratic variation, [W]T=T[W]_T = T. A continuous function AA of finite variation has zero quadratic variation, since ∑k(ΔAk)2≤max⁡k∣ΔAk∣ TV⁡(A)→0\sum_k(\Delta A_k)^2 \le \max_k\lvert \Delta A_k \rvert\,\operatorname{TV}(A) \to 0, so Brownian paths have infinite variation on every interval with probability one. For Itô processes dX=b dt+σ dWdX = b\,dt + \sigma\,dW and dY=c dt+η dW′dY = c\,dt + \eta\,dW' with d[W,W′]t=ρt dtd[W, W']_t = \rho_t\,dt,

[X]T=∫0Tσs2 ds,[X,Y]T=∫0Tρsσsηs ds.\begin{gathered} [X]_T = \int_0^T \sigma_s^2\,ds, \\[0.4em] [X, Y]_T = \int_0^T \rho_s\sigma_s\eta_s\,ds . \end{gathered}

On an even grid of nn steps over [0,1][0, 1], the variance of QnQ_n is 2n\frac{2}{n}, so 0.020.02 for n=100n = 100 and 0.00020.0002 for n=10,000n = 10{,}000. The function 3t3t has a grid sum of 9n\frac{9}{n}, which tends to 00, while [3W]1=9[3W]_1 = 9.

Lessons Quadratic variation and stochastic limits

The Itô integral and isometry

For a simple predictable integrand Ht=∑kHk1(tk,tk+1](t)H_t = \sum_k H_k\mathbf{1}_{(t_k, t_{k+1}]}(t), with each HkH_k square-integrable and Ftk\mathcal{F}_{t_k}-measurable, the Itô integral is ∫0THt dWt=∑kHk(Wtk+1−Wtk)\int_0^T H_t\,dW_t = \sum_k H_k(W_{t_{k+1}} - W_{t_k}), with the integrand frozen at the left endpoint. It satisfies the Itô isometry

E[(∫0THt dWt)2]=E[∫0THt2 dt],\begin{aligned} &\mathbb{E}\Big[\Big(\int_0^T H_t\,dW_t\Big)^2\Big] \\[0.4em] &\quad = \mathbb{E}\Big[\int_0^T H_t^2\,dt\Big], \end{aligned}

and the isometry extends the integral by mean-square limits to predictable HH with E∫0THt2 dt<∞\mathbb{E}\int_0^T H_t^2\,dt < \infty. For such HH, Mt=∫0tHs dWsM_t = \int_0^t H_s\,dW_s is a square-integrable martingale with mean zero, and E[∫H dW∫K dW]=E∫HK dt\mathbb{E}\big[\int H\,dW\int K\,dW\big] = \mathbb{E}\int HK\,dt. When only ∫0THt2 dt<∞\int_0^T H_t^2\,dt < \infty holds almost surely, the integral is defined but in general only a local martingale. The timing convention changes answers,

∫0tWs dWs=12(Wt2−t),\int_0^t W_s\,dW_s = \tfrac{1}{2}\big(W_t^2 - t\big),

while the midpoint (Stratonovich) convention gives 12Wt2\frac{1}{2}W_t^2. If H=2H = 2 on (0,12](0, \frac{1}{2}] and then H=1H = 1 or 33 according to whether W1/2>0W_{1/2} > 0, the integral over [0,1][0, 1] has mean 00 and second moment 4⋅12+12(1+9)⋅12=4.54 \cdot \frac{1}{2} + \frac{1}{2}(1 + 9)\cdot\frac{1}{2} = 4.5.

Lessons The Ito integral and isometry

Itô’s lemma

Let dXt=bt dt+σt dWtdX_t = b_t\,dt + \sigma_t\,dW_t be an Itô process and f(t,x)f(t, x) continuously differentiable once in tt and twice in xx. Then

df(t,Xt)=ft dt+fx dXt+12fxx σt2 dt,\begin{aligned} df(t, X_t) &= f_t\,dt + f_x\,dX_t \\[0.4em] &\quad + \tfrac{1}{2}f_{xx}\,\sigma_t^2\,dt, \end{aligned}

with derivatives evaluated at (t,Xt)(t, X_t). So f(t,Xt)f(t, X_t) has the drift ft+btfx+12σt2fxxf_t + b_tf_x + \frac{1}{2}\sigma_t^2f_{xx} and the diffusion coefficient σtfx\sigma_tf_x. The second-order term comes from (dWt)2=dt(dW_t)^2 = dt, with dt dWt=0dt\,dW_t = 0 and (dt)2=0(dt)^2 = 0. Two cases are used everywhere. First, d(Xt2)=2Xt dXt+σt2 dtd(X_t^2) = 2X_t\,dX_t + \sigma_t^2\,dt. Second, for dS=μS dt+σS dWdS = \mu S\,dt + \sigma S\,dW with S>0S > 0,

dln⁡St=(μ−12σ2) dt+σ dWt.\begin{aligned} d\ln S_t &= \big(\mu - \tfrac{1}{2}\sigma^2\big)\,dt \\[0.4em] &\quad + \sigma\,dW_t . \end{aligned}

For dX=b dt+Σ dWdX = b\,dt + \Sigma\,dW with a vector WW of independent Brownian motions and a=ΣΣ⊤a = \Sigma\Sigma^{\top}, the generator is Lf=b⊤∇f+12tr⁡(a∇2f)\mathcal{L}f = b^{\top}\nabla f + \frac{1}{2}\operatorname{tr}(a\nabla^2 f), and df=(ft+Lf) dt+∇f⊤Σ dWdf = (f_t + \mathcal{L}f)\,dt + \nabla f^{\top}\Sigma\,dW. The product rule is d(XY)=X dY+Y dX+d[X,Y]d(XY) = X\,dY + Y\,dX + d[X, Y]. For two geometric Brownian motions with drifts 0.080.08 and 0.060.06, volatilities 0.20.2 and 0.30.3 and correlation 0.50.5, the product has drift rate 0.08+0.06+0.5⋅0.2⋅0.3=0.170.08 + 0.06 + 0.5 \cdot 0.2 \cdot 0.3 = 0.17, so from X0=100X_0 = 100 and Y0=50Y_0 = 50, E[X1Y1]=5000e0.17≈5926.5\mathbb{E}[X_1Y_1] = 5000e^{0.17} \approx 5926.5. With correlation −0.5-0.5 it is 5000e0.11≈5581.45000e^{0.11} \approx 5581.4.

Lessons Ito lemma and the stochastic chain rule

Stochastic differential equations

The equation dXt=b(t,Xt) dt+σ(t,Xt) dWtdX_t = b(t, X_t)\,dt + \sigma(t, X_t)\,dW_t with initial value X0X_0 means the integral equation Xt=X0+∫0tb(s,Xs) ds+∫0tσ(s,Xs) dWsX_t = X_0 + \int_0^t b(s, X_s)\,ds + \int_0^t \sigma(s, X_s)\,dW_s. A strong solution is an adapted process that satisfies it on a given probability space with a given Brownian motion. A weak solution may use some other space and Brownian motion, and only its law is fixed. Pathwise uniqueness says that two solutions with the same Brownian motion and initial value agree almost surely.

The course states the following theorem with a Picard and Gronwall argument. Suppose that for all tt, xx and yy the coefficients satisfy a global Lipschitz condition, ∣b(t,x)−b(t,y)∣≤L∣x−y∣\lvert b(t,x) - b(t,y) \rvert \le L\lvert x - y \rvert and the same bound for σ\sigma, and a linear growth condition, ∣b(t,x)∣+∣σ(t,x)∣≤K(1+∣x∣)\lvert b(t,x) \rvert + \lvert \sigma(t,x) \rvert \le K(1 + \lvert x \rvert). If X0X_0 is independent of WW with E[X02]<∞\mathbb{E}[X_0^2] < \infty, then a unique strong solution exists. The Ornstein-Uhlenbeck process, which reverts toward the level θ\theta at speed κ>0\kappa > 0, solves dX=κ(θ−X) dt+σ dWdX = \kappa(\theta - X)\,dt + \sigma\,dW and has the explicit form

Xt=θ+(X0−θ)e−κt+σ∫0te−κ(t−s) dWs,\begin{aligned} X_t &= \theta + (X_0 - \theta)e^{-\kappa t} \\[0.4em] &\quad + \sigma\int_0^t e^{-\kappa(t-s)}\,dW_s, \end{aligned}

which given X0X_0 is Gaussian with mean θ+(X0−θ)e−κt\theta + (X_0 - \theta)e^{-\kappa t} and variance σ22κ(1−e−2κt)\frac{\sigma^2}{2\kappa}(1 - e^{-2\kappa t}). With X0=0.02X_0 = 0.02, θ=0.04\theta = 0.04, κ=0.5\kappa = 0.5, σ=0.01\sigma = 0.01 and t=2t = 2, the mean is about 0.032640.03264 and the variance about 8.65×10−58.65 \times 10^{-5}. One Euler step Xn+1=Xn+κ(θ−Xn)h+σh ZnX_{n+1} = X_n + \kappa(\theta - X_n)h + \sigma\sqrt{h}\,Z_n of length h=0.1h = 0.1 with Zn=1Z_n = 1 gives 0.0241620.024162. It approximates the exact transition and does not reproduce it.

Lessons Stochastic differential equations and solution concepts

Measure changes and exponential martingales

A positive random variable ZTZ_T with EP[ZT]=1\mathbb{E}^{\mathbb{P}}[Z_T] = 1 defines an equivalent measure by Q(A)=EP[ZT1A]\mathbb{Q}(A) = \mathbb{E}^{\mathbb{P}}[Z_T\mathbf{1}_{A}], so ZT=dQ/dPZ_T = d\mathbb{Q}/d\mathbb{P} is its Radon-Nikodym derivative, with density process Zt=EP[ZT∣Ft]Z_t = \mathbb{E}^{\mathbb{P}}[Z_T \mid \mathcal{F}_t] and the conditional Bayes formula

EQ[X∣Ft]=EP[ZTX∣Ft]Zt.\mathbb{E}^{\mathbb{Q}}[X \mid \mathcal{F}_t] = \frac{\mathbb{E}^{\mathbb{P}}[Z_TX \mid \mathcal{F}_t]}{Z_t} .

For an adapted λ\lambda with ∫0Tλs2 ds<∞\int_0^T\lambda_s^2\,ds < \infty almost surely, the stochastic exponential

Zt=exp⁡(−∫0tλs dWs−12∫0tλs2 ds)\begin{aligned} Z_t = \exp\Big(&-\int_0^t \lambda_s\,dW_s \\[0.4em] &- \tfrac{1}{2}\int_0^t \lambda_s^2\,ds\Big) \end{aligned}

solves dZt=−Ztλt dWtdZ_t = -Z_t\lambda_t\,dW_t. It is a positive local martingale and a supermartingale, and it is a true martingale, with EP[ZT]=1\mathbb{E}^{\mathbb{P}}[Z_T] = 1, under Novikov’s condition EP[exp⁡(12∫0Tλs2 ds)]<∞\mathbb{E}^{\mathbb{P}}\big[\exp\big(\frac{1}{2}\int_0^T\lambda_s^2\,ds\big)\big] < \infty. For constant λ\lambda, EP[ZT2]=eλ2T\mathbb{E}^{\mathbb{P}}[Z_T^2] = e^{\lambda^2T} and WT∼N(−λT,T)W_T \sim N(-\lambda T, T) under Q\mathbb{Q}. With λ=0.25\lambda = 0.25 and T=2T = 2, EP[ZT2]=e0.125≈1.133\mathbb{E}^{\mathbb{P}}[Z_T^2] = e^{0.125} \approx 1.133 and WTW_T has mean −0.5-0.5 under Q\mathbb{Q}. In a finite example, weights 0.40.4, 0.80.8, 1.21.2 and 1.61.6 on four equally likely states have mean 11 and give Q=(0.1,0.2,0.3,0.4)\mathbb{Q} = (0.1, 0.2, 0.3, 0.4).

Lessons Exponential martingales and measure changes

Girsanov’s theorem and risk-neutral dynamics

Let WW be a P\mathbb{P}-Brownian motion on [0,T][0, T] and λ\lambda adapted with ∫0Tλs2 ds<∞\int_0^T\lambda_s^2\,ds < \infty almost surely, and suppose the stochastic exponential ZZ above is a true martingale, for example under Novikov’s condition. With dQ/dP=ZTd\mathbb{Q}/d\mathbb{P} = Z_T on FT\mathcal{F}_T, the process

WtQ=Wt+∫0tλs dsW^{\mathbb{Q}}_t = W_t + \int_0^t \lambda_s\,ds

is a Q\mathbb{Q}-Brownian motion on [0,T][0, T]. With this density convention the drift enters with a plus sign, and an Itô process dX=b dt+σ dWdX = b\,dt + \sigma\,dW becomes dX=(b−σλ) dt+σ dWQdX = (b - \sigma\lambda)\,dt + \sigma\,dW^{\mathbb{Q}}. The proof combines the Bayes formula, the product rule and Lévy’s characterization, which says that a continuous local martingale MM with M0=0M_0 = 0 and [M]t=t[M]_t = t is a Brownian motion. For a stock with price drift μ\mu, volatility σ>0\sigma > 0 and dividend yield qq, and a constant rate rr, the market price of risk is λ=(μ+q−r)/σ\lambda = (\mu + q - r)/\sigma, and under Q\mathbb{Q}

dSt=(r−q)St dt+σSt dWtQ.\begin{aligned} dS_t &= (r - q)S_t\,dt \\[0.4em] &\quad + \sigma S_t\,dW^{\mathbb{Q}}_t . \end{aligned}

With several Brownian factors and volatility matrix Σt\Sigma_t, the condition becomes Σtλt=μt+qt−rt1\Sigma_t\lambda_t = \mu_t + q_t - r_t\mathbf{1}, which must have a solution. With μ=0.08\mu = 0.08, q=0q = 0, r=0.03r = 0.03 and σ=0.2\sigma = 0.2, λ=0.25\lambda = 0.25 and the Q\mathbb{Q} drift is 0.08−0.2⋅0.25=0.030.08 - 0.2 \cdot 0.25 = 0.03, so EQ[S1]=100e0.03≈103.05\mathbb{E}^{\mathbb{Q}}[S_1] = 100e^{0.03} \approx 103.05 and its discounted value is 100100.

Lessons Girsanov theorem and risk neutral dynamics

Continuous time derivative pricing

In the Black-Scholes model a continuously rebalanced position in the stock and the cash account replicates an option, so the option price solves a partial differential equation that does not involve the stock’s drift. The Feynman-Kac formula writes the solution as a discounted risk-neutral expectation, Gaussian integrals give closed formulas, and their derivatives are the Greeks. Hedging at discrete dates leaves an error, and early exercise turns the pricing equation into a free boundary problem.

Geometric Brownian motion

For constants μ\mu and σ>0\sigma > 0, the equation dSt=μSt dt+σSt dWtdS_t = \mu S_t\,dt + \sigma S_t\,dW_t with S0>0S_0 > 0 has the unique solution

St=S0 e(μ−σ2/2)t+σWt,S_t = S_0\,e^{(\mu - \sigma^2/2)t + \sigma W_t},

so St>0S_t > 0 and ln⁡(St/S0)∼N((μ−12σ2)t, σ2t)\ln(S_t/S_0) \sim N\big((\mu - \frac{1}{2}\sigma^2)t,\ \sigma^2t\big), a lognormal law. For every real pp,

E[St p]=S0 p e[pμ+12p(p−1)σ2]t,\mathbb{E}[S_t^{\,p}] = S_0^{\,p}\,e^{[p\mu + \frac{1}{2}p(p-1)\sigma^2]t},

so the mean is S0eμtS_0e^{\mu t}, the variance is S02e2μt(eσ2t−1)S_0^2e^{2\mu t}(e^{\sigma^2t} - 1) and the median is S0e(μ−σ2/2)tS_0e^{(\mu - \sigma^2/2)t}, below the mean. Exact simulation uses St+h=Stexp⁡((μ−12σ2)h+σh Z)S_{t+h} = S_t\exp\big((\mu - \frac{1}{2}\sigma^2)h + \sigma\sqrt{h}\,Z\big) with Z∼N(0,1)Z \sim N(0, 1). With S0=100S_0 = 100, μ=0.08\mu = 0.08, σ=0.2\sigma = 0.2 and t=1t = 1, the mean is 108.33108.33, the median 106.18106.18 and the variance 478.92478.92. The draw Z=1Z = 1 gives 100e0.26≈129.69100e^{0.26} \approx 129.69, while one Euler step with the same draw gives 128128.

Lessons Geometric Brownian motion and exact distributions

The Black-Scholes equation

Assume frictionless continuous trading with short sales, a stock following geometric Brownian motion with constant σ>0\sigma > 0 and dividend yield qq, a constant rate rr, and no arbitrage. If an option’s value is V(t,S)V(t, S) with VV continuously differentiable in tt and twice in SS, then holding Δt=VS(t,St)\Delta_t = V_S(t, S_t) shares and financing the rest in the cash account is self-financing and replicates the option exactly when

Vt+12σ2S2VSS+(r−q)SVS−rV=0\begin{aligned} &V_t + \tfrac{1}{2}\sigma^2S^2V_{SS} \\[0.4em] &\quad + (r - q)SV_S - rV = 0 \end{aligned}

on [0,T)×(0,∞)[0, T) \times (0, \infty), with the terminal condition V(T,S)=g(S)V(T, S) = g(S). The drift μ\mu cancels and does not appear. A call has C(t,0)=0C(t, 0) = 0 and C∼Se−qτ−Ke−rτC \sim Se^{-q\tau} - Ke^{-r\tau} as S→∞S \to \infty, and a put has P(t,0)=Ke−rτP(t, 0) = Ke^{-r\tau} and P→0P \to 0 as S→∞S \to \infty. With q=0q = 0, the claim paying ST2/100S_T^2/100 has the value V=S2100e(r+σ2)τV = \frac{S^2}{100}e^{(r + \sigma^2)\tau}, and substituting Vt=−(r+σ2)VV_t = -(r + \sigma^2)V, VS=2V/SV_S = 2V/S and VSS=2V/S2V_{SS} = 2V/S^2 gives zero. At S=100S = 100 with r=0.05r = 0.05, σ=0.2\sigma = 0.2 and τ=1\tau = 1, V≈109.417V \approx 109.417 and the hedge holds Δ≈2.188\Delta \approx 2.188 shares.

Lessons Black Scholes replication and the pricing PDE

The Feynman-Kac formula

Let XX solve dX=b(t,X) dt+Σ(t,X) dWdX = b(t, X)\,dt + \Sigma(t, X)\,dW with generator L\mathcal{L}, and let uu be a classical solution of

ut+Lu−c u+f=0,u(T,x)=g(x),\begin{gathered} u_t + \mathcal{L}u - c\,u + f = 0, \\[0.4em] u(T, x) = g(x), \end{gathered}

with cc bounded below, in a class of controlled growth such as polynomial growth, under coefficient conditions that make the stochastic integral in the proof a true martingale. With Γt,s=e−∫tsc(v,Xv) dv\Gamma_{t,s} = e^{-\int_t^s c(v, X_v)\,dv}, the solution is

u(t,x)=Et,x[Γt,T g(XT)+∫tTΓt,s f(s,Xs) ds],\begin{gathered} u(t, x) = \mathbb{E}_{t,x}\Big[\Gamma_{t,T}\,g(X_T) \\[0.4em] + \int_t^T \Gamma_{t,s}\,f(s, X_s)\,ds\Big], \end{gathered}

where Et,x\mathbb{E}_{t,x} starts the process at Xt=xX_t = x, and it is the unique solution in that class. For the Black-Scholes equation, Lu=(r−q)xux+12σ2x2uxx\mathcal{L}u = (r - q)xu_x + \frac{1}{2}\sigma^2x^2u_{xx}, c=rc = r and f=0f = 0, so the generator itself fixes the measure and

u(t,x)=e−rτ Et,xQ[g(ST)].u(t, x) = e^{-r\tau}\,\mathbb{E}^{\mathbb{Q}}_{t,x}[g(S_T)].

Outside the growth class uniqueness can fail, since the heat equation has nonzero solutions with zero initial data. With q=0q = 0, g(x)=x2/40g(x) = x^2/40, r=0.03r = 0.03, σ=0.25\sigma = 0.25 and τ=2\tau = 2, the formula gives u=x240e(r+σ2)τu = \frac{x^2}{40}e^{(r + \sigma^2)\tau}, so u(0,40)=40e0.185≈48.129u(0, 40) = 40e^{0.185} \approx 48.129.

Lessons Feynman Kac and discounted expectations

The Black-Scholes formula and put-call parity

Under the Black-Scholes assumptions, with S,K,σ,τ>0S, K, \sigma, \tau > 0, a European call and put on a stock with dividend yield qq are worth

C=Se−qτΦ(d1)−Ke−rτΦ(d2),P=Ke−rτΦ(−d2)−Se−qτΦ(−d1),\begin{aligned} C &= Se^{-q\tau}\Phi(d_1) \\[0.4em] &\quad - Ke^{-r\tau}\Phi(d_2), \\[0.4em] P &= Ke^{-r\tau}\Phi(-d_2) \\[0.4em] &\quad - Se^{-q\tau}\Phi(-d_1), \end{aligned}

where

d1=ln⁡(S/K)+(r−q)τστ+12στ,d2=d1−στ.\begin{aligned} d_1 &= \frac{\ln(S/K) + (r - q)\tau}{\sigma\sqrt{\tau}} \\[0.4em] &\quad + \tfrac{1}{2}\sigma\sqrt{\tau}, \\[0.4em] d_2 &= d_1 - \sigma\sqrt{\tau}. \end{aligned}

The formula follows from the payoff integral with E[eaZ1{Z>b}]=ea2/2Φ(a−b)\mathbb{E}[e^{aZ}\mathbf{1}_{\{Z > b\}}] = e^{a^2/2}\Phi(a - b) for standard normal ZZ. Here Φ(d2)=Q(ST>K)\Phi(d_2) = \mathbb{Q}(S_T > K) is the risk-neutral exercise probability. The physical probability P(ST>K)\mathbb{P}(S_T > K) uses the drift μ\mu in place of r−qr - q and is a different number. As τ→0\tau \to 0 the call tends to (S−K)+(S - K)^{+}, and as σ→0\sigma \to 0 it tends to (Se−qτ−Ke−rτ)+(Se^{-q\tau} - Ke^{-r\tau})^{+}.

Put-call parity holds for European options with the same strike and maturity under no arbitrage alone, from the payoff identity (ST−K)+−(K−ST)+=ST−K(S_T - K)^{+} - (K - S_T)^{+} = S_T - K,

C−P=Se−qτ−Ke−rτ.C - P = Se^{-q\tau} - Ke^{-r\tau}.

American options satisfy only inequalities, for example S−K≤C−P≤S−Ke−rτS - K \le C - P \le S - Ke^{-r\tau} on a stock without dividends when r≥0r \ge 0. With S=100S = 100, K=105K = 105, r=0.05r = 0.05, q=0.02q = 0.02, σ=0.2\sigma = 0.2 and τ=1\tau = 1, d1≈0.006049d_1 \approx 0.006049 and d2≈−0.193951d_2 \approx -0.193951, the call is worth 6.98696.9869 and the put 8.84618.8461, and both sides of parity equal −1.8592-1.8592.

Lessons The Black Scholes formula and put call parity

Greeks

The Greeks are partial derivatives of the model price with the other inputs held fixed. Theta is the derivative in calendar time tt at fixed maturity, so Θ=−∂C/∂τ\Theta = -\partial C/\partial\tau. For the call, with φ\varphi the standard normal density,

GreekCall formulaUnits
delta ∂C/∂S\partial C/\partial Se−qτΦ(d1)e^{-q\tau}\Phi(d_1)shares
gamma ∂2C/∂S2\partial^2C/\partial S^2e−qτφ(d1)Sστ\dfrac{e^{-q\tau}\varphi(d_1)}{S\sigma\sqrt{\tau}}per currency unit
vega ∂C/∂σ\partial C/\partial\sigmaSe−qτφ(d1)τSe^{-q\tau}\varphi(d_1)\sqrt{\tau}currency per unit of σ\sigma
rho ∂C/∂r\partial C/\partial rKτe−rτΦ(d2)K\tau e^{-r\tau}\Phi(d_2)currency per unit of rr
Θ=−Se−qτφ(d1) σ2τ+qSe−qτΦ(d1)−rKe−rτΦ(d2).\begin{aligned} \Theta &= -\frac{Se^{-q\tau}\varphi(d_1)\,\sigma}{2\sqrt{\tau}} \\[0.4em] &\quad + qSe^{-q\tau}\Phi(d_1) \\[0.4em] &\quad - rKe^{-r\tau}\Phi(d_2). \end{aligned}

The put has delta −e−qτΦ(−d1)-e^{-q\tau}\Phi(-d_1) and rho −Kτe−rτΦ(−d2)-K\tau e^{-r\tau}\Phi(-d_2), and the same gamma and vega as the call. The identity Se−qτφ(d1)=Ke−rτφ(d2)Se^{-q\tau}\varphi(d_1) = Ke^{-r\tau}\varphi(d_2) simplifies the derivatives, vega equals S2στ ΓS^2\sigma\tau\,\Gamma, and the pricing equation becomes Θ+12σ2S2Γ+(r−q)SΔ−rC=0\Theta + \frac{1}{2}\sigma^2S^2\Gamma + (r - q)S\Delta - rC = 0. Theta here is per year. Per calendar day under a 365-day convention it is Θ/365\Theta/365, and a vega per volatility point is ν/100\nu/100. At S=K=100S = K = 100, r=q=0r = q = 0, σ=0.2\sigma = 0.2 and τ=1\tau = 1, the call is worth 7.96567.9656, with Δ≈0.5398\Delta \approx 0.5398, Γ≈0.019848\Gamma \approx 0.019848, ν≈39.695\nu \approx 39.695, Θ≈−3.9695\Theta \approx -3.9695 per year (about −0.0109-0.0109 per day) and ρ≈46.017\rho \approx 46.017.

Lessons Greeks and differential identities

Discrete delta hedging and hedging error

Hold an option priced with model volatility σm\sigma_m and short Δ=VS\Delta = V_S shares, rebalanced at intervals hh, with r=q=0r = q = 0 for simplicity. Over one interval, to second order and with the pricing equation Θ=−12σm2S2Γ\Theta = -\frac{1}{2}\sigma_m^2S^2\Gamma,

ΔΠ≈Θh+12Γ(ΔS)2=12Γ[(ΔS)2−σm2S2h].\begin{aligned} \Delta\Pi &\approx \Theta h + \tfrac{1}{2}\Gamma(\Delta S)^2 \\[0.4em] &= \tfrac{1}{2}\Gamma\big[(\Delta S)^2 - \sigma_m^2S^2h\big]. \end{aligned}

If the stock actually moves with volatility σa\sigma_a, then to leading order E[ΔΠ∣Ft]≈12ΓS2(σa2−σm2)h\mathbb{E}[\Delta\Pi \mid \mathcal{F}_t] \approx \frac{1}{2}\Gamma S^2(\sigma_a^2 - \sigma_m^2)h and Var⁡(ΔΠ∣Ft)≈12Γ2σa4S4h2\operatorname{Var}(\Delta\Pi \mid \mathcal{F}_t) \approx \frac{1}{2}\Gamma^2\sigma_a^4S^4h^2. A long gamma position gains when realized variance exceeds the variance used for pricing, and the total error is a gamma-weighted sum of the differences between realized and model variance. Even with σa=σm\sigma_a = \sigma_m, the standard deviation of the total hedging error shrinks only like h\sqrt{h}. A jump JJ leaves the residual V(S+J)−V(S)−VSJV(S + J) - V(S) - V_SJ, which no delta position removes. With S=100S = 100, Γ=0.02\Gamma = 0.02, σm=0.2\sigma_m = 0.2, σa=0.3\sigma_a = 0.3 and h=1252h = \frac{1}{252}, the expected one-day gain is about 0.01980.0198. A move of ΔS=10\Delta S = 10 in one day gives about 0.9840.984.

Lessons Discrete delta hedging and hedging error

Digital options and the risk-neutral density

A cash-or-nothing digital call pays 1{ST>K}\mathbf{1}_{\{S_T > K\}}. Take call prices C(K)C(K) for all strikes at one maturity, with deterministic discounting, and write ∂K+C\partial_K^{+}C for the right derivative in the strike, the limit of the call spread (C(K+ε)−C(K))/ε(C(K + \varepsilon) - C(K))/\varepsilon as ε↓0\varepsilon \downarrow 0. The digital price is a strike derivative, and when the risk-neutral law of STS_T has a density pQp_{\mathbb{Q}}, the Breeden-Litzenberger formula recovers it,

e−rτ Q(ST>K)=−∂K+C(K),pQ(K)=erτ ∂2C∂K2(K).\begin{gathered} e^{-r\tau}\,\mathbb{Q}(S_T > K) = -\partial_K^{+}C(K), \\[0.4em] p_{\mathbb{Q}}(K) = e^{r\tau}\,\frac{\partial^2C}{\partial K^2}(K). \end{gathered}

If Q(ST=K)>0\mathbb{Q}(S_T = K) > 0, the call price has a kink at KK and its left and right slopes differ by e−rτQ(ST=K)e^{-r\tau}\mathbb{Q}(S_T = K). With random interest rates, P(0,T)P(0,T) replaces e−rτe^{-r\tau} and the forward measure QT\mathbb{Q}^{T} replaces Q\mathbb{Q}. In the Black-Scholes model the digital is worth e−rτΦ(d2)e^{-r\tau}\Phi(d_2) and CKK=e−rτφ(d2)/(Kστ)C_{KK} = e^{-r\tau}\varphi(d_2)/(K\sigma\sqrt{\tau}). At S=K=100S = K = 100, r=q=0r = q = 0, σ=0.2\sigma = 0.2 and τ=1\tau = 1, the digital is worth 0.46020.4602 and the density at 100100 is 0.0198480.019848, the same number as gamma.

Lessons Digital options and distribution recovery

Early exercise in continuous time

An American option with payoff gg is worth the optimal stopping value

V(t,s)=sup⁡τ Et,sQ[e−r(τ−t)g(Sτ)]V(t, s) = \sup_{\tau}\,\mathbb{E}^{\mathbb{Q}}_{t,s}\big[e^{-r(\tau - t)}g(S_\tau)\big]

over stopping times τ\tau in [t,T][t, T], where Et,sQ\mathbb{E}^{\mathbb{Q}}_{t,s} starts the price at St=sS_t = s, so V≥gV \ge g and VV is at least the European value. Under regularity conditions, VV solves the variational inequality max⁡{Vt+LV−rV, g−V}=0\max\{V_t + \mathcal{L}V - rV,\ g - V\} = 0, where L\mathcal{L} is the Q\mathbb{Q} generator. The exercise boundary b(t)b(t) is a free boundary, fixed by value matching V(t,b(t))=g(b(t))V(t, b(t)) = g(b(t)) and smooth pasting Vs(t,b(t))=g′(b(t))V_s(t, b(t)) = g'(b(t)).

The perpetual American put on a stock without dividends, with r>0r > 0 and σ>0\sigma > 0, is solved exactly. With β=−2r/σ2\beta = -2r/\sigma^2 and the exercise boundary B=ββ−1K=2rK2r+σ2B = \frac{\beta}{\beta - 1}K = \frac{2rK}{2r + \sigma^2},

V(s)=(K−B) (s/B)βV(s) = (K - B)\,(s/B)^{\beta}

for s>Bs > B, while V(s)=K−sV(s) = K - s for s≤Bs \le B, where immediate exercise is optimal. With K=100K = 100, r=0.04r = 0.04 and σ=0.2\sigma = 0.2, β=−2\beta = -2, B=2003≈66.67B = \frac{200}{3} \approx 66.67 and V(100)=40027≈14.815V(100) = \frac{400}{27} \approx 14.815. At the boundary the slope of VV is −1-1, the slope of the payoff.

Lessons Early exercise in continuous time

Volatility and path dependent derivatives

One constant volatility rarely fits all quoted option prices, and many contracts depend on the whole price path. Implied volatility turns prices into a surface that must respect static no-arbitrage bounds, and local volatility, stochastic volatility and jumps are models that can produce such surfaces. Barrier, Asian and exchange options need hitting times, extra state variables and a change of numeraire.

Implied volatility

For a European call with S,K,τ>0S, K, \tau > 0, the Black-Scholes price increases strictly in σ\sigma, because vega Se−qτφ(d1)τSe^{-q\tau}\varphi(d_1)\sqrt{\tau} is positive, and as σ\sigma goes from 00 to ∞\infty it runs over the whole open interval between the no-arbitrage bounds (Se−qτ−Ke−rτ)+(Se^{-q\tau} - Ke^{-r\tau})^{+} and Se−qτSe^{-q\tau}. So every price strictly inside that interval has exactly one implied volatility σimp>0\sigma_{\text{imp}} > 0, and a price outside it has none. Implied volatility is a coordinate for quoting prices, not a forecast of future volatility. Newton’s method σn+1=σn−(CBS(σn)−C)/ν(σn)\sigma_{n+1} = \sigma_n - (C_{\text{BS}}(\sigma_n) - C)/\nu(\sigma_n) is fast when vega is not small, while bisection on a bracket always converges and is the safer choice deep in or out of the money and near expiry. The inverse sensitivity is ∂σimp/∂C=1/ν\partial\sigma_{\text{imp}}/\partial C = 1/\nu. At S=K=100S = K = 100, τ=1\tau = 1 and r=q=0r = q = 0, the price 7.965577.96557 gives σimp=0.2\sigma_{\text{imp}} = 0.2, and raising the price by 0.10.1 raises the implied volatility by about 0.1/39.695≈0.00250.1/39.695 \approx 0.0025.

Lessons Implied volatility and inverse pricing

Static arbitrage and volatility surfaces

For European calls with one maturity TT and a deterministic discount factor D(T)D(T), absence of static arbitrage requires

−D(T)≤∂C∂K≤0,∂2C∂K2≥0,\begin{gathered} -D(T) \le \frac{\partial C}{\partial K} \le 0, \\[0.4em] \frac{\partial^2 C}{\partial K^2} \ge 0, \end{gathered}

where the derivatives exist, and in discrete form 0≤C(K)−C(K+h)≤D(T) h0 \le C(K) - C(K + h) \le D(T)\,h (call spreads) and C(K−h)−2C(K)+C(K+h)≥0C(K - h) - 2C(K) + C(K + h) \ge 0 (butterflies). Across maturities with deterministic carry, the normalized price C(K,T)/(D(T)F(0,T))C(K, T)/(D(T)F(0,T)) at fixed forward moneyness K/F(0,T)K/F(0,T) must not decrease in TT, which is the same as total implied variance σimp2T\sigma_{\text{imp}}^2T not decreasing in TT at fixed forward moneyness. With D=1D = 1 and calls at strikes 9090, 100100 and 110110 priced 1515, 1010 and 77, the slopes are −0.5-0.5 and −0.3-0.3 and the butterfly costs 15−20+7=2≥015 - 20 + 7 = 2 \ge 0. A price of 44 at 110110 would make the butterfly cost −1-1, an arbitrage, since its payoff is never negative. Interpolating prices linearly in strike with nondecreasing slopes in [−D(T),0][-D(T), 0] keeps a slice free of static arbitrage.

Lessons Static arbitrage and volatility surfaces

Dupire local volatility

In a local volatility model the stock follows dSt=(r−q)St dt+σloc(t,St)St dWtQdS_t = (r - q)S_t\,dt + \sigma_{\text{loc}}(t, S_t)S_t\,dW^{\mathbb{Q}}_t. If the call price surface C(T,K)C(T, K) is smooth, the terminal law has a density and the tails decay fast enough, Dupire’s equation holds,

CT=12σloc2(T,K) K2CKK−(r−q)KCK−qC,\begin{aligned} C_T &= \tfrac{1}{2}\sigma_{\text{loc}}^2(T, K)\,K^2C_{KK} \\[0.4em] &\quad - (r - q)KC_K - qC, \end{aligned}

so wherever CKK>0C_{KK} > 0

σloc2(T,K)=2ΛK2CKK,Λ=CT+(r−q)KCK+qC.\begin{gathered} \sigma_{\text{loc}}^2(T, K) = \frac{2\Lambda}{K^2C_{KK}}, \\[0.4em] \Lambda = C_T + (r - q)KC_K + qC . \end{gathered}

With r=q=0r = q = 0 and constructed prices 8.478.47, 88 and 7.557.55 at strikes 9999, 100100 and 101101, the curvature is CKK≈0.02C_{KK} \approx 0.02. Prices 7.967.96 and 8.048.04 at maturities 0.010.01 apart on either side give CT≈4C_T \approx 4, so σloc2=2⋅41002⋅0.02=0.04\sigma_{\text{loc}}^2 = \frac{2 \cdot 4}{100^2 \cdot 0.02} = 0.04 and σloc=0.2\sigma_{\text{loc}} = 0.2. Changing the middle price by 0.020.02 to 8.028.02 makes the curvature −0.02-0.02 and the formula meaningless. Differentiating quoted prices twice is ill-posed, so the surface is smoothed first. A local volatility model can match every marginal law and still give the wrong dynamics for path-dependent claims.

Lessons Dupire local volatility

The Heston model

Under Q\mathbb{Q} the Heston model is

dSt=(r−q)St dt+vt St dWtS,dvt=κ(θ−vt) dt+ξvt dWtv,\begin{aligned} dS_t &= (r - q)S_t\,dt \\[0.4em] &\quad + \sqrt{v_t}\,S_t\,dW^{S}_t, \\[0.4em] dv_t &= \kappa(\theta - v_t)\,dt \\[0.4em] &\quad + \xi\sqrt{v_t}\,dW^{v}_t, \end{aligned}

with d[WS,Wv]t=ρ dtd[W^{S}, W^{v}]_t = \rho\,dt and κ,θ,ξ,v0>0\kappa, \theta, \xi, v_0 > 0. The variance stays nonnegative, and under the Feller condition 2κθ≥ξ22\kappa\theta \ge \xi^2 it never reaches zero. A negative ρ\rho, the leverage correlation, produces implied volatilities that fall with the strike. The variance has E[vT]=θ+(v0−θ)e−κT\mathbb{E}[v_T] = \theta + (v_0 - \theta)e^{-\kappa T} and E∫0Tvt dt=θT+(v0−θ)(1−e−κT)/κ\mathbb{E}\int_0^T v_t\,dt = \theta T + (v_0 - \theta)(1 - e^{-\kappa T})/\kappa. The log price xT=ln⁡STx_T = \ln S_T has an affine characteristic function,

ϕT(u)=eiu[x0+(r−q)T]×eA(T,u)+B(T,u) v0,\begin{aligned} \phi_T(u) &= e^{iu[x_0 + (r - q)T]} \\[0.4em] &\quad \times e^{A(T, u) + B(T, u)\,v_0}, \end{aligned}

where AA and BB solve Riccati equations in the time to maturity with A(0,u)=B(0,u)=0A(0, u) = B(0, u) = 0,

B′=12ξ2B2+(ρξiu−κ)B−12(u2+iu),A′=κθB.\begin{aligned} B' &= \tfrac{1}{2}\xi^2B^2 + (\rho\xi iu - \kappa)B \\[0.4em] &\quad - \tfrac{1}{2}(u^2 + iu), \\[0.4em] A' &= \kappa\theta B . \end{aligned}

With κ=2\kappa = 2, θ=0.04\theta = 0.04, v0=0.09v_0 = 0.09, ξ=0.3\xi = 0.3 and T=1T = 1, the Feller condition holds since 0.16≥0.090.16 \ge 0.09, E[v1]≈0.04677\mathbb{E}[v_1] \approx 0.04677 and the expected integrated variance is about 0.061620.06162. With ξ=0.6\xi = 0.6 it fails, since 0.16<0.360.16 < 0.36, and zero becomes attainable.

Lessons Heston stochastic volatility

Jump diffusion and incomplete hedging

In a jump diffusion under Q\mathbb{Q},

dStSt−=(r−q−λκJ) dt+σ dWt+(J−1) dNt,\begin{aligned} \frac{dS_t}{S_{t-}} &= (r - q - \lambda\kappa_J)\,dt \\[0.4em] &\quad + \sigma\,dW_t + (J - 1)\,dN_t, \end{aligned}

where NN is a Poisson process with intensity λ\lambda, the jump factors J>0J > 0 are independent and identically distributed and independent of WW and NN, and κJ=EQ[J−1]\kappa_J = \mathbb{E}^{\mathbb{Q}}[J - 1]. The term −λκJ-\lambda\kappa_J compensates the jumps, since Nt−λtN_t - \lambda t is a martingale, so the discounted total return is a martingale. Prices solve Vt+LV−rV=0V_t + \mathcal{L}V - rV = 0 with the nonlocal generator

Lf(s)=(r−q)sfs+12σ2s2fss+λ E[f(sJ)−f(s)−s(J−1)fs].\begin{aligned} \mathcal{L}f(s) &= (r - q)sf_s + \tfrac{1}{2}\sigma^2s^2f_{ss} \\[0.4em] &\quad + \lambda\,\mathbb{E}\big[f(sJ) - f(s) \\[0.4em] &\qquad - s(J - 1)f_s\big]. \end{aligned}

A delta hedge leaves the residual V(sJ)−V(s)−Vs(s) s(J−1)V(sJ) - V(s) - V_s(s)\,s(J - 1) at each jump, so the market is incomplete and the pricing measure is a modeling choice. With λ=0.4\lambda = 0.4, a fixed J=0.8J = 0.8 and r=0.03r = 0.03, κJ=−0.2\kappa_J = -0.2, the drift between jumps is 0.110.11, the probability of no jump in a year is e−0.4≈0.670e^{-0.4} \approx 0.670 and EQ[S1]=100e0.03\mathbb{E}^{\mathbb{Q}}[S_1] = 100e^{0.03}. For V(s)=s2/100V(s) = s^2/100 at s=100s = 100 the jump residual is 100(J−1)2=4100(J - 1)^2 = 4.

Lessons Jump diffusion and incomplete hedging

Barrier options and first passage

A down barrier option depends on the hitting time τH=inf⁡{t≥0:St≤H}\tau_H = \inf\{t \ge 0 : S_t \le H\}. A knock-out pays only if τH>T\tau_H > T and a knock-in only if τH≤T\tau_H \le T, so for the same strike, barrier and maturity and no rebates, knock-in plus knock-out equals the vanilla option. For a standard Brownian motion and a≥0a \ge 0, the reflection principle gives

P(max⁡0≤t≤TWt≥a)=2[1−Φ(a/T)].\begin{gathered} \mathbb{P}\Big(\max_{0 \le t \le T}W_t \ge a\Big) \\[0.4em] = 2\big[1 - \Phi(a/\sqrt{T})\big]. \end{gathered}

For geometric Brownian motion with σ>0\sigma > 0 and 0<H<min⁡(s,z)0 < H < \min(s, z), the probability of crossing HH during a step of length hh from S0=sS_0 = s to Sh=zS_h = z is

exp⁡ ⁣(−2ln⁡(s/H)ln⁡(z/H)σ2h).\exp\!\Big(-\frac{2\ln(s/H)\ln(z/H)}{\sigma^2h}\Big).

A barrier checked only at discrete dates misses crossings between them, and this bridge formula corrects simulated paths. With S0=100S_0 = 100, H=90H = 90, σ=0.2\sigma = 0.2, T=1T = 1 and zero log drift, the hitting probability is 2Φ(ln⁡0.9/0.2)≈0.5982\Phi(\ln 0.9/0.2) \approx 0.598, and given S1=105S_1 = 105 it is about 0.4440.444.

Lessons Barrier options and first passage

Asian options

An arithmetic Asian call pays (AT/T−K)+(A_T/T - K)^{+} with the running integral At=∫0tSu duA_t = \int_0^t S_u\,du. Adding AA as a state variable, dAt=St dtdA_t = S_t\,dt, gives the pricing equation

Vt+(r−q)SVS+12σ2S2VSS+SVA−rV=0,\begin{aligned} &V_t + (r - q)SV_S + \tfrac{1}{2}\sigma^2S^2V_{SS} \\[0.4em] &\quad + SV_A - rV = 0, \end{aligned}

with V(T,S,A)=(A/T−K)+V(T, S, A) = (A/T - K)^{+}. For the discrete geometric average G=exp⁡(1n∑jln⁡Stj)G = \exp\big(\frac{1}{n}\sum_j\ln S_{t_j}\big) under Black-Scholes dynamics, ln⁡G∼N(m,v)\ln G \sim N(m, v) with m=ln⁡S0+(r−q−12σ2)1n∑jtjm = \ln S_0 + (r - q - \frac{1}{2}\sigma^2)\frac{1}{n}\sum_jt_j and v=σ2n2∑j,kmin⁡(tj,tk)v = \frac{\sigma^2}{n^2}\sum_{j,k}\min(t_j, t_k). With a=(m−ln⁡K)/va = (m - \ln K)/\sqrt{v},

CG=e−rT[em+v/2 Φ(a+v)−K Φ(a)].\begin{aligned} C_G = e^{-rT}\big[&e^{m + v/2}\,\Phi(a + \sqrt{v}) \\[0.4em] &- K\,\Phi(a)\big]. \end{aligned}

Since GG never exceeds the arithmetic average of the same fixings, the geometric call is worth no more than the arithmetic call, and its exact price makes it a good control variate. With S0=K=100S_0 = K = 100, r=q=0r = q = 0, σ=0.2\sigma = 0.2 and fixings at 0.50.5 and 11, v=0.025v = 0.025, E[G]=100e−0.0025\mathbb{E}[G] = 100e^{-0.0025} and CG≈6.169C_G \approx 6.169. Fixings of 100100, 110110, 9090 and 120120 average 105105 arithmetically and about 104.40104.40 geometrically.

Lessons Asian options and running averages

Exchange and multiasset options

For two geometric Brownian motions under Q\mathbb{Q} with volatilities σ1,σ2\sigma_1, \sigma_2, correlation ρ\rho and dividend yields q1,q2q_1, q_2, the option to exchange asset 2 for asset 1, with payoff (ST1−ST2)+(S^1_T - S^2_T)^{+}, is priced by taking asset 2 with its dividends reinvested as the numeraire. With σeff2=σ12+σ22−2ρσ1σ2>0\sigma_{\text{eff}}^2 = \sigma_1^2 + \sigma_2^2 - 2\rho\sigma_1\sigma_2 > 0, Margrabe’s formula is

V=S1e−q1τΦ(d1)−S2e−q2τΦ(d2),\begin{aligned} V &= S_1e^{-q_1\tau}\Phi(d_1) \\[0.4em] &\quad - S_2e^{-q_2\tau}\Phi(d_2), \end{aligned}

where

d1=ln⁡(S1/S2)+(q2−q1)τσeffτ+12σeffτ,d2=d1−σeffτ,\begin{aligned} d_1 &= \frac{\ln(S_1/S_2) + (q_2 - q_1)\tau}{\sigma_{\text{eff}}\sqrt{\tau}} \\[0.4em] &\quad + \tfrac{1}{2}\sigma_{\text{eff}}\sqrt{\tau}, \\[0.4em] d_2 &= d_1 - \sigma_{\text{eff}}\sqrt{\tau}, \end{aligned}

and the interest rate does not appear. With S1=S2=100S_1 = S_2 = 100, σ1=0.2\sigma_1 = 0.2, σ2=0.3\sigma_2 = 0.3, ρ=0.5\rho = 0.5, no dividends and τ=1\tau = 1, σeff=0.07≈0.2646\sigma_{\text{eff}} = \sqrt{0.07} \approx 0.2646 and V≈10.524V \approx 10.524. With ρ=1\rho = 1, σeff=0.1\sigma_{\text{eff}} = 0.1. A basket is a sum of lognormal prices, which is not lognormal, so matching its first two moments with a lognormal gives an approximation, not an exact price.

Lessons Multiasset derivatives and exchange options

Numerical methods for finance

Most prices are computed, not written down, and each method has its own kind of error. Conditioning belongs to the problem and stability to the algorithm. A Monte Carlo standard error measures sampling error only, a time step adds discretization error, and a grid, a regression or a truncated integral adds errors of its own, so a numerical answer is reported with the error it carries and the error it leaves out.

Conditioning and root finding

For the problem f(x)=bf(x) = b with f′(x)≠0f'(x) \ne 0, the solution moves by dx/db=1/f′(x)dx/db = 1/f'(x), and the relative condition number is κrel=∣b/(x f′(x))∣\kappa_{\text{rel}} = \lvert b/(x\,f'(x)) \rvert. A well-conditioned problem can still be computed badly. For large xx, x2+1−x\sqrt{x^2 + 1} - x cancels to 00 in floating point at x=108x = 10^{8}, while the equal form 1/(x2+1+x)1/(\sqrt{x^2 + 1} + x) gives 5×10−95 \times 10^{-9}.

  • Bisection. If ff is continuous with f(a0)f(b0)<0f(a_0)f(b_0) < 0, halving the bracket keeps a root inside, and the midpoint after nn halvings is within (b0−a0)/2n+1(b_0 - a_0)/2^{n+1} of a root.
  • Newton’s method. The step is xn+1=xn−f(xn)/f′(xn)x_{n+1} = x_n - f(x_n)/f'(x_n). If ff is twice continuously differentiable near a simple root x∗x^{*} and x0x_0 is close enough, the error satisfies en+1≈f′′(x∗)2f′(x∗)en2e_{n+1} \approx \frac{f''(x^{*})}{2f'(x^{*})}e_n^2, quadratic convergence. Far from the root it can fail. For f(x)=x3−2x+2f(x) = x^3 - 2x + 2 from x0=0x_0 = 0 the iterates cycle 0,1,0,1,…0, 1, 0, 1, \ldots

For x2=2x^2 = 2 the root is 2≈1.414214\sqrt{2} \approx 1.414214 and the condition number is 12\frac{1}{2}.

Lessons Numerical conditioning and root finding

Monte Carlo pricing and sampling error

To estimate V=EQ[Y]V = \mathbb{E}^{\mathbb{Q}}[Y] with Y=e−rTg(ST)Y = e^{-rT}g(S_T), draw independent copies Y1,…,YNY_1, \ldots, Y_N under Q\mathbb{Q}. If E[Y2]<∞\mathbb{E}[Y^2] < \infty,

V^N=1N∑j=1NYj,SE^=sNN,sN2=1N−1∑j=1N(Yj−V^N)2.\begin{gathered} \hat{V}_N = \frac{1}{N}\sum_{j=1}^{N}Y_j, \\[0.4em] \widehat{\text{SE}} = \frac{s_N}{\sqrt{N}}, \\[0.4em] s_N^2 = \frac{1}{N - 1}\sum_{j=1}^{N}(Y_j - \hat{V}_N)^2 . \end{gathered}

The estimator is unbiased with variance Var⁡(Y)/N\operatorname{Var}(Y)/N, and by the central limit theorem V^N±1.96 SE^\hat{V}_N \pm 1.96\,\widehat{\text{SE}} is an approximate 95 percent interval. Halving the error needs four times as many draws. The standard error covers sampling error only, not a wrong model, wrong parameters or the bias of a time discretization, and a 95 percent interval misses in about one run in twenty. One constructed run of 10,00010{,}000 exact draws for an at-the-money call with S0=K=100S_0 = K = 100, σ=0.2\sigma = 0.2, T=1T = 1 and r=q=0r = q = 0 gave V^≈8.2907\hat{V} \approx 8.2907 with SE^≈0.1354\widehat{\text{SE}} \approx 0.1354. Its interval [8.0254,8.5560][8.0254, 8.5560] misses the exact value 7.96567.9656.

Lessons Monte Carlo pricing and sampling error

SDE discretization

The Euler-Maruyama scheme for dX=b(t,X) dt+σ(t,X) dWdX = b(t, X)\,dt + \sigma(t, X)\,dW freezes the coefficients over each step hh,

Xn+1=Xn+b(tn,Xn) h+σ(tn,Xn) ΔWn,\begin{aligned} X_{n+1} &= X_n + b(t_n, X_n)\,h \\[0.4em] &\quad + \sigma(t_n, X_n)\,\Delta W_n, \end{aligned}

with ΔWn∼N(0,h)\Delta W_n \sim N(0, h). The scalar Milstein scheme adds 12σσx[(ΔWn)2−h]\frac{1}{2}\sigma\sigma_x\big[(\Delta W_n)^2 - h\big]. Under Lipschitz and growth conditions, Euler has strong order 12\frac{1}{2}, (E∣XT−XTh∣2)1/2≤Ch1/2\big(\mathbb{E}\lvert X_T - X_T^{h} \rvert^2\big)^{1/2} \le Ch^{1/2}, and with smooth coefficients and a smooth payoff ff it has weak order 11, ∣Ef(XT)−Ef(XTh)∣≤Cfh\lvert \mathbb{E}f(X_T) - \mathbb{E}f(X_T^{h}) \rvert \le C_fh. Milstein has strong order 11 under stronger smoothness. A discontinuous payoff such as a digital can lower the observed weak order. For geometric Brownian motion with S=100S = 100, μ=0.05\mu = 0.05, σ=0.2\sigma = 0.2, h=0.25h = 0.25 and the draw Z=−1.3Z = -1.3, Euler gives 88.2588.25, Milstein 88.59588.595 and the exact step 88.470688.4706. For the square-root process dv=κ(θ−v) dt+ξv dWdv = \kappa(\theta - v)\,dt + \xi\sqrt{v}\,dW, one Euler step from v=0.001v = 0.001 with κ=1\kappa = 1, θ=0.04\theta = 0.04, ξ=0.5\xi = 0.5, h=0.1h = 0.1 and Z=−3Z = -3 gives −0.0101-0.0101, a negative variance, so such processes need a scheme that keeps the state nonnegative.

Lessons SDE discretization and weak convergence

Variance reduction

Each method below keeps the estimator unbiased and changes only its variance.

  • Antithetic variates. Average Y(Z)Y(Z) and Y(−Z)Y(-Z). When the two have equal variance, the pair average has variance 12[Var⁡Y+Cov⁡(Y(Z),Y(−Z))]\frac{1}{2}\big[\operatorname{Var}Y + \operatorname{Cov}(Y(Z), Y(-Z))\big], which beats two independent draws when the covariance is negative, as it is for monotone payoffs.
  • Control variates. With a variable XX of known mean μX\mu_X, use Y−β(X−μX)Y - \beta(X - \mu_X). The best β∗=Cov⁡(Y,X)/Var⁡(X)\beta^{*} = \operatorname{Cov}(Y, X)/\operatorname{Var}(X) leaves the variance Var⁡(Y)(1−ρ2)\operatorname{Var}(Y)(1 - \rho^2). A β\beta estimated from the same sample adds a bias of order 1/N1/N.
  • Importance sampling. Sample from a density qq instead of pp and weight, Ep[Y]=Eq[Yp/q]\mathbb{E}_p[Y] = \mathbb{E}_q[Yp/q], which needs q>0q > 0 wherever pY≠0pY \ne 0. Shifting a standard normal by aa gives the weight φ(z)/φ(z−a)=e−az+a2/2\varphi(z)/\varphi(z - a) = e^{-az + a^2/2}.

With Var⁡Y=25\operatorname{Var}Y = 25, Var⁡X=16\operatorname{Var}X = 16 and Cov⁡(Y,X)=18\operatorname{Cov}(Y, X) = 18, β∗=1.125\beta^{*} = 1.125, ρ=0.9\rho = 0.9 and the controlled variance is 4.754.75. An antithetic covariance of −15-15 gives the pair variance 55, against 12.512.5 for two independent draws. A shift a=1a = 1 gives the weight e−1.5≈0.2231e^{-1.5} \approx 0.2231 at z=2z = 2.

Lessons Variance reduction and unbiased estimators

Quasi-Monte Carlo

Quasi-Monte Carlo estimates I=∫[0,1]df(u) duI = \int_{[0,1]^d}f(u)\,du by QN=1N∑jf(uj)Q_N = \frac{1}{N}\sum_jf(u_j) with low-discrepancy points such as Sobol or Halton points. The Koksma-Hlawka inequality bounds the error by ∣QN−I∣≤VHK(f) DN∗\lvert Q_N - I \rvert \le V_{\text{HK}}(f)\,D_N^{*}, the variation of ff in the sense of Hardy and Krause, assumed finite, times the star discrepancy of the points, which is of order (ln⁡N)d/N(\ln N)^d/N for good sequences. The bound is rarely computable, so randomized quasi-Monte Carlo repeats the estimate with RR independent randomizations, each unbiased, and reports

QˉR=1R∑r=1RQN(r),SE^2=∑r(QN(r)−QˉR)2R(R−1).\begin{gathered} \bar{Q}_R = \frac{1}{R}\sum_{r=1}^{R}Q_N^{(r)}, \\[0.4em] \widehat{\text{SE}}^2 = \frac{\sum_r\big(Q_N^{(r)} - \bar{Q}_R\big)^2}{R(R - 1)} . \end{gathered}

Quasi-Monte Carlo works best when a few coordinates carry most of the variance, a low effective dimension. The Brownian bridge construction arranges this for paths by drawing WT=TZ1W_T = \sqrt{T}Z_1 first and then filling in midpoints from their conditional laws, such as WT/2∼N(w/2,T/4)W_{T/2} \sim N(w/2, T/4) given W0=0W_0 = 0 and WT=wW_T = w. For f(u)=u2f(u) = u^2 on [0,1][0, 1], evenly spaced midpoints give Q4=0.328125Q_4 = 0.328125 and Q8=0.33203125Q_8 = 0.33203125 against I=13I = \frac{1}{3}, and four randomized replicates 0.3320.332, 0.3340.334, 0.3310.331 and 0.3330.333 give Qˉ=0.3325\bar{Q} = 0.3325 with SE^≈0.00065\widehat{\text{SE}} \approx 0.00065.

Lessons Quasi Monte Carlo and effective dimension

Finite difference methods

In the variables x=ln⁡Sx = \ln S and τ=T−t\tau = T - t, the Black-Scholes equation becomes Vτ=aVxx+bVx−rVV_\tau = aV_{xx} + bV_x - rV with a=12σ2a = \frac{1}{2}\sigma^2 and b=r−q−12σ2b = r - q - \frac{1}{2}\sigma^2, and V(τ,x)=e−rτu(τ,x+bτ)V(\tau, x) = e^{-r\tau}u(\tau, x + b\tau) reduces it to the heat equation uτ=auyyu_\tau = au_{yy}. On a grid with steps Δτ\Delta\tau and Δy\Delta y, let λ=a Δτ/(Δy)2\lambda = a\,\Delta\tau/(\Delta y)^2 and let LhL_h be the central second difference times aa.

SchemeUpdateStability
explicitujn+1=λuj−1n+(1−2λ)ujn+λuj+1nu_j^{n+1} = \lambda u_{j-1}^{n} + (1 - 2\lambda)u_j^{n} + \lambda u_{j+1}^{n}only for 0<λ≤120 < \lambda \le \frac{1}{2}
implicit(I−ΔτLh)un+1=un(I - \Delta\tau L_h)u^{n+1} = u^{n}unconditional, first order in time
Crank-Nicolson(I−12ΔτLh)un+1=(I+12ΔτLh)un(I - \frac{1}{2}\Delta\tau L_h)u^{n+1} = (I + \frac{1}{2}\Delta\tau L_h)u^{n}unconditional, second order in time

For the plain heat equation ut=uxxu_t = u_{xx}, a=1a = 1 and the explicit condition is Δt/(Δx)2≤12\Delta t/(\Delta x)^2 \le \frac{1}{2}. Under that condition the explicit update is a weighted average of neighbors and satisfies a discrete maximum principle. Above it, the highest grid frequency is multiplied by 1−4λ<−11 - 4\lambda < -1 at every step and grows. Crank-Nicolson can still oscillate after a payoff kink, which is often damped by a few implicit steps at the start. With σ=0.2\sigma = 0.2, Δy=0.1\Delta y = 0.1 and Δτ=0.1\Delta\tau = 0.1, λ=0.2\lambda = 0.2 and a unit spike becomes (0.2,0.6,0.2)(0.2, 0.6, 0.2). With Δτ=0.3\Delta\tau = 0.3, λ=0.6\lambda = 0.6, the center becomes −0.2-0.2 and the amplification factor is −1.4-1.4.

Lessons Finite difference PDE methods

Least squares Monte Carlo

A Bermudan option can be exercised at dates t1<⋯<tnt_1 < \cdots < t_n. Its continuation value at tkt_k is Ck(x)=EQ[e−rΔtVk+1∣Xk=x]C_k(x) = \mathbb{E}^{\mathbb{Q}}[e^{-r\Delta t}V_{k+1} \mid X_k = x], and least squares Monte Carlo estimates it by regressing simulated discounted future values on basis functions, C^k(x)=∑jβ^jψj(x)\hat{C}_k(x) = \sum_j\hat{\beta}_j\psi_j(x), usually on in-the-money paths only. The resulting policy exercises at the first tkt_k with g(Xk)≥C^k(Xk)g(X_k) \ge \hat{C}_k(X_k). Any stopping policy is worth at most the true price, so evaluating the policy on independent paths estimates a lower bound, while evaluating it on the paths used for fitting can be biased upward. Dual methods give upper bounds. In a constructed tree with a put struck at 100100, exercise dates 11 and 22 and date-one prices 8080, 100100 and 120120, the exact continuation values are 1609\frac{160}{9}, 809\frac{80}{9} and 00, and the affine fit C^(s)=1603−49s\hat{C}(s) = \frac{160}{3} - \frac{4}{9}s reproduces them. The policy exercises only at 8080 and is worth about 8.5608.560, against 7.9017.901 for exercising only at date 22.

Lessons Least squares Monte Carlo for American options

Fourier transform pricing

Let ϕ(u)=EQ[eiuXT]\phi(u) = \mathbb{E}^{\mathbb{Q}}[e^{iuX_T}] be the characteristic function of XT=ln⁡STX_T = \ln S_T, so ϕ(0)=1\phi(0) = 1 and ϕ(−u)=ϕ(u)‾\phi(-u) = \overline{\phi(u)}. The call price as a function of the log strike kk is not integrable, so the Carr-Madan method damps it by eαke^{\alpha k} with α>0\alpha > 0, which needs the moment EQ[STα+1]<∞\mathbb{E}^{\mathbb{Q}}[S_T^{\alpha + 1}] < \infty. The damped price has the Fourier transform

ψ(v)=e−rTϕ(v−i(α+1))(α+iv)(α+1+iv),C(k)=e−αkπ×∫0∞Re⁡(e−ivkψ(v)) dv.\begin{aligned} \psi(v) &= \frac{e^{-rT}\phi\big(v - i(\alpha + 1)\big)}{(\alpha + iv)(\alpha + 1 + iv)}, \\[0.4em] C(k) &= \frac{e^{-\alpha k}}{\pi} \\[0.4em] &\quad \times \int_0^{\infty}\operatorname{Re}\big(e^{-ivk}\psi(v)\big)\,dv . \end{aligned}

The integral is truncated and discretized, and the fast Fourier transform evaluates it on a log-strike grid with spacing Δk=2π/(NΔv)\Delta k = 2\pi/(N\Delta v). The errors come from truncation, from the grid, which causes aliasing, and from a poor choice of α\alpha inside the strip where the moment exists. For the Black-Scholes characteristic function with S0=K=100S_0 = K = 100, σ=0.2\sigma = 0.2, T=1T = 1, r=q=0r = q = 0, α=1.5\alpha = 1.5, Δv=0.025\Delta v = 0.025 and N=4096N = 4096, the trapezoidal rule reproduces the call price 7.9655677.965567, and Δk≈0.0614\Delta k \approx 0.0614.

Lessons Fourier transform pricing

Interest rate models and measures

Interest rate derivatives depend on the whole term structure, and the bond price P(t,T)P(t,T) is now a random process. A positive numeraire defines its own pricing measure, and choosing the bond, the annuity or the cash account as numeraire makes the right forward rate a martingale. Short-rate models, the Heath-Jarrow-Morton framework and market models describe the curve under Q\mathbb{Q}, with parameters that are pricing parameters, not physical ones.

Numeraires and forward measures

Let NN be a positive price process of a traded asset without payouts, with N/BN/B a true Q\mathbb{Q}-martingale. Then

dQNdQ∣Ft=Nt/BtN0/B0\frac{d\mathbb{Q}^{N}}{d\mathbb{Q}}\Big|_{\mathcal{F}_t} = \frac{N_t/B_t}{N_0/B_0}

defines an equivalent measure under which prices divided by NN are martingales, and every claim HH paid at TT has the same price in either unit,

Vt=Nt EQN ⁣[HNT ∣ Ft]=Bt EQ ⁣[HBT ∣ Ft].\begin{aligned} V_t &= N_t\,\mathbb{E}^{\mathbb{Q}^{N}}\!\Big[\frac{H}{N_T} \,\Big|\, \mathcal{F}_t\Big] \\[0.4em] &= B_t\,\mathbb{E}^{\mathbb{Q}}\!\Big[\frac{H}{B_T} \,\Big|\, \mathcal{F}_t\Big]. \end{aligned}

With the bond P(t,T)P(t,T) as numeraire this is the TT-forward measure, and Vt=P(t,T) EQT[H∣Ft]V_t = P(t,T)\,\mathbb{E}^{\mathbb{Q}^{T}}[H \mid \mathcal{F}_t], so forward prices for delivery at TT are QT\mathbb{Q}^{T}-martingales. If dP(t,T)/P(t,T)=rt dt+σP(t,T) dWtQdP(t,T)/P(t,T) = r_t\,dt + \sigma_P(t,T)\,dW^{\mathbb{Q}}_t, then WtT=WtQ−∫0tσP(s,T) dsW^{T}_t = W^{\mathbb{Q}}_t - \int_0^t\sigma_P(s,T)\,ds is a QT\mathbb{Q}^{T}-Brownian motion. With two equally likely Q\mathbb{Q} states in which the cash account grows to 1.021.02 or 1.081.08, P(0,T)=12(11.02+11.08)≈0.95316P(0,T) = \frac{1}{2}(\frac{1}{1.02} + \frac{1}{1.08}) \approx 0.95316 and the forward measure gives the states the weights 0.51430.5143 and 0.48570.4857. A claim paying 100100 in the second state costs 46.29646.296 in either calculation.

Lessons Numeraires and forward measures

Vasicek and Cox-Ingersoll-Ross models

A short-rate model gives bond prices P(t,T)=EQ[e−∫tTrs ds∣Ft]P(t,T) = \mathbb{E}^{\mathbb{Q}}\big[e^{-\int_t^Tr_s\,ds} \mid \mathcal{F}_t\big]. Under Q\mathbb{Q}, with κ,θ>0\kappa, \theta > 0,

ModelDynamicsRates
Vasicekdr=κ(θ−r) dt+σ dWdr = \kappa(\theta - r)\,dt + \sigma\,dWGaussian, can be negative
Cox-Ingersoll-Rossdr=κ(θ−r) dt+ξr dWdr = \kappa(\theta - r)\,dt + \xi\sqrt{r}\,dWnonnegative, positive if 2κθ≥ξ22\kappa\theta \ge \xi^2

Both show mean reversion toward θ\theta at speed κ\kappa, and both are affine, P(t,T)=eA(τ)−B(τ)rtP(t,T) = e^{A(\tau) - B(\tau)r_t}. For Vasicek,

B(τ)=1−e−κτκ,A(τ)=(θ−σ22κ2)(B−τ)−σ2B24κ.\begin{aligned} B(\tau) &= \frac{1 - e^{-\kappa\tau}}{\kappa}, \\[0.4em] A(\tau) &= \Big(\theta - \frac{\sigma^2}{2\kappa^2}\Big)\big(B - \tau\big) \\[0.4em] &\quad - \frac{\sigma^2B^2}{4\kappa}. \end{aligned}

For Cox-Ingersoll-Ross, with γ=κ2+2ξ2\gamma = \sqrt{\kappa^2 + 2\xi^2} and E=eγτ−1E = e^{\gamma\tau} - 1, the bond price is P=A(τ)e−B(τ)rtP = \mathcal{A}(\tau)e^{-B(\tau)r_t} with

B(τ)=2E(γ+κ)E+2γ,A(τ)=[2γe(κ+γ)τ/2(γ+κ)E+2γ]2κθ/ξ2.\begin{aligned} B(\tau) &= \frac{2E}{(\gamma + \kappa)E + 2\gamma}, \\[0.4em] \mathcal{A}(\tau) &= \Big[\frac{2\gamma e^{(\kappa + \gamma)\tau/2}}{(\gamma + \kappa)E + 2\gamma}\Big]^{2\kappa\theta/\xi^2}. \end{aligned}

The Feller condition 2κθ≥ξ22\kappa\theta \ge \xi^2 keeps a Cox-Ingersoll-Ross rate that starts positive away from zero. Parameters fitted to bond and option prices are Q\mathbb{Q} parameters, and the physical dynamics differ by the market price of risk. With r0=0.03r_0 = 0.03, κ=0.5\kappa = 0.5, θ=0.04\theta = 0.04, σ=0.01\sigma = 0.01 and τ=5\tau = 5, the Vasicek bond is worth 0.8342870.834287, and with ξ=0.1\xi = 0.1, where 2κθ=0.04≥0.012\kappa\theta = 0.04 \ge 0.01, the Cox-Ingersoll-Ross bond is worth 0.8352340.835234.

Lessons Vasicek and CIR short rate models

Hull-White and fitting the initial curve

The Hull-White model drt=(θ(t)−art) dt+σ dWtQdr_t = (\theta(t) - ar_t)\,dt + \sigma\,dW^{\mathbb{Q}}_t with a,σ>0a, \sigma > 0 adds a time-dependent drift that fits any smooth initial curve PM(0,T)P^{M}(0,T) with instantaneous forwards fM(0,t)f^{M}(0,t). Write rt=xt+χ(t)r_t = x_t + \chi(t) with dxt=−axt dt+σ dWtQdx_t = -ax_t\,dt + \sigma\,dW^{\mathbb{Q}}_t and x0=0x_0 = 0. The fit requires the deterministic shift and drift

χ(t)=fM(0,t)+σ22a2(1−e−at)2,θ(t)=∂tfM(0,t)+afM(0,t)+σ22a(1−e−2at),\begin{aligned} \chi(t) &= f^{M}(0,t) \\[0.4em] &\quad + \frac{\sigma^2}{2a^2}\big(1 - e^{-at}\big)^2, \\[0.4em] \theta(t) &= \partial_tf^{M}(0,t) + af^{M}(0,t) \\[0.4em] &\quad + \frac{\sigma^2}{2a}\big(1 - e^{-2at}\big), \end{aligned}

and then, with B(t,T)=(1−e−a(T−t))/aB(t,T) = (1 - e^{-a(T - t)})/a,

P(t,T)=PM(0,T)PM(0,t) eΞ,Ξ=B (fM(0,t)−rt)−σ24a(1−e−2at)B2.\begin{aligned} P(t,T) &= \frac{P^{M}(0,T)}{P^{M}(0,t)}\,e^{\Xi}, \\[0.4em] \Xi &= B\,\big(f^{M}(0,t) - r_t\big) \\[0.4em] &\quad - \frac{\sigma^2}{4a}\big(1 - e^{-2at}\big)B^2. \end{aligned}

Fitting the curve fixes θ\theta but does not identify aa and σ\sigma, which come from option prices. For a flat curve at 0.030.03 with a=0.1a = 0.1 and σ=0.01\sigma = 0.01, χ(1)≈0.030045\chi(1) \approx 0.030045 and θ(1)≈0.0030906\theta(1) \approx 0.0030906, and the model reproduces P(0,5)=e−0.15P(0,5) = e^{-0.15}. A short rate of 0.040.04 at t=1t = 1 gives P(1,5)≈0.857735P(1,5) \approx 0.857735.

Lessons Hull White and initial curve fitting

The Heath-Jarrow-Morton framework

The Heath-Jarrow-Morton framework models the whole forward curve, with P(t,T)=exp⁡(−∫tTf(t,u) du)P(t,T) = \exp\big(-\int_t^Tf(t,u)\,du\big) and rt=f(t,t)r_t = f(t,t), through df(t,T)=α(t,T) dt+σ(t,T)⋅dWtQdf(t,T) = \alpha(t,T)\,dt + \sigma(t,T)\cdot dW^{\mathbb{Q}}_t for each maturity TT. With A(t,T)=∫tTα(t,u) duA(t,T) = \int_t^T\alpha(t,u)\,du and Σ(t,T)=∫tTσ(t,u) du\Sigma(t,T) = \int_t^T\sigma(t,u)\,du, and under integrability conditions that allow the stochastic Fubini theorem,

dP(t,T)P(t,T)=[rt−A+12∥Σ∥2] dt−Σ⋅dWtQ.\begin{aligned} \frac{dP(t,T)}{P(t,T)} &= \big[r_t - A + \tfrac{1}{2}\lVert\Sigma\rVert^2\big]\,dt \\[0.4em] &\quad - \Sigma\cdot dW^{\mathbb{Q}}_t . \end{aligned}

Discounted bond prices have zero drift under Q\mathbb{Q}, as absence of arbitrage requires, exactly when A=12∥Σ∥2A = \frac{1}{2}\lVert\Sigma\rVert^2 for every maturity, and differentiating in TT gives the drift restriction

α(t,T)=σ(t,T)⋅∫tTσ(t,u) du.\alpha(t,T) = \sigma(t,T)\cdot\int_t^T\sigma(t,u)\,du .

So under Q\mathbb{Q} the volatility determines the drift. The exponential kernel σ(t,T)=ηe−a(T−t)\sigma(t,T) = \eta e^{-a(T - t)} gives Σ=η(1−e−aτ)/a\Sigma = \eta(1 - e^{-a\tau})/a and α=η2e−aτ(1−e−aτ)/a\alpha = \eta^2e^{-a\tau}(1 - e^{-a\tau})/a with τ=T−t\tau = T - t, the Hull-White case. With η=0.01\eta = 0.01, a=0.2a = 0.2 and τ=3\tau = 3, Σ≈0.022559\Sigma \approx 0.022559 and α≈0.00012381\alpha \approx 0.00012381, and the integrated drift is 12Σ2≈0.00025446\frac{1}{2}\Sigma^2 \approx 0.00025446.

Lessons Heath Jarrow Morton and the drift restriction

Forward rate market models

For dates T0<T1<⋯<TNT_0 < T_1 < \cdots < T_N with accruals δi\delta_i, the simple forward rate is Li(t)=(P(t,Ti)/P(t,Ti+1)−1)/δiL_i(t) = \big(P(t,T_i)/P(t,T_{i+1}) - 1\big)/\delta_i for t≤Tit \le T_i. Under its own forward measure QTi+1\mathbb{Q}^{T_{i+1}}, LiL_i is a martingale, and the lognormal market model sets dLi/Li=λi(t)⋅dWti+1dL_i/L_i = \lambda_i(t)\cdot dW^{i+1}_t. Under the terminal measure QTN\mathbb{Q}^{T_N} the forwards acquire drifts,

dLiLi=−∑j=i+1N−1δjLj1+δjLj×λi⋅λj dt+λi⋅dWtN,\begin{aligned} \frac{dL_i}{L_i} &= -\sum_{j=i+1}^{N-1}\frac{\delta_jL_j}{1 + \delta_jL_j} \\[0.4em] &\qquad \times \lambda_i\cdot\lambda_j\,dt + \lambda_i\cdot dW^{N}_t, \end{aligned}

and the last forward LN−1L_{N-1} has none. With L0=0.04L_0 = 0.04, L1=0.05L_1 = 0.05, δ1=0.5\delta_1 = 0.5, volatilities 0.20.2 and 0.250.25 and correlation 0.60.6, the drift rate of L0L_0 under QT2\mathbb{Q}^{T_2} is −0.0251.025(0.2)(0.25)(0.6)≈−0.000732-\frac{0.025}{1.025}(0.2)(0.25)(0.6) \approx -0.000732, an absolute drift of about −2.93×10−5-2.93 \times 10^{-5}. Rates compounded from overnight fixings over the accrual period are known only at its end, so they are different contracts, and the classical formulas need adjustment for them.

Lessons Forward rate market models

Caps, floors and swaptions

A caplet on the rate LL for [Tfix,Tp][T_{\text{fix}}, T_p], with accrual δ\delta, notional NN and payment at TpT_p, is priced under the payment-date forward measure,

Cplt=Nδ P(t,Tp)×EQTp[(L−K)+∣Ft],\begin{aligned} \text{Cpl}_t &= N\delta\,P(t,T_p) \\[0.4em] &\quad \times \mathbb{E}^{\mathbb{Q}^{T_p}}\big[(L - K)^{+} \mid \mathcal{F}_t\big], \end{aligned}

and with the forward rate FF, caplet-floorlet parity is Cpl−Fll=Nδ P(t,Tp)(F−K)\text{Cpl} - \text{Fll} = N\delta\,P(t,T_p)(F - K). With τ\tau the time to fixing, the two standard models for FF give the following prices.

Model for FFCaplet price divided by Nδ P(t,Tp)N\delta\,P(t,T_p)
Black’s formula, lognormal with volatility σB\sigma_BFΦ(d1)−KΦ(d2)F\Phi(d_1) - K\Phi(d_2), d1,2=ln⁡(F/K)±σB2τ/2σBτd_{1,2} = \dfrac{\ln(F/K) \pm \sigma_B^2\tau/2}{\sigma_B\sqrt{\tau}}
Bachelier, normal with volatility σN\sigma_N(F−K)Φ(d)+σNτ φ(d)(F - K)\Phi(d) + \sigma_N\sqrt{\tau}\,\varphi(d), d=F−KσNτd = \dfrac{F - K}{\sigma_N\sqrt{\tau}}

A swaption uses the annuity A(t)=∑jαjP(t,Tj)A(t) = \sum_j\alpha_jP(t,T_j) as numeraire. The forward swap rate S(t)=PVfloat(t)/(N A(t))S(t) = \text{PV}_{\text{float}}(t)/(N\,A(t)) is a martingale under the annuity measure QA\mathbb{Q}^{A}, and a payer swaption with expiry TeT_e is worth N A(t) EQA[(S(Te)−K)+∣Ft]N\,A(t)\,\mathbb{E}^{\mathbb{Q}^{A}}[(S(T_e) - K)^{+} \mid \mathcal{F}_t], priced with the Black or the Bachelier formula for SS. With F=K=0.04F = K = 0.04, τ=1\tau = 1, N=106N = 10^{6}, δ=0.5\delta = 0.5 and P=0.95P = 0.95, the Black caplet with σB=0.2\sigma_B = 0.2 is worth 1513.461513.46 and the Bachelier caplet with σN=0.008\sigma_N = 0.008 is worth 1515.981515.98.

Lessons Caps floors and swaptions

SABR and smile asymptotics

The SABR model for a forward is dFt=atFtβ dWtdF_t = a_tF_t^{\beta}\,dW_t and dat=νat dZtda_t = \nu a_t\,dZ_t, with d[W,Z]t=ρ dtd[W, Z]_t = \rho\,dt, 0≤β≤10 \le \beta \le 1, ν≥0\nu \ge 0 and a0>0a_0 > 0, so at=a0eνZt−ν2t/2a_t = a_0e^{\nu Z_t - \nu^2t/2}. Hagan’s formula is an asymptotic approximation of the Black implied volatility. With ℓ=ln⁡(F/K)\ell = \ln(F/K), m=(FK)(1−β)/2m = (FK)^{(1-\beta)/2} and z=νa0mℓz = \frac{\nu}{a_0}m\ell,

σB≈a0m G zx(z) (1+HT),x(z)=ln⁡y(z)+z−ρ1−ρ,y(z)=1−2ρz+z2,G=1+124(1−β)2ℓ2+11920(1−β)4ℓ4,H=(1−β)2a0224m2+ρβνa04m+124(2−3ρ2)ν2,\begin{aligned} \sigma_B &\approx \frac{a_0}{m\,G}\,\frac{z}{x(z)}\,(1 + HT), \\[0.4em] x(z) &= \ln\frac{y(z) + z - \rho}{1 - \rho}, \\[0.4em] y(z) &= \sqrt{1 - 2\rho z + z^2}, \\[0.4em] G &= 1 + \tfrac{1}{24}(1-\beta)^2\ell^2 \\[0.4em] &\quad + \tfrac{1}{1920}(1-\beta)^4\ell^4, \\[0.4em] H &= \frac{(1-\beta)^2a_0^2}{24m^2} + \frac{\rho\beta\nu a_0}{4m} \\[0.4em] &\quad + \tfrac{1}{24}(2 - 3\rho^2)\nu^2, \end{aligned}

where z/x(z)→1z/x(z) \to 1 at the money. For β=1\beta = 1 the at-the-money value is σATM≈a0[1+(ρνa04+(2−3ρ2)ν224)T]\sigma_{\text{ATM}} \approx a_0\big[1 + \big(\frac{\rho\nu a_0}{4} + \frac{(2 - 3\rho^2)\nu^2}{24}\big)T\big]. The approximation can imply a negative density at low strikes or long maturities, which is an arbitrage. With β=1\beta = 1, a0=0.2a_0 = 0.2, ν=0.4\nu = 0.4, ρ=−0.3\rho = -0.3, T=2T = 2 and F=0.04F = 0.04, the at-the-money volatility is about 0.202210.20221 and the volatility at K=0.05K = 0.05 about 0.195220.19522.

Lessons SABR and smile asymptotics

Collateral discounting and multiple curves

In an idealized trade with perfect cash collateral C=VC = V earning the collateral rate cc, while unsecured funding costs ff, the value satisfies Vt+LV−fV+(f−c)C=0V_t + \mathcal{L}V - fV + (f - c)C = 0. With C=VC = V the funding terms cancel and Vt+LV−cV=0V_t + \mathcal{L}V - cV = 0, so the trade is discounted at the collateral rate, typically an overnight index swap (OIS) rate. Discounting and projection then use different curves. A swap’s floating leg uses projection forwards FixF_i^{x} for its tenor and collateral discount factors Dc(0,Ti)D^{c}(0,T_i),

PVfloat=N∑iδiDc(0,Ti) Fix,Kpar=∑iδiDc(0,Ti) Fix∑iδiDc(0,Ti),\begin{gathered} \text{PV}_{\text{float}} = N\sum_i\delta_iD^{c}(0,T_i)\,F_i^{x}, \\[0.4em] K_{\text{par}} = \frac{\sum_i\delta_iD^{c}(0,T_i)\,F_i^{x}}{\sum_i\delta_iD^{c}(0,T_i)}, \end{gathered}

and the tenor basis is the spread between projection curves of different tenors. With Dc=(0.97,0.94)D^{c} = (0.97, 0.94), Fx=(0.04,0.045)F^{x} = (0.04, 0.045), annual accruals and N=106N = 10^{6}, PVfloat=81,100\text{PV}_{\text{float}} = 81{,}100 and Kpar≈0.042461K_{\text{par}} \approx 0.042461, while the single-curve telescoping value N(1−0.94)=60,000N(1 - 0.94) = 60{,}000 is wrong for these forwards. A rate compounded from daily overnight fixings rjr_j over djd_j days on an actual/360 basis is

R=∏j(1+rjdj/360)−1∑jdj/360,R = \frac{\prod_j(1 + r_jd_j/360) - 1}{\sum_jd_j/360},

so fixings of 0.030.03, 0.040.04 and 0.050.05 over 11, 22 and 11 days compound to about 0.04000550.0400055, slightly above their average 0.040.04.

Lessons Collateral discounting and multiple curves

Credit derivatives and valuation adjustments

Credit risk enters prices through default events, both of the issuers a contract refers to and of the counterparty to the contract itself. Intensity models describe when default happens, structural models tie it to a firm’s assets, and the joint law of defaults drives portfolio and tranche losses. Counterparty exposure, collateral and the valuation adjustments are cash-flow calculations under stated conventions, and every probability here is a pricing probability under Q\mathbb{Q} unless it is marked as physical.

Default intensity, survival and recovery

For a default time τ>0\tau > 0, the survival function is S(t)=Q(τ>t)S(t) = \mathbb{Q}(\tau > t), and when it is differentiable the hazard rate is λ(t)=−S′(t)/S(t)\lambda(t) = -S'(t)/S(t), so that Q(t<τ≤t+h∣τ>t)=λ(t)h+o(h)\mathbb{Q}(t < \tau \le t + h \mid \tau > t) = \lambda(t)h + o(h). Then

S(t)=exp⁡ ⁣(−∫0tλ(u) du),fτ(t)=λ(t)S(t).\begin{gathered} S(t) = \exp\!\Big(-\int_0^t\lambda(u)\,du\Big), \\[0.4em] f_\tau(t) = \lambda(t)S(t) . \end{gathered}

In the Cox construction the intensity λt\lambda_t is a random process, τ\tau is the first time ∫0tλu du\int_0^t\lambda_u\,du reaches an independent exponential variable with mean 11, and S(t)=E[e−∫0tλu du]S(t) = \mathbb{E}\big[e^{-\int_0^t\lambda_u\,du}\big], which is at least e−E∫0tλu due^{-\mathbb{E}\int_0^t\lambda_u\,du} by Jensen’s inequality. A recovery convention states what is paid at default. Under recovery of a fraction RR of face value FF, paid at default, with constant rr and λ\lambda, a defaultable zero-coupon bond is worth

B0=Fe−(r+λ)T+RF λr+λ(1−e−(r+λ)T).\begin{aligned} B_0 &= Fe^{-(r + \lambda)T} \\[0.4em] &\quad + RF\,\frac{\lambda}{r + \lambda}\big(1 - e^{-(r + \lambda)T}\big). \end{aligned}

With F=100F = 100, T=4T = 4, r=0.03r = 0.03, λ=0.04\lambda = 0.04 and R=0.35R = 0.35, the survival probability is e−0.16≈0.8521e^{-0.16} \approx 0.8521, the survival payment is worth 75.57875.578, the recovery 4.8844.884 and the bond 80.46380.463. The one-year default probability is 1−e−0.04≈0.03921 - e^{-0.04} \approx 0.0392, and λ=0.08\lambda = 0.08 lowers the bond to 73.46573.465.

Lessons Default intensity survival and recovery

The Merton model

The Merton model takes the firm’s asset value AtA_t to follow geometric Brownian motion with volatility σ\sigma, with one zero-coupon debt of face FF due at TT and no payouts before TT. Equity receives ET=(AT−F)+E_T = (A_T - F)^{+} and debt DT=min⁡(AT,F)=F−(F−AT)+D_T = \min(A_T, F) = F - (F - A_T)^{+}, so equity is a call on the assets and debt is a riskless bond minus a put. Under Q\mathbb{Q}, where the assets drift at rr,

d2=ln⁡(A0/F)+(r−12σ2)TσT,d1=d2+σT,E0=A0Φ(d1)−Fe−rTΦ(d2),\begin{aligned} d_2 &= \frac{\ln(A_0/F) + (r - \frac{1}{2}\sigma^2)T}{\sigma\sqrt{T}}, \\[0.4em] d_1 &= d_2 + \sigma\sqrt{T}, \\[0.4em] E_0 &= A_0\Phi(d_1) \\[0.4em] &\quad - Fe^{-rT}\Phi(d_2), \end{aligned}

with D0=A0−E0D_0 = A_0 - E_0. The risk-neutral default probability is Q(AT<F)=Φ(−d2)\mathbb{Q}(A_T < F) = \Phi(-d_2), while the physical one puts the asset drift μ\mu in place of rr. The credit spread is −ln⁡(D0/F)/T−r-\ln(D_0/F)/T - r, and by Itô’s lemma the equity volatility satisfies σEE0=σA0Φ(d1)\sigma_EE_0 = \sigma A_0\Phi(d_1). With A0=120A_0 = 120, F=100F = 100, T=2T = 2, r=0.03r = 0.03 and σ=0.25\sigma = 0.25, d1≈0.8622d_1 \approx 0.8622, d2≈0.5086d_2 \approx 0.5086, E0≈31.280E_0 \approx 31.280, D0≈88.720D_0 \approx 88.720, the risk-neutral default probability is 0.30550.3055, the spread is 0.029840.02984 and σE≈0.773\sigma_E \approx 0.773. With μ=0.08\mu = 0.08 the physical default probability is 0.21430.2143. Raising σ\sigma to 0.40.4 moves value from debt to equity, E0≈38.846E_0 \approx 38.846 and D0≈81.154D_0 \approx 81.154.

Lessons Structural credit and the Merton model

Credit default swaps

A protection buyer pays the spread ss on notional NN at dates tit_i with accrual fractions αi\alpha_i until default or maturity TT, and the seller pays N(1−R)N(1 - R) at default. With deterministic discount factors D(t)D(t) and intensity λ(t)\lambda(t) under Q\mathbb{Q}, the risky annuity, including the premium accrued since the last payment date when default occurs, and the protection leg are

A=∑iαiD(ti)S(ti)+∑i∫ti−1ti(t−ti−1)×D(t)λ(t)S(t) dt,Prot=N(1−R)×∫0TD(t)λ(t)S(t) dt.\begin{aligned} A &= \sum_i\alpha_iD(t_i)S(t_i) \\[0.4em] &\quad + \sum_i\int_{t_{i-1}}^{t_i}(t - t_{i-1}) \\[0.4em] &\qquad \times D(t)\lambda(t)S(t)\,dt, \\[0.4em] \text{Prot} &= N(1 - R) \\[0.4em] &\quad \times \int_0^TD(t)\lambda(t)S(t)\,dt . \end{aligned}

The premium leg is worth sNAsNA, and the par spread is spar=Prot/(NA)s_{\text{par}} = \text{Prot}/(NA). With constant rr and λ\lambda and a premium paid continuously, spar=(1−R)λs_{\text{par}} = (1 - R)\lambda exactly, so for discrete payments spar≈(1−R)λs_{\text{par}} \approx (1 - R)\lambda is an approximation. With T=3T = 3, quarterly payments, r=0.02r = 0.02, λ=0.05\lambda = 0.05 and R=0.4R = 0.4, the scheduled annuity is 2.682332.68233, the accrual adds 0.016860.01686, the protection leg is worth 0.0811780.081178 per unit notional and spar≈0.030075s_{\text{par}} \approx 0.030075, against 0.0302640.030264 without the accrual term. With R=0.25R = 0.25 the par spread is about 0.0375940.037594.

Lessons Credit default swap valuation

Default dependence and credit portfolios

With default indicators Ii=1{τi≤T}I_i = \mathbf{1}_{\{\tau_i \le T\}}, exposures wiw_i and recoveries RiR_i, the portfolio loss is L=∑iciIiL = \sum_ic_iI_i with the losses given default ci=wi(1−Ri)c_i = w_i(1 - R_i), and

Var⁡(L)=∑i,jcicjCov⁡(Ii,Ij).\operatorname{Var}(L) = \sum_{i,j}c_ic_j\operatorname{Cov}(I_i, I_j).

The marginal default probabilities do not determine the joint law. The one-factor Gaussian model sets Zi=ρ Y+1−ρ ϵiZ_i = \sqrt{\rho}\,Y + \sqrt{1 - \rho}\,\epsilon_i with independent standard normal YY and ϵi\epsilon_i, and name ii defaults when Zi≤Φ−1(pi)Z_i \le \Phi^{-1}(p_i). For 0≤ρ<10 \le \rho < 1, the default probability given the factor is

pi(y)=Φ(Φ−1(pi)−ρ y1−ρ),p_i(y) = \Phi\Big(\frac{\Phi^{-1}(p_i) - \sqrt{\rho}\,y}{\sqrt{1 - \rho}}\Big),

and the defaults are independent given YY. This is the Gaussian copula. The lower tail dependence coefficient λL=lim⁡u↓0C(u,u)/u\lambda_L = \lim_{u \downarrow 0}C(u, u)/u, where the limit exists, is 00 for a Gaussian copula with ρ<1\rho < 1, so joint extreme defaults are rare in that model, while a tt copula has λL>0\lambda_L > 0. Two names with default probability 0.10.1 each, joint default probability 0.030.03 and loss 5050 each have zero, one or two defaults with probabilities 0.830.83, 0.140.14 and 0.030.03, mean loss 1010 and loss variance 550550, and the indicator correlation is 0.03−0.010.09≈0.222\frac{0.03 - 0.01}{0.09} \approx 0.222. Independent names, with joint probability 0.010.01, give the same mean and variance 450450.

Lessons Default dependence and credit portfolios

Tranches and structured credit

For a portfolio loss LL as a fraction of notional, 0≤L≤10 \le L \le 1, a tranche with attachment aa and detachment dd, 0≤a<d≤10 \le a < d \le 1, absorbs

ℓa,d(L)=min⁡((L−a)+, d−a)=(L−a)+−(L−d)+,\begin{aligned} \ell_{a,d}(L) &= \min\big((L - a)^{+},\ d - a\big) \\[0.4em] &= (L - a)^{+} - (L - d)^{+}, \end{aligned}

which as a fraction of the tranche notional is ℓa,d(L)/(d−a)\ell_{a,d}(L)/(d - a). Its expected loss is an integrated tail,

E[ℓa,d(L)]=∫adP(L>x) dx,\mathbb{E}\big[\ell_{a,d}(L)\big] = \int_a^d\mathbb{P}(L > x)\,dx,

and in general E[ℓa,d(L)]≠ℓa,d(E[L])\mathbb{E}[\ell_{a,d}(L)] \ne \ell_{a,d}(\mathbb{E}[L]). Tranches that partition [0,1][0, 1] add up to the whole portfolio loss in every state. With losses 00, 0.040.04, 0.120.12 and 0.250.25 of probabilities 0.70.7, 0.180.18, 0.090.09 and 0.030.03, the tranche from 0.050.05 to 0.150.15 loses 00, 00, 0.070.07 and 0.100.10, so its expected loss is 0.00930.0093 of the portfolio and 0.0930.093 of the tranche, although the mean loss 0.02550.0255 lies below the attachment point. Moving 0.030.03 of probability from the 0.040.04 state to the 0.250.25 state raises the tranche’s expected fractional loss to 0.1230.123.

Lessons Tranche loss and structured credit

Exposure, netting and collateral

Take the signed value VV of a trade from our side, positive when the counterparty owes us. The exposure is V+V^{+}, and within an enforceable netting set

(∑iVi)+≤∑iVi+,\Big(\sum_iV_i\Big)^{+} \le \sum_iV_i^{+},

so netting never raises exposure. With collateral CC held by us, positive when we hold it, the exposure is (V−C)+(V - C)^{+}. A one-way agreement with threshold HH targets the collateral (V−H)+(V - H)^{+} and moves collateral only when the call reaches a minimum transfer amount. Over the margin period of risk δ\delta between the last collateral exchange and closeout, the exposure is (Vt+δ−Ct)+(V_{t+\delta} - C_t)^{+}. Trades worth 1212, −9-9 and 44 have gross exposure 1616 and net exposure 77. With collateral 22, threshold 33 and minimum transfer 11, the call of 22 raises collateral to 44 and leaves exposure 33. A move to 7.47.4 calls only 0.40.4, below the minimum, so the exposure is 3.43.4, and if the counterparty then stops posting and the trade closes out at 10.510.5, the exposure is 6.56.5.

Lessons Exposure netting and collateral dynamics

Credit valuation adjustment and wrong-way risk

The unilateral credit valuation adjustment prices the counterparty’s default, with closeout value VτcloseV^{\text{close}}_\tau, collateral CτC_\tau and recovery RR,

CVA=EQ[B0Bτ(1−R)×(Vτclose−Cτ)+1{τ≤T}],\begin{gathered} \mathrm{CVA} = \mathbb{E}^{\mathbb{Q}}\Big[\frac{B_0}{B_\tau}(1 - R) \\[0.4em] \times (V^{\text{close}}_\tau - C_\tau)^{+}\mathbf{1}_{\{\tau \le T\}}\Big], \end{gathered}

where the cash account discounts from the default time to time 0. If exposure is independent of default and interest rates are deterministic, so that B0/Bt=D(0,t)B_0/B_t = D(0,t), it reduces to

CVA=(1−R)∫0TEE(t) w(t) dt\mathrm{CVA} = (1 - R)\int_0^T\mathrm{EE}(t)\,w(t)\,dt

with the expected exposure EE(t)=EQ[(Vt−Ct)+]\mathrm{EE}(t) = \mathbb{E}^{\mathbb{Q}}[(V_t - C_t)^{+}] and the discounted default density w(t)=D(0,t)λ(t)S(t)w(t) = D(0,t)\lambda(t)S(t). Dependence enters through E[EI]=E[E] E[I]+Cov⁡(E,I)\mathbb{E}[EI] = \mathbb{E}[E]\,\mathbb{E}[I] + \operatorname{Cov}(E, I) for exposure EE and default indicator II. Wrong-way risk is a positive covariance, exposure that is large when default is likely, and it raises the adjustment above the independent value. Take two states of probability 0.80.8 and 0.20.2 with exposures 22 and 1212 and default probabilities 0.010.01 and 0.20.2, recovery 0.40.4 and discount factor 0.970.97. Then EE=4\mathrm{EE} = 4, the default probability is 0.0480.048, E[EI]=0.496\mathbb{E}[EI] = 0.496 and the covariance is 0.3040.304, so CVA=0.6⋅0.97⋅0.496≈0.2887\mathrm{CVA} = 0.6 \cdot 0.97 \cdot 0.496 \approx 0.2887, against 0.11170.1117 under independence. Default probabilities 0.060.06 and 00 keep the same marginals and give right-way risk, with CVA≈0.0559\mathrm{CVA} \approx 0.0559.

Lessons Credit valuation adjustment and wrong way risk

Funding, margin and capital adjustments

The other valuation adjustments are discounted costs of financing a trade, each computed from its own cash-flow ledger. In a restricted linear setting with deterministic discount factors,

FVA=∫0TD(0,t) ftFt dt,MVA=∫0TD(0,t) mtIt dt,KVA=∫0TD(0,t)×(ht−ct)Kt dt,\begin{aligned} \mathrm{FVA} &= \int_0^TD(0,t)\,f_tF_t\,dt, \\[0.4em] \mathrm{MVA} &= \int_0^TD(0,t)\,m_tI_t\,dt, \\[0.4em] \mathrm{KVA} &= \int_0^TD(0,t) \\[0.4em] &\qquad \times (h_t - c_t)K_t\,dt, \end{aligned}

where FtF_t is the uncollateralized funding need with funding spread ftf_t, ItI_t the posted initial margin with its funding spread mtm_t, and KtK_t the capital held, charged at a hurdle rate hth_t net of the return ctc_t it earns, a policy input. The debt valuation adjustment (DVA) is the value of our own default to the counterparty. Sign conventions differ between institutions, and the adjustments interact, so a funding benefit and the DVA can count the same cash flow twice. One ledger with each cash flow assigned to exactly one adjustment avoids this. With a clean value of 55, two yearly buckets with discount factors 0.980.98 and 0.950.95, funding needs 33 and 22 at a spread of 0.010.01, initial margin 11 and 1.51.5 at 0.0120.012, capital 0.80.8 and 0.60.6 charged 0.080.08, CVA=0.18\mathrm{CVA} = 0.18 and DVA=0.07\mathrm{DVA} = 0.07, the adjustments are FVA=0.0484\mathrm{FVA} = 0.0484, MVA=0.02886\mathrm{MVA} = 0.02886 and KVA=0.10832\mathrm{KVA} = 0.10832, and the adjusted value is 5−0.18+0.07−0.0484−0.02886−0.10832=4.704425 - 0.18 + 0.07 - 0.0484 - 0.02886 - 0.10832 = 4.70442.

Lessons Funding capital and margin valuation adjustments

Risk measurement and model uncertainty

Risk measures summarize the losses a portfolio can suffer over a stated horizon, under a stated model and at a stated confidence level. Losses are positive for adverse outcomes here, so a loss is the negative of PnL. Value at risk is a quantile, expected shortfall averages the tail beyond it, and extreme value theory, stress tests, liquidity adjustments and backtests each answer a narrower question. When the model itself is uncertain, a range of values is more honest than one number.

Profit and loss attribution

Over a short period, a second-order Taylor expansion splits the change in a book’s value V(x,t)V(x, t) into carry, market moves and a residual,

ΔV≈Vt Δt+∇xV⊤Δx+12 Δx⊤Hx Δx,\begin{aligned} \Delta V &\approx V_t\,\Delta t + \nabla_xV^{\top}\Delta x \\[0.4em] &\quad + \tfrac{1}{2}\,\Delta x^{\top}H_x\,\Delta x, \end{aligned}

with HxH_x the Hessian in the risk factors xx. The residual is the actual revalued change minus the explained terms. Along the path g(u)=V(x+uΔx)g(u) = V(x + u\Delta x), it is bounded by M∥Δx∥3/6M\lVert\Delta x\rVert^3/6 when the third directional derivatives are bounded by MM, and it is zero for a quadratic value function. The split depends on a convention, the base point and the order of the factors, which a report states. For V(S,v,t)=0.01S2+2Sv+50v2−3tV(S, v, t) = 0.01S^2 + 2Sv + 50v^2 - 3t at S=100S = 100, v=0.2v = 0.2, t=0t = 0, the value is 142142. A move of ΔS=3\Delta S = 3, Δv=0.02\Delta v = 0.02 and Δt=0.01\Delta t = 0.01 gives a linear market term 11.611.6, a quadratic term 0.230.23 and carry −0.03-0.03, which add exactly to the actual change 11.811.8. Adding 0.0001S30.0001S^3 to VV leaves a residual of 0.00270.0027.

Lessons Profit and loss attribution and sensitivities

Value at risk

For a loss LL over a stated horizon and a confidence level α\alpha such as 0.950.95 or 0.990.99, value at risk is the lower α\alpha-quantile

VaR⁡α(L)=inf⁡{ℓ:FL(ℓ)≥α}.\operatorname{VaR}_{\alpha}(L) = \inf\{\ell : F_L(\ell) \ge \alpha\}.

Historical VaR, the estimate from nn equally weighted losses with order statistics L(1)≤⋯≤L(n)L_{(1)} \le \cdots \le L_{(n)} is q^α=L(⌈nα⌉)\hat{q}_\alpha = L_{(\lceil n\alpha \rceil)}, and other quantile conventions give other numbers. For independent, identically distributed losses whose density ff is positive and continuous at qαq_\alpha, the estimate is approximately normal,

n (q^α−qα)⇒N(0,α(1−α)f(qα)2),\begin{aligned} &\sqrt{n}\,(\hat{q}_\alpha - q_\alpha) \\[0.4em] &\quad \Rightarrow N\Big(0, \frac{\alpha(1 - \alpha)}{f(q_\alpha)^2}\Big), \end{aligned}

so tail quantiles are estimated poorly where the density is small. VaR need not be subadditive. Two independent positions each lose 100100 with probability 0.040.04 and nothing otherwise, so each has VaR⁡0.95=0\operatorname{VaR}_{0.95} = 0, but their sum loses at least 100100 with probability 0.0784>0.050.0784 > 0.05, so VaR⁡0.95\operatorname{VaR}_{0.95} of the sum is 100100. For the twenty constructed losses −4-4, −2-2, −1-1, 00, 11, …\ldots, 1010, 1212, 1414, 1616, 1919, 2525, 4040, the historical VaR⁡0.95\operatorname{VaR}_{0.95} is the 19th smallest, 2525, and VaR⁡0.90\operatorname{VaR}_{0.90} is the 18th, 1919.

Lessons Value at risk and quantile estimation

Expected shortfall and coherent risk measures

For an integrable loss, expected shortfall at level α\alpha averages the quantiles beyond α\alpha, and it also has a threshold representation,

ES⁡α(L)=11−α∫α1qu(L) du=min⁡z[z+E[(L−z)+]1−α],\begin{gathered} \operatorname{ES}_{\alpha}(L) = \frac{1}{1 - \alpha}\int_\alpha^1q_u(L)\,du \\[0.4em] = \min_{z}\Big[z + \frac{\mathbb{E}[(L - z)^{+}]}{1 - \alpha}\Big], \end{gathered}

with the minimum attained at z=VaR⁡α(L)z = \operatorname{VaR}_{\alpha}(L). With an atom at the quantile, ES is not the same as E[L∣L≥VaR⁡α]\mathbb{E}[L \mid L \ge \operatorname{VaR}_\alpha] or E[L∣L>VaR⁡α]\mathbb{E}[L \mid L > \operatorname{VaR}_\alpha], because the quantile integral counts only the part of the atom that lies in the tail. A risk measure ρ\rho is coherent when it is monotone, translation invariant, ρ(L+c)=ρ(L)+c\rho(L + c) = \rho(L) + c, positively homogeneous and subadditive, ρ(L1+L2)≤ρ(L1)+ρ(L2)\rho(L_1 + L_2) \le \rho(L_1) + \rho(L_2). Expected shortfall is coherent, with the dual representation ES⁡α(L)=sup⁡{E[ZL]:0≤Z≤(1−α)−1, E[Z]=1}\operatorname{ES}_\alpha(L) = \sup\{\mathbb{E}[ZL] : 0 \le Z \le (1 - \alpha)^{-1},\ \mathbb{E}[Z] = 1\}, while VaR is not. For losses 00, 1010 and 3030 with probabilities 0.90.9, 0.080.08 and 0.020.02, VaR⁡0.95=10\operatorname{VaR}_{0.95} = 10 and

ES⁡0.95=0.02⋅30+0.03⋅100.05=18,\begin{gathered} \operatorname{ES}_{0.95} = \frac{0.02 \cdot 30 + 0.03 \cdot 10}{0.05} \\[0.4em] = 18, \end{gathered}

while E[L∣L>10]=30\mathbb{E}[L \mid L > 10] = 30 and E[L∣L≥10]=14\mathbb{E}[L \mid L \ge 10] = 14. At α=0.9\alpha = 0.9, ES⁡0.9=14\operatorname{ES}_{0.9} = 14.

Lessons Expected shortfall and coherent risk

Extreme value theory

If normalized maxima of independent losses with distribution FF converge, so that Fn(anx+bn)→Gξ(x)=exp⁡(−(1+ξx)−1/ξ)F^{n}(a_nx + b_n) \to G_\xi(x) = \exp\big(-(1 + \xi x)^{-1/\xi}\big) for 1+ξx>01 + \xi x > 0, with the Gumbel limit at ξ=0\xi = 0, then FF lies in the maximum domain of attraction of GξG_\xi. For a continuous FF, the Pickands-Balkema-de Haan theorem says that this holds exactly when the excess distribution over a threshold uu, Fu(y)=P(L−u≤y∣L>u)F_u(y) = \mathbb{P}(L - u \le y \mid L > u), is uniformly approximated by a generalized Pareto distribution Hξ,β(u)H_{\xi, \beta(u)} as uu rises to the right endpoint of FF. The generalized Pareto tail, for β>0\beta > 0, y≥0y \ge 0 and 1+ξy/β>01 + \xi y/\beta > 0, is

P(L−u>y∣L>u)=(1+ξyβ)−1/ξ,\begin{gathered} \mathbb{P}(L - u > y \mid L > u) \\[0.4em] = \Big(1 + \frac{\xi y}{\beta}\Big)^{-1/\xi}, \end{gathered}

and for ξ>0\xi > 0 the tail index is 1/ξ1/\xi. If this tail holds exactly above uu with exceedance probability pu=P(L>u)p_u = \mathbb{P}(L > u), then for α>1−pu\alpha > 1 - p_u and ξ<1\xi < 1

qα=u+βξ[(pu1−α)ξ−1],ES⁡α=qα+β+ξ(qα−u)1−ξ.\begin{aligned} q_\alpha &= u + \frac{\beta}{\xi}\Big[\Big(\frac{p_u}{1 - \alpha}\Big)^{\xi} - 1\Big], \\[0.4em] \operatorname{ES}_\alpha &= q_\alpha + \frac{\beta + \xi(q_\alpha - u)}{1 - \xi}. \end{aligned}

The excesses over a higher threshold u′u' are again generalized Pareto with the same ξ\xi and β′=β+ξ(u′−u)\beta' = \beta + \xi(u' - u), which is the threshold stability used to check a fit. With u=100u = 100, pu=0.05p_u = 0.05, β=20\beta = 20, ξ=0.2\xi = 0.2 and α=0.99\alpha = 0.99, q0.99≈137.97q_{0.99} \approx 137.97 and ES⁡0.99≈172.47\operatorname{ES}_{0.99} \approx 172.47. Moving the threshold to 120120 gives β′=24\beta' = 24 and exceedance probability 0.02010.0201. With ξ=0.4\xi = 0.4 the same inputs give 145.18145.18 and 208.64208.64, and the limit ξ→0\xi \to 0 gives u+βln⁡(pu/(1−α))≈132.19u + \beta\ln(p_u/(1 - \alpha)) \approx 132.19, so the shape parameter, which is hard to estimate, drives the answer.

Lessons Extreme value theory and tail models

Stress testing

A stress scenario is a vector of joint factor shocks, and the portfolio is revalued under it in full, since the joint loss of a nonlinear book is not the sum of the losses from each shock alone. A reverse stress test looks for the most plausible scenario, in a stated metric, that causes a given loss. For V(x,y)=100+8x−5y+3x2+4xy+2y2V(x, y) = 100 + 8x - 5y + 3x^2 + 4xy + 2y^2, the joint shock (−2,1)(-2, 1) changes the value by −15-15, while the shocks applied one at a time give −4-4 and −3-3, a total of −7-7. Minimizing x2+y2x^2 + y^2 subject to a linear loss −8x+5y≥20-8x + 5y \ge 20 gives the scenario 2089(−8,5)≈(−1.798,1.124)\frac{20}{89}(-8, 5) \approx (-1.798, 1.124) by the Cauchy-Schwarz inequality, but full revaluation there gives a loss of only 15.8615.86, so a linear surrogate can miss the target. This VV is convex with its minimum 54.62554.625 at (−6.5,7.75)(-6.5, 7.75), so no scenario at all loses more than 45.37545.375.

Lessons Stress testing and scenario aggregation

Liquidity risk and closeout horizons

Liquidating qq shares at a constant rate over a horizon hh, with half-spread bb, linear temporary impact η\eta and an unaffected price that moves like Brownian motion with volatility σ\sigma in currency per share per square-root unit of time, costs on average bq+ηq2/hbq + \eta q^2/h, and the price risk of the remaining inventory adds the variance

σ2∫0hq2(1−t/h)2 dt=σ2q2h3.\sigma^2\int_0^hq^2(1 - t/h)^2\,dt = \frac{\sigma^2q^2h}{3}.

With risk aversion λ\lambda, the objective J(h)=bq+ηq2/h+λσ2q2h/3J(h) = bq + \eta q^2/h + \lambda\sigma^2q^2h/3 is convex in hh and has the minimum at

h∗=3ηλσ2.h^{*} = \sqrt{\frac{3\eta}{\lambda\sigma^2}} .

A faster sale pays more impact and a slower one carries more price risk. With q=105q = 10^{5}, b=0.005b = 0.005, η=10−7\eta = 10^{-7}, σ=0.3\sigma = 0.3 per square-root day and λ=10−6\lambda = 10^{-6}, a one-day sale costs 15001500 on average with variance 3×1083 \times 10^{8} and objective 18001800, while h∗≈1.826h^{*} \approx 1.826 days lowers the objective to about 15951595. Doubling σ\sigma halves h∗h^{*} to about 0.9130.913 days.

Lessons Liquidity risk and closeout horizons

Backtesting risk models

A VaR exception at date tt is It=1{Lt>VaR⁡t}I_t = \mathbf{1}_{\{L_t > \operatorname{VaR}_t\}}. If the model has correct coverage and the exceptions are independent, their count over nn days is K∼Binomial(n,p0)K \sim \text{Binomial}(n, p_0) with p0=1−αp_0 = 1 - \alpha. The unconditional coverage likelihood ratio, with kk exceptions,

LRuc=2kln⁡k/np0+2(n−k)ln⁡1−k/n1−p0,\begin{gathered} \text{LR}_{\text{uc}} = 2k\ln\frac{k/n}{p_0} \\[0.4em] + 2(n - k)\ln\frac{1 - k/n}{1 - p_0}, \end{gathered}

is compared with a χ12\chi^2_1 distribution, an asymptotic approximation that is rough for small counts. The independence test fits a two-state Markov chain to the exceptions, with p^01=n01/(n00+n01)\hat{p}_{01} = n_{01}/(n_{00} + n_{01}) and p^11=n11/(n10+n11)\hat{p}_{11} = n_{11}/(n_{10} + n_{11}) from the transition counts, and the conditional coverage statistic LRcc=LRuc+LRind\text{LR}_{\text{cc}} = \text{LR}_{\text{uc}} + \text{LR}_{\text{ind}}, with both parts conditioned on the same first observation, is compared with χ22\chi^2_2. With n=100n = 100, p0=0.05p_0 = 0.05 and k=12k = 12 against 55 expected, LRuc≈7.54>3.84\text{LR}_{\text{uc}} \approx 7.54 > 3.84, the 95 percent point of χ12\chi^2_1, and the exact probability of 1212 or more exceptions is about 0.00430.0043. Four exceptions in twenty days at days 55, 1010, 1515 and 2020 give p^11=0\hat{p}_{11} = 0, while four in a row at days 99 to 1212 give p^11=0.75\hat{p}_{11} = 0.75, the same count with very different timing.

Lessons Risk backtesting and statistical tests

Model uncertainty and robust valuation

Parameter uncertainty is doubt about the inputs of one model, and model ambiguity is doubt about which model, or which pricing measure, is right. If a value is monotone in an uncertain parameter, the range of the parameter maps to a valuation envelope. A Black-Scholes call increases in σ\sigma, so σ∈[σlo,σhi]\sigma \in [\sigma_{\text{lo}}, \sigma_{\text{hi}}] gives the price range [C(σlo),C(σhi)][C(\sigma_{\text{lo}}), C(\sigma_{\text{hi}})]. A local linear bound over a norm ball is sup⁡∥Δθ∥≤ε∇V⊤Δθ=ε∥∇V∥∗\sup_{\lVert\Delta\theta\rVert \le \varepsilon}\nabla V^{\top}\Delta\theta = \varepsilon\lVert\nabla V\rVert_{*} with the dual norm, a first-order bound that holds only for small moves. For a family Q\mathcal{Q} of pricing measures that all fit the market, the robust lower value and the robust upper value of a claim XX with discount factor DD are

V‾=inf⁡Q∈QEQ[DX],V‾=sup⁡Q∈QEQ[DX].\begin{gathered} \underline{V} = \inf_{\mathbb{Q} \in \mathcal{Q}}\mathbb{E}^{\mathbb{Q}}[DX], \\[0.4em] \overline{V} = \sup_{\mathbb{Q} \in \mathcal{Q}}\mathbb{E}^{\mathbb{Q}}[DX]. \end{gathered}

For S0=100S_0 = 100, K=105K = 105, T=1T = 1, r=0.02r = 0.02 and σ\sigma between 0.180.18 and 0.280.28, the call price lies between 5.9085.908 and 9.8959.895, with 7.9017.901 at σ=0.23\sigma = 0.23 and vega 39.8939.89 there. A claim paying 1010 with a probability known only to lie in [0.4,0.6][0.4, 0.6], discounted by 0.980.98, has robust bounds 3.923.92 and 5.885.88.

Lessons Model uncertainty and robust valuation

Portfolio mathematics and allocation

Portfolio choice turns expected returns, covariances and constraints into weights. The weights are only as good as the estimates behind them, so factor models, shrinkage, Bayesian views and uncertainty sets are ways to handle estimation error, and risk budgets, growth criteria and liability matching are different objectives for the same problem. The probabilities here are physical, and every allocation is the solution of a stated model, not a recommendation.

Mean-variance optimization

A portfolio with weights ww on assets with mean returns μ\mu and covariance Σ\Sigma has mean w⊤μw^{\top}\mu and variance w⊤Σww^{\top}\Sigma w. The frontier problem minimizes 12w⊤Σw\frac{1}{2}w^{\top}\Sigma w subject to the budget 1⊤w=1\mathbf{1}^{\top}w = 1 and the target μ⊤w=m\mu^{\top}w = m. If Σ\Sigma is positive definite and μ\mu is not a multiple of 1\mathbf{1}, let A=1⊤Σ−11A = \mathbf{1}^{\top}\Sigma^{-1}\mathbf{1}, B=1⊤Σ−1μB = \mathbf{1}^{\top}\Sigma^{-1}\mu, C=μ⊤Σ−1μC = \mu^{\top}\Sigma^{-1}\mu and Δ=AC−B2>0\Delta = AC - B^2 > 0. Then

w(m)=1Δ Σ−1[(C−Bm)1+(Am−B)μ],σp2(m)=Am2−2Bm+CΔ,\begin{aligned} w(m) &= \frac{1}{\Delta}\,\Sigma^{-1}\big[(C - Bm)\mathbf{1} \\[0.4em] &\qquad + (Am - B)\mu\big], \\[0.4em] \sigma_p^2(m) &= \frac{Am^2 - 2Bm + C}{\Delta}, \end{aligned}

and the global minimum-variance portfolio is w=Σ−11/Aw = \Sigma^{-1}\mathbf{1}/A, with variance 1/A1/A and mean B/AB/A. These weights allow short positions. Constraints such as w≥0w \ge 0 make the problem a quadratic program, and at its solution some constraints are active. With μ=(0.06,0.12)\mu = (0.06, 0.12) and Σ=(0.040.010.010.09)\Sigma = \begin{pmatrix} 0.04 & 0.01 \\ 0.01 & 0.09 \end{pmatrix}, the target m=0.1m = 0.1 needs w=(13,23)w = (\frac{1}{3}, \frac{2}{3}) with variance 0.048890.04889, and the minimum-variance portfolio is about (0.727,0.273)(0.727, 0.273) with mean 0.07640.0764 and variance 0.03180.0318. The target 0.130.13 needs w=(−16,76)w = (-\frac{1}{6}, \frac{7}{6}), which is infeasible without short sales.

Lessons Mean variance optimization and efficient frontiers

Factor models and covariance estimation

A factor model writes excess returns as R−μ=Bf+ϵR - \mu = Bf + \epsilon with loadings BB, factor covariance FF and residual covariance DD, with ff and ϵ\epsilon uncorrelated, so

Σ=BFB⊤+D.\Sigma = BFB^{\top} + D .

A strict factor model takes DD diagonal. The sample covariance Σ^=1n−1∑t(Rt−Rˉ)(Rt−Rˉ)⊤\hat{\Sigma} = \frac{1}{n - 1}\sum_t(R_t - \bar{R})(R_t - \bar{R})^{\top} estimates Σ\Sigma and is singular when nn does not exceed the number of assets. Shrinkage (1−α)Σ^+αT(1 - \alpha)\hat{\Sigma} + \alpha T with 0≤α≤10 \le \alpha \le 1 and a structured target TT stays positive semidefinite, and it is positive definite when TT is and α>0\alpha > 0. The first principal component maximizes the Rayleigh quotient, max⁡v⊤v=1v⊤Σv=λmax⁡(Σ)\max_{v^{\top}v = 1}v^{\top}\Sigma v = \lambda_{\max}(\Sigma), attained at the top eigenvector. With loadings (1,1.5)(1, 1.5), factor variance 0.010.01 and residual variances 0.0040.004 and 0.0090.009, Σ=(0.0140.0150.0150.0315)\Sigma = \begin{pmatrix} 0.014 & 0.015 \\ 0.015 & 0.0315 \end{pmatrix}, and the weights (0.6,0.4)(0.6, 0.4) have variance 0.0144+0.00288=0.017280.0144 + 0.00288 = 0.01728. Shrinking 30 percent toward the diagonal gives 0.015120.01512, and a residual covariance of 0.0020.002 between the two assets raises the true variance to 0.018240.01824.

Lessons Factor models and covariance estimation

Black-Litterman views

The Black-Litterman model starts from equilibrium expected excess returns π=δΣwmkt\pi = \delta\Sigma w_{\text{mkt}} for a risk aversion δ\delta and market weights wmktw_{\text{mkt}}, with the prior μ∼N(π,C)\mu \sim N(\pi, C), often C=τΣC = \tau\Sigma. Views are q=Pμ+ηq = P\mu + \eta with η∼N(0,Ω)\eta \sim N(0, \Omega) independent of μ\mu. Gaussian conditioning gives the posterior mean and covariance, with the gain matrix GG,

G=CP⊤(PCP⊤+Ω)−1,m=π+G (q−Pπ),Cpost=C−G PC,\begin{aligned} G &= CP^{\top}(PCP^{\top} + \Omega)^{-1}, \\[0.4em] m &= \pi + G\,(q - P\pi), \\[0.4em] C_{\text{post}} &= C - G\,PC, \end{aligned}

and with CC and Ω\Omega positive definite, m=J−1(C−1π+P⊤Ω−1q)m = J^{-1}(C^{-1}\pi + P^{\top}\Omega^{-1}q) with the precision J=C−1+P⊤Ω−1PJ = C^{-1} + P^{\top}\Omega^{-1}P. The covariance for predicting returns adds the parameter uncertainty, Σ+Cpost\Sigma + C_{\text{post}}. The prior and the confidences are modeling inputs. With Σ=diag⁡(0.04,0.09)\Sigma = \operatorname{diag}(0.04, 0.09), market weights (0.6,0.4)(0.6, 0.4), δ=2\delta = 2 and τ=0.01\tau = 0.01, π=(0.048,0.072)\pi = (0.048, 0.072). The view μ1−μ2=−0.01\mu_1 - \mu_2 = -0.01 with Ω=0.0001\Omega = 0.0001 differs from the prior by 0.0140.014 and moves the posterior mean to (0.052,0.063)(0.052, 0.063). A less confident view with Ω=0.001\Omega = 0.001 gives about (0.0504,0.0665)(0.0504, 0.0665).

Lessons Black Litterman and Bayesian portfolio views

Robust optimization and estimation risk

Robust optimization chooses ww in a feasible set to maximize the worst case over an uncertainty set U\mathcal{U} for the mean,

max⁡w inf⁡μ∈U[μ⊤w−γ2w⊤Σw].\max_{w}\,\inf_{\mu \in \mathcal{U}}\Big[\mu^{\top}w - \frac{\gamma}{2}w^{\top}\Sigma w\Big].

For an ellipsoid U={μ^+Au:∥u∥2≤ε}\mathcal{U} = \{\hat{\mu} + Au : \lVert u \rVert_2 \le \varepsilon\} the inner infimum is μ^⊤w−ε∥A⊤w∥2\hat{\mu}^{\top}w - \varepsilon\lVert A^{\top}w \rVert_2, and for a box ∣μi−μ^i∣≤δi\lvert \mu_i - \hat{\mu}_i \rvert \le \delta_i it is μ^⊤w−∑iδi∣wi∣\hat{\mu}^{\top}w - \sum_i\delta_i\lvert w_i \rvert, so the worst case acts as a penalty that shrinks positions. With one risky asset and an unrestricted weight,

w∗=sign⁡(μ^) (∣μ^∣−δ)+γσ2,w^{*} = \frac{\operatorname{sign}(\hat{\mu})\,(\lvert\hat{\mu}\rvert - \delta)^{+}}{\gamma\sigma^2},

which is zero when the estimate is within δ\delta of zero. With μ^=0.08\hat{\mu} = 0.08, σ2=0.04\sigma^2 = 0.04, γ=3\gamma = 3 and δ=0.02\delta = 0.02, w∗=0.5w^{*} = 0.5 against 23\frac{2}{3} without uncertainty, and δ=0.09\delta = 0.09 gives w∗=0w^{*} = 0. The answer depends on how the uncertainty set is calibrated, which the method does not supply.

Lessons Robust optimization and estimation risk

Risk contributions and risk parity

For portfolio volatility σp=w⊤Σw>0\sigma_p = \sqrt{w^{\top}\Sigma w} > 0, which is homogeneous of degree one in ww, Euler allocation splits it into contributions by Euler’s theorem,

∂σp∂wi=(Σw)iσp,RCi=wi(Σw)iσp,∑iRCi=σp.\begin{gathered} \frac{\partial\sigma_p}{\partial w_i} = \frac{(\Sigma w)_i}{\sigma_p}, \\[0.4em] \text{RC}_i = \frac{w_i(\Sigma w)_i}{\sigma_p}, \\[0.4em] \sum_i\text{RC}_i = \sigma_p . \end{gathered}

A risk budget assigns target shares bi>0b_i > 0 with ∑ibi=1\sum_ib_i = 1. For positive definite Σ\Sigma, the strictly convex problem of minimizing 12x⊤Σx−∑ibiln⁡xi\frac{1}{2}x^{\top}\Sigma x - \sum_ib_i\ln x_i over x>0x > 0 has a unique solution with xi(Σx)i=bix_i(\Sigma x)_i = b_i, and w=x/(1⊤x)w = x/(\mathbf{1}^{\top}x) has RCi/σp=bi\text{RC}_i/\sigma_p = b_i. Equal budgets give risk parity, or equal risk contribution, and for two assets with positive weights equal contributions mean w1σ1=w2σ2w_1\sigma_1 = w_2\sigma_2, whatever the correlation. With volatilities 0.20.2 and 0.30.3, w=(0.6,0.4)w = (0.6, 0.4). At correlation 0.250.25, σp≈0.1897\sigma_p \approx 0.1897 with marginal risks 0.15810.1581 and 0.23720.2372 and two equal contributions of 0.09490.0949. At correlation −0.5-0.5, σp=0.12\sigma_p = 0.12 and each contributes 0.060.06.

Lessons Risk contributions and risk parity

Expected utility and Kelly growth

Reinvesting a fraction ff of wealth in independent, identically distributed returns RtR_t gives Xn=X0∏t(1+fRt)X_n = X_0\prod_t(1 + fR_t), which needs 1+fRt>01 + fR_t > 0 to keep wealth positive, and by the law of large numbers 1nln⁡(Xn/X0)→E[ln⁡(1+fR)]\frac{1}{n}\ln(X_n/X_0) \to \mathbb{E}[\ln(1 + fR)] almost surely. Maximizing this growth rate, the Kelly criterion, is maximizing expected log utility. For a bet that wins bb per unit staked with probability pp and loses the stake otherwise,

g(f)=pln⁡(1+bf)+(1−p)ln⁡(1−f)\begin{aligned} g(f) &= p\ln(1 + bf) \\[0.4em] &\quad + (1 - p)\ln(1 - f) \end{aligned}

is strictly concave on [0,1)[0, 1), and if pb>1−ppb > 1 - p its maximum is the Kelly fraction

f∗=p−1−pb.f^{*} = p - \frac{1 - p}{b}.

Without that edge the best fraction is 00. With p=0.58p = 0.58 and b=1.2b = 1.2, f∗=0.23f^{*} = 0.23 and g(f∗)≈0.0316g(f^{*}) \approx 0.0316 per bet, half the fraction keeps g≈0.0237g \approx 0.0237, and ten losses in a row at f∗f^{*} leave 0.7710≈0.0730.77^{10} \approx 0.073 of wealth. If the true probability is 0.510.51, betting 0.230.23 gives g≈−0.0038<0g \approx -0.0038 < 0, while the correct fraction 0.10170.1017 gives 0.00620.0062. An overestimated edge can turn the growth rate negative.

Lessons Expected utility and Kelly growth

Dynamic allocation and stochastic control

Under P\mathbb{P}, with a constant rate rr and one stock with constant drift μ\mu and volatility σ>0\sigma > 0, a fraction πt\pi_t in the stock gives wealth dXt=Xt[r+πt(μ−r)] dt+πtσXt dWtdX_t = X_t[r + \pi_t(\mu - r)]\,dt + \pi_t\sigma X_t\,dW_t. For terminal utility UU, the value J(t,x)=sup⁡πE[U(XT)∣Xt=x]J(t, x) = \sup_\pi\mathbb{E}[U(X_T) \mid X_t = x] satisfies the Hamilton-Jacobi-Bellman equation

Jt+sup⁡π[x(r+π(μ−r))Jx+12π2σ2x2Jxx]=0,\begin{aligned} &J_t + \sup_\pi\Big[x\big(r + \pi(\mu - r)\big)J_x \\[0.4em] &\qquad + \tfrac{1}{2}\pi^2\sigma^2x^2J_{xx}\Big] = 0, \end{aligned}

with J(T,x)=U(x)J(T, x) = U(x), and where x>0x > 0, Jx>0J_x > 0 and Jxx<0J_{xx} < 0 the maximizer is π∗=−(μ−r)Jx/(σ2xJxx)\pi^{*} = -(\mu - r)J_x/(\sigma^2xJ_{xx}). For power utility U(x)=x1−γ/(1−γ)U(x) = x^{1 - \gamma}/(1 - \gamma), with constant relative risk aversion (CRRA) γ>0\gamma > 0 and γ≠1\gamma \ne 1, the Merton fraction is constant,

π∗=μ−rγσ2,\pi^{*} = \frac{\mu - r}{\gamma\sigma^2},

and J(t,x)=x1−γ1−γe(1−γ)k(T−t)J(t, x) = \frac{x^{1-\gamma}}{1-\gamma}e^{(1 - \gamma)k(T - t)} with k=r+(μ−r)22γσ2k = r + \frac{(\mu - r)^2}{2\gamma\sigma^2}. A solution of the equation is the value function only after a verification argument over the admissible controls. With μ=0.08\mu = 0.08, r=0.02r = 0.02, σ=0.2\sigma = 0.2, γ=4\gamma = 4 and T=3T = 3, π∗=0.375\pi^{*} = 0.375, k=0.03125k = 0.03125 and J(0,1)≈−0.2516J(0, 1) \approx -0.2516. A cap of 0.250.25 on the fraction lowers the value to about −0.2545-0.2545.

Lessons Dynamic allocation and stochastic control

Liability hedging and immunization

With a flat continuously compounded yield yy, a stream of fixed cash flows cjc_j at tjt_j is worth V(y)=∑jcje−ytjV(y) = \sum_jc_je^{-yt_j}, with duration D=−V′/VD = -V'/V and convexity C=V′′/V\mathcal{C} = V''/V. Immunization against parallel shifts matches the present value and the duration of assets and liabilities, A0=L0A_0 = L_0 and DA=DLD_A = D_L. Then the surplus has zero first-order sensitivity, and a larger asset convexity makes it gain to second order. A liability of 100100 due in 55 years at y=0.03y = 0.03 is worth 86.07186.071. Assets with equal present values at 33 and 77 years, faces 47.08847.088 and 53.09253.092, have duration 55 and convexity 2929 against 2525. After a parallel shift δ\delta the asset-to-liability ratio is 12(e2δ+e−2δ)=cosh⁡(2δ)≥1\frac{1}{2}(e^{2\delta} + e^{-2\delta}) = \cosh(2\delta) \ge 1, and δ=0.01\delta = 0.01 leaves a surplus of 0.01640.0164. The match fails for other curve moves. A rise of 1 percent in the seven-year rate alone lowers the assets by 2.9092.909 and leaves the liability unchanged. Key rate matching chooses holdings zz of hedge instruments whose key rate sensitivities form the columns of a matrix HH, so that Hz=ℓHz = \ell equals the liability’s key rate sensitivities, and this hedges each node to first order.

Lessons Liability hedging and immunization

Statistical quant research

A research question asks whether information available at a date predicts a later return well enough to matter after costs. Answering it honestly needs data recorded as it was known, targets and features tied to an information set, validation that follows time, an account of every strategy tried, and a model of costs. A backtest is an estimate under these rules, not a forecast, and a correlation found in data is not a causal effect. Probabilities here are physical.

Point-in-time data

The information set Ft\mathcal{F}_t contains only records whose availability time is at most tt, and a feature XtX_t is admissible when σ(Xt)⊆Ft\sigma(X_t) \subseteq \mathcal{F}_t, so it is computable at tt. Revised data are stored with their release times, and a decision at tt uses the latest version released by tt, not a later revision. A sample restricted to survivors measures E[R∣survived]\mathbb{E}[R \mid \text{survived}], which in general differs from the return of the universe fixed at the start, and the difference is survivorship bias. Corporate actions are handled by following wealth, with the total return R=(n1P1+C1−n0P0)/(n0P0)R = (n_1P_1 + C_1 - n_0P_0)/(n_0P_0) for shares nn, prices PP and cash C1C_1 received. If a value is released as 22 at time 11, revised to 33 at time 1010 and to 2.52.5 at time 1515, decisions at times 99, 1111 and 1616 see 22, 33 and 2.52.5. Three stocks returning 0.10.1, −0.05-0.05 and −1-1 average about −0.317-0.317, while the two survivors average 0.0250.025, a bias of about 34 percentage points. One share bought at 120120 that splits two for one and ends at 6363 per new share with a dividend of 0.50.5 per new share returns 2(63)+1−120120=7120≈0.058\frac{2(63) + 1 - 120}{120} = \frac{7}{120} \approx 0.058, not the raw price change of −0.475-0.475.

Lessons Point in time financial data and sampling

Prediction targets and features

A target is defined relative to a decision time and a horizon, such as the return Yt,h=Xt+h/Xt−1Y_{t,h} = X_{t+h}/X_t - 1 of wealth XX, and a feature is a function of observations available by tt. If E[Y2]<∞\mathbb{E}[Y^2] < \infty, the best Ft\mathcal{F}_t-measurable predictor under squared error is the conditional mean mt=EP[Y∣Ft]m_t = \mathbb{E}^{\mathbb{P}}[Y \mid \mathcal{F}_t], since for every square-integrable Ft\mathcal{F}_t-measurable ata_t

E[(Y−at)2]=E[(Y−mt)2]+E[(mt−at)2].\begin{aligned} \mathbb{E}[(Y - a_t)^2] &= \mathbb{E}[(Y - m_t)^2] \\[0.4em] &\quad + \mathbb{E}[(m_t - a_t)^2]. \end{aligned}

A good predictor is not yet a trading rule, which also needs costs, risk and constraints. In two equally likely regimes, known before the return, the return is 0.040.04 or −0.02-0.02 with up probabilities 0.60.6 and 0.20.2. The conditional means are 0.0160.016 and −0.008-0.008 and the overall mean is 0.0040.004. The best predictor has mean squared error 0.000720.00072, the average within-regime variance, against 0.0008640.000864 for the constant prediction, and the difference 0.0001440.000144 is the between-regime variance.

Lessons Financial prediction and feature construction

Losses, regularization and calibration

A learning method minimizes an empirical risk plus a penalty, estimating the population risk E[ℓ(Y,fθ(X))]\mathbb{E}[\ell(Y, f_\theta(X))]. Ridge regression with objective 1n∥y−Xθ∥2+λ∥θ∥2\frac{1}{n}\lVert y - X\theta \rVert^2 + \lambda\lVert\theta\rVert^2 has, for λ>0\lambda > 0, the unique solution

θ^=(X⊤X+nλI)−1X⊤y,\hat{\theta} = (X^{\top}X + n\lambda I)^{-1}X^{\top}y,

because the objective is strictly convex. A probability forecast QQ of a binary outcome YY is calibrated when E[Y∣Q]=Q\mathbb{E}[Y \mid Q] = Q almost surely. A loss is proper when the true probability minimizes the expected loss. The Brier loss is proper, since for P(Y=1∣X)=p\mathbb{P}(Y = 1 \mid X) = p the expected loss of the forecast qq is p(1−p)+(p−q)2p(1 - p) + (p - q)^2, and the log loss is proper too. Under covariate shift, the law of XX changes while P(Y∣X)\mathbb{P}(Y \mid X) does not, and if the training density is positive wherever the deployment density is,

Edeploy[ℓ]=Etrain[pdeploy(X)ptrain(X) ℓ].\begin{aligned} &\mathbb{E}_{\text{deploy}}[\ell] \\[0.4em] &\quad = \mathbb{E}_{\text{train}}\Big[\frac{p_{\text{deploy}}(X)}{p_{\text{train}}(X)}\,\ell\Big]. \end{aligned}

With x=(1,2)x = (1, 2), y=(1,2)y = (1, 2), one coefficient, no intercept and λ=1\lambda = 1, θ^=57\hat{\theta} = \frac{5}{7}, with mean squared error 1049\frac{10}{49} and objective 57\frac{5}{7}, against θ^=1\hat{\theta} = 1 without the penalty. For p=0.7p = 0.7 the forecast 0.30.3 has Brier loss 0.370.37 and the forecast 0.70.7 has 0.210.21.

Lessons Machine learning losses regularization and calibration

Validation with overlapping labels

Validation follows the order of time. A label that starts at decision time tt with horizon hh uses the increments {t+1,…,t+h}\{t + 1, \ldots, t + h\}, so labels with nearby start times overlap. Walk-forward validation trains only on labels completed before the first test decision. Purging removes training labels whose increments overlap those of the validation labels, and an embargo also removes labels just after the validation block. Nested validation chooses tuning parameters in an inner loop and estimates performance on later data in an outer loop, so selection and evaluation do not share data. None of these steps makes the samples independent or guarantees future performance. With starts 00 to 1515, h=3h = 3 and validation starts 66, 77 and 88, the validation increments are 77 to 1111. Purging removes the starts 44, 55, 99 and 1010, an embargo on 1111 to 1313 leaves 00 to 33, 1414 and 1515, and walk-forward training uses only the starts 00 to 33, which become 00 to 55 when h=1h = 1.

Lessons Time series validation and overlapping labels

Multiple testing and backtest overfitting

Testing many strategies and keeping the best changes the experiment. With mm independent tests of true null hypotheses with uniform p-values, the chance that at least one has p≤αp \le \alpha is 1−(1−α)m1 - (1 - \alpha)^m, which is 0.9940.994 for m=100m = 100 and α=0.05\alpha = 0.05. The Bonferroni correction rejects when pj≤α/mp_j \le \alpha/m and keeps the family-wise error rate at most α\alpha under any dependence, by the union bound. The false discovery rate is E[V/max⁡(R,1)]\mathbb{E}[V/\max(R, 1)], the expected share of false rejections VV among all RR rejections. The Benjamini-Hochberg procedure sorts the p-values, finds the largest kk with p(k)≤kq/mp_{(k)} \le kq/m and rejects the kk smallest, and under independence it keeps the false discovery rate at most m0q/m≤qm_0q/m \le q, with m0m_0 true nulls. A backtest selected from many trials is biased upward, so every trial is counted and reported. With threshold 0.00050.0005, the family-wise error for 100100 independent nulls is about 0.04880.0488. For the p-values 0.0010.001, 0.0120.012, 0.0250.025 and 0.120.12 with q=0.05q = 0.05, the thresholds are 0.01250.0125, 0.0250.025, 0.03750.0375 and 0.050.05, so the procedure rejects three.

Lessons Multiple testing and backtest overfitting

Cointegration and statistical arbitrage

A series is integrated of order one when its first difference is stationary with short memory but the series is not. Two such series are cointegrated when some nonzero combination of them is stationary. If Xt=Zt+etX_t = Z_t + e_t and Yt=2Zt+vtY_t = 2Z_t + v_t share a random walk ZtZ_t and the noises ete_t and vtv_t are independent and stationary, the trend cancels in Yt−2Xt=vt−2etY_t - 2X_t = v_t - 2e_t, with variance σv2+4σe2\sigma_v^2 + 4\sigma_e^2. If the spread zt=Yt−2Xtz_t = Y_t - 2X_t follows zt=ρzt−1+utz_t = \rho z_{t-1} + u_t with ∣ρ∣<1\lvert\rho\rvert < 1, then

ΔYt=2ΔXt+(ρ−1)zt−1+ut,\Delta Y_t = 2\Delta X_t + (\rho - 1)z_{t-1} + u_t,

an error-correction form in which the lagged spread zt−1=Yt−1−2Xt−1z_{t-1} = Y_{t-1} - 2X_{t-1} pulls the series back together, and given Ft\mathcal{F}_t the spread has mean ρhzt\rho^hz_t and variance σu2(1−ρ2h)/(1−ρ2)\sigma_u^2(1 - \rho^{2h})/(1 - \rho^2) after hh steps. Tests for cointegration have nonstandard distributions, and a spread that reverted in the past can stop reverting, so a trade on it is a risky decision. With σv2=0.04\sigma_v^2 = 0.04 and σe2=0.01\sigma_e^2 = 0.01 the spread variance is 0.080.08. With ρ=0.8\rho = 0.8 and σu2=0.04\sigma_u^2 = 0.04 the stationary variance is 19\frac{1}{9}. From z0=1z_0 = 1, a shock u1=0.1u_1 = 0.1 gives z1=0.9z_1 = 0.9, and ten steps ahead the expected spread is 0.810≈0.1070.8^{10} \approx 0.107 with variance 0.1100.110.

Lessons Cointegration and statistical arbitrage

Signal evaluation and the Sharpe ratio

The information coefficient of a signal sts_t is Corr⁡(st,Yt+h)\operatorname{Corr}(s_t, Y_{t+h}) with the later return. The Sharpe ratio of excess returns with mean μ\mu and standard deviation σ\sigma per period is μ/σ\mu/\sigma. For the sum of qq periods of a stationary series with autocovariances γk\gamma_k,

vq=Var⁡(∑t=1qRt)=qγ0+2∑k=1q−1(q−k)γk,SRq=qμvq.\begin{aligned} v_q &= \operatorname{Var}\Big(\sum_{t=1}^{q}R_t\Big) \\[0.4em] &= q\gamma_0 + 2\sum_{k=1}^{q-1}(q - k)\gamma_k, \\[0.4em] \text{SR}_q &= \frac{q\mu}{\sqrt{v_q}} . \end{aligned}

Scaling a Sharpe ratio by q\sqrt{q}, for example by 252\sqrt{252} from daily to annual, is exact only when the returns are uncorrelated with constant mean and variance, as for independent, identically distributed returns. With μ=0.01\mu = 0.01, γ0=0.01\gamma_0 = 0.01 and γk=0.01⋅0.5k\gamma_k = 0.01 \cdot 0.5^{k}, twelve periods have variance about 0.320.32 and SR12≈0.212\text{SR}_{12} \approx 0.212, not 12×0.1≈0.346\sqrt{12} \times 0.1 \approx 0.346. Attribution needs a declared factor model Rt=α+β⊤ft+εtR_t = \alpha + \beta^{\top}f_t + \varepsilon_t, and with E[εt]=0\mathbb{E}[\varepsilon_t] = 0 the mean splits as E[R]=α+β⊤E[f]\mathbb{E}[R] = \alpha + \beta^{\top}\mathbb{E}[f]. With α=0.002\alpha = 0.002, β=(1.2,−0.5)\beta = (1.2, -0.5) and factor means (0.01,0.004)(0.01, 0.004), the factors contribute 0.0120.012 and −0.002-0.002 to a mean of 0.0120.012.

Lessons Signal evaluation and performance attribution

Turnover, costs and capacity

Turnover is τ=∑i∣winew−wiold∣\tau = \sum_i\lvert w_i^{\text{new}} - w_i^{\text{old}} \rvert, counting buys and sells, so capital AA trades AτA\tau per period. Under a constructed cost model with proportional cost cc and impact coefficient kk against market volume VV in currency per period, the cost is cAτ+k(Aτ)2/VcA\tau + k(A\tau)^2/V and the net return on capital is

gnet(A)=g−cτ−kAτ2Vg_{\text{net}}(A) = g - c\tau - \frac{kA\tau^2}{V}

for a gross return gg that does not depend on AA. If g>cτg > c\tau, the break-even capacity, where the net return reaches zero, and the profit-maximizing capital are

A∗=V(g−cτ)kτ2,Aprofit=A∗2.\begin{gathered} A^{*} = \frac{V(g - c\tau)}{k\tau^2}, \\[0.4em] A_{\text{profit}} = \frac{A^{*}}{2}. \end{gathered}

With g=0.002g = 0.002, c=0.0002c = 0.0002, τ=2\tau = 2, k=0.01k = 0.01 and V=108V = 10^{8}, capital of 10610^{6} earns a net return of 0.00120.0012, a profit of 12001200 after costs of 800800. Capacity is A∗=4×106A^{*} = 4 \times 10^{6}, and profit peaks at 16001600 with 2×1062 \times 10^{6}. Halving turnover to τ=1\tau = 1 raises capacity to 1.8×1071.8 \times 10^{7}.

Lessons Turnover costs and strategy capacity

Execution calibration and mathematical production

Models reach markets through orders, calibrated parameters and code. Order book queues, adverse selection and price impact explain execution costs, implementation shortfall measures them, and optimal execution and market making trade cost against inventory risk. Automatic differentiation, calibration and validation are the tools that keep a production model’s numbers correct, identifiable and monitored. The models below are simplified constructions with stated assumptions.

Limit order books and queues

A limit order book holds resting buy and sell orders by price, and at one price orders are filled first in, first out. Suppose aa units rest ahead of our one-unit order and eligible removals at that price arrive as a Poisson process with rate μ\mu, with no cancellations ahead of us and no price change. The order fills by time hh when at least a+1a + 1 removals occur, so

P(fill by h)=1−e−μh∑k=0a(μh)kk!,\begin{gathered} \mathbb{P}(\text{fill by } h) \\[0.4em] = 1 - e^{-\mu h}\sum_{k=0}^{a}\frac{(\mu h)^k}{k!}, \end{gathered}

and the fill time has the Erlang distribution with mean (a+1)/μ(a + 1)/\mu. Birth-death models add arrivals that lengthen the queue and give state-dependent fill probabilities. With a=4a = 4, μ=3\mu = 3 per minute and h=2h = 2 minutes, the fill probability is 1−115e−6≈0.7151 - 115e^{-6} \approx 0.715 and the mean fill time is 53\frac{5}{3} minutes. With μ=2\mu = 2 they become 0.3710.371 and 2.52.5 minutes.

Lessons Limit order books and queueing models

Adverse selection and price impact

A dealer who sets quotes so that each trade earns zero expected profit charges for the information that trades carry. Let the value be VHV_H or VLV_L with equal probability, let a fraction θ\theta of traders know it and buy exactly when it is high, and let the rest buy or sell with probability 12\frac{1}{2} each. Then P(H∣buy)=1+θ2\mathbb{P}(H \mid \text{buy}) = \frac{1 + \theta}{2}, and with VH=101V_H = 101 and VL=99V_L = 99 the ask is E[V∣buy]=100+θ\mathbb{E}[V \mid \text{buy}] = 100 + \theta and the bid is 100−θ100 - \theta. The spread 2θ2\theta exists without any inventory cost, and it is 0.40.4 for θ=0.2\theta = 0.2 and 0.80.8 for θ=0.4\theta = 0.4. Signed order flow moves prices through a permanent part, which stays in later prices, and a temporary part, which affects only the execution. With linear coefficients 0.00020.0002 and 0.00050.0005 per share, a purchase of 100100 shares at a midpoint of 100100 executes at 100.07100.07 and leaves the midpoint at 100.02100.02. A regression of price changes on flow measures association, and reading it as causal impact needs a separate identification argument.

Lessons Order flow adverse selection and price impact

Transaction cost analysis

For a buy order of QQ shares decided at price p0p_0, filled in parts qiq_i at prices pip_i, with the unfilled rest valued at the final price pTp_T, the implementation shortfall compares the actual portfolio with a paper portfolio that bought everything at p0p_0,

IS=∑iqi(pi−p0)+(Q−∑iqi)(pT−p0)+fees,\begin{aligned} \text{IS} &= \sum_iq_i(p_i - p_0) \\[0.4em] &\quad + \Big(Q - \sum_iq_i\Big)(p_T - p_0) \\[0.4em] &\quad + \text{fees}, \end{aligned}

the paper gain Q(pT−p0)Q(p_T - p_0) minus the actual gain ∑iqi(pT−pi)−fees\sum_iq_i(p_T - p_i) - \text{fees}. The volume-weighted average price is VWAP=∑jvjpj/∑jvj\text{VWAP} = \sum_jv_jp_j/\sum_jv_j, and a fill can beat the VWAP while the shortfall is large, because the benchmark moves with the order’s own trading and ignores the unfilled part. For a sell order the signs reverse. With Q=1000Q = 1000, p0=100p_0 = 100, fills of 400400 at 100.1100.1 and 300300 at 100.2100.2, pT=100.5p_T = 100.5 and fees of 1010, the execution cost is 100100, the opportunity cost of the 300300 unfilled shares is 150150, and IS=260=500−240\text{IS} = 260 = 500 - 240. Measured from an arrival price of 100.05100.05, it splits into a delay cost of 5050, an execution cost of 6565, an opportunity cost of 135135 and the fees. The fills average 100.143100.143, below the market VWAP of 100.15100.15.

Lessons Transaction cost analysis and execution benchmarks

Optimal execution

The Almgren-Chriss model sells an inventory x(t)x(t) from x(0)=Qx(0) = Q to x(T)=0x(T) = 0, with linear temporary impact η\eta and an unaffected price that moves like Brownian motion with volatility σ\sigma. The expected cost from permanent impact is γQ2/2\gamma Q^2/2 whatever the path, so the trader minimizes the temporary impact cost plus λ\lambda times the variance of the revenue,

J[x]=η∫0Tx˙2 dt+λσ2∫0Tx2 dt.\begin{aligned} J[x] &= \eta\int_0^T\dot{x}^2\,dt \\[0.4em] &\quad + \lambda\sigma^2\int_0^Tx^2\,dt . \end{aligned}

The Euler-Lagrange equation ηx¨=λσ2x\eta\ddot{x} = \lambda\sigma^2x with κ=λσ2/η\kappa = \sqrt{\lambda\sigma^2/\eta} gives

x∗(t)=Q sinh⁡(κ(T−t))sinh⁡(κT),x^{*}(t) = Q\,\frac{\sinh\big(\kappa(T - t)\big)}{\sinh(\kappa T)},

and it is the global minimum, since J[x∗+h]−J[x∗]=η∫h˙2 dt+λσ2∫h2 dt≥0J[x^{*} + h] - J[x^{*}] = \eta\int\dot{h}^2\,dt + \lambda\sigma^2\int h^2\,dt \ge 0 for every admissible change hh with h(0)=h(T)=0h(0) = h(T) = 0. As λ→0\lambda \to 0 the schedule becomes linear, and a larger λ\lambda sells faster at first. With Q=1Q = 1, T=1T = 1, η=0.04\eta = 0.04, σ=0.2\sigma = 0.2 and λ=1\lambda = 1, κ=1\kappa = 1, half the time leaves 0.4430.443 of the inventory and the objective is 0.05250.0525, against 0.05330.0533 for the linear schedule. With λ=4\lambda = 4, κ=2\kappa = 2 and 0.3240.324 remains at half time.

Lessons Optimal execution and the Almgren Chriss model

Market making and inventory

A market maker with exponential utility of risk aversion γ\gamma, holding qq units and cash xx, with a midpoint that moves like Brownian motion with volatility σ\sigma over a horizon HH, has the certainty equivalent x+qs−12γq2σ2Hx + qs - \frac{1}{2}\gamma q^2\sigma^2H at the midpoint ss. The reservation price, at which one more unit leaves the certainty equivalent unchanged to first order, shifts against the inventory,

r=s−qγσ2H,r = s - q\gamma\sigma^2H,

and the exact indifference prices for one more unit bought or sold are s−γσ2H(q+12)s - \gamma\sigma^2H(q + \frac{1}{2}) and s−γσ2H(q−12)s - \gamma\sigma^2H(q - \frac{1}{2}). If quotes at distance δ\delta from the reservation price are filled with intensity Ae−kδAe^{-k\delta}, the Avellaneda-Stoikov approximation places the bid and the ask at rr minus and plus half of

spread≈γσ2H+2γln⁡(1+γk).\begin{aligned} \text{spread} &\approx \gamma\sigma^2H \\[0.4em] &\quad + \frac{2}{\gamma}\ln\Big(1 + \frac{\gamma}{k}\Big). \end{aligned}

This is an approximation, not a solution of the full control problem. With s=50s = 50, q=3q = 3, γ=0.1\gamma = 0.1, σ=0.5\sigma = 0.5, H=2H = 2 and k=2k = 2, r=49.85r = 49.85, the spread is about 1.0261.026, and the quotes are about 49.33749.337 and 50.36350.363. A short inventory of −3-3 shifts them up to 49.63749.637 and 50.66350.663.

Lessons Market making and inventory control

Automatic differentiation and pathwise Greeks

Automatic differentiation applies the chain rule to the computational graph of a pricing code. Forward mode carries one input direction per pass, and reverse mode carries adjoints vˉi=∑j:i→jvˉj ∂vj/∂vi\bar{v}_i = \sum_{j : i \to j}\bar{v}_j\,\partial v_j/\partial v_i backward, so one pass gives the derivatives of one output with respect to all inputs. For a simulated path ST=S0eaS_T = S_0e^{a} with a=(r−12σ2)T+σTza = (r - \frac{1}{2}\sigma^2)T + \sigma\sqrt{T}z and discounted payoff Y=e−rT(ST−K)+Y = e^{-rT}(S_T - K)^{+}, on paths with ST>KS_T > K,

∂S0Y=e−rTST/S0,∂σY=e−rTST(Tz−σT),∂rY=e−rTTK,\begin{aligned} \partial_{S_0}Y &= e^{-rT}S_T/S_0, \\[0.4em] \partial_\sigma Y &= e^{-rT}S_T(\sqrt{T}z - \sigma T), \\[0.4em] \partial_rY &= e^{-rT}TK, \end{aligned}

and all three are 00 when ST<KS_T < K. Averaging these pathwise derivatives gives unbiased Greeks when the derivative and the expectation can be interchanged, which holds here because the payoff is Lipschitz in the parameters with an integrable constant. For a digital payoff the pathwise derivative is 00 almost everywhere while the price derivative is not, so the interchange fails and a likelihood ratio or a smoothed payoff is needed. With S0=100S_0 = 100, K=102K = 102, T=1T = 1, r=0.03r = 0.03, σ=0.2\sigma = 0.2 and z=0.4z = 0.4, a=0.09a = 0.09, ST≈109.417S_T \approx 109.417 and Y≈7.198Y \approx 7.198, with derivatives 1.06181.0618, 21.23721.237 and 98.98598.985 that match central finite differences on the same draw.

Lessons Differentiable pricing and automatic differentiation

Calibration and identifiability

Calibration solves an inverse problem, choosing parameters θ\theta so that model prices gi(θ)g_i(\theta) match quotes qiq_i,

min⁡θ ∑iwi(gi(θ)−qi)2+η∥L(θ−θ0)∥2,\begin{aligned} \min_\theta\ &\sum_iw_i\big(g_i(\theta) - q_i\big)^2 \\[0.4em] &+ \eta\lVert L(\theta - \theta_0)\rVert^2, \end{aligned}

with positive weights wiw_i and an optional penalty toward a prior value θ0\theta_0. For linear prices g(θ)=Aθg(\theta) = A\theta and weight matrix WW, the normal equations are (A⊤WA+ηL⊤L)θ=A⊤Wq+ηL⊤Lθ0(A^{\top}WA + \eta L^{\top}L)\theta = A^{\top}Wq + \eta L^{\top}L\theta_0. If A⊤WAA^{\top}WA is singular, the quotes do not identify θ\theta. Different parameters fit equally well and disagree elsewhere, and a penalty selects one of them without identifying it. In nonlinear problems an ill-conditioned price Jacobian has the same effect. With g(t)=a+btg(t) = a + bt and one quote 33 at t=1t = 1, both (a,b)=(3,0)(a, b) = (3, 0) and (1,2)(1, 2) fit exactly but price 33 and 55 at t=2t = 2. With unit weight, L=IL = I and the penalty η=0.1\eta = 0.1 toward (1,1)(1, 1), the fit is a=b=3.12.1≈1.476a = b = \frac{3.1}{2.1} \approx 1.476, which misses the quote slightly, at 2.9522.952. Adding the quote 55 at t=2t = 2 identifies (1,2)(1, 2).

Lessons Calibration inverse problems and identifiability

Model validation and monitoring

Validation checks the mathematical object, its implementation and its use. Invariants such as put-call parity, C−P=S0−K D(0,T)C - P = S_0 - K\,D(0,T) for European options on a stock without dividends, catch inconsistent prices. Numerical convergence is checked by refinement. If an approximation behaves like Ah=A+chp+o(hp)A_h = A + ch^{p} + o(h^{p}), then

∣Ah−A∣∣Ah/2−A∣→2p\frac{\lvert A_h - A \rvert}{\lvert A_{h/2} - A \rvert} \to 2^{p}

as h→0h \to 0. Monitoring after deployment uses tests set in advance, such as Z=(Xˉ−μ0)/(σ0/n)Z = (\bar{X} - \mu_0)/(\sigma_0/\sqrt{n}) against a fixed threshold, for nn independent observations whose reference mean μ0\mu_0 and standard deviation σ0\sigma_0 are known. Reproducibility means the same code, data, random seeds and environment give the same output, and the limitations of a model are written down with it. The trapezoidal rule for ∫01e−x dx=1−e−1\int_0^1e^{-x}\,dx = 1 - e^{-1} with 1010, 2020 and 4040 intervals has errors that fall by a factor of about 4.04.0 at each halving, so p=2p = 2. Prices C=8C = 8 and P=5P = 5 with S0=K=100S_0 = K = 100 and D=0.97D = 0.97 satisfy parity exactly, and P=5.01P = 5.01 leaves a residual of −0.01-0.01. With n=100n = 100, μ0=0\mu_0 = 0 and σ0=1\sigma_0 = 1, a mean of 0.350.35 gives Z=3.5Z = 3.5, above a threshold of 33, while 0.10.1 gives Z=1Z = 1.

Lessons Model validation reproducibility and monitoring