σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
σμimplied vol · KKmax(S−K,0)udβρᵢⱼfat tailsPnL · drawdownyield · TdSₜ = μSₜ dt + σSₜ dWₜC = S·N(d₁) − K·e⁻ʳᵀ·N(d₂)σₚ² = wᵀΣwd₁ = [ln(S/K) + (r + σ²⁄2)T] ⁄ σ√T∂V/∂t + ½σ²S²·∂²V/∂S² + rS·∂V/∂S − rV = 0Sharpe = (Rₚ − R_f) ⁄ σₚVaR₉₉ = μ − 2.33σρ = Cov(X,Y) ⁄ σₓσᵧE[Rₚ] = Σ wᵢ·E[Rᵢ]φ(x) = e^(−x²/2) ⁄ √2πE[Rᵢ] = R_f + βᵢ(E[Rₘ] − R_f)dXₜ = θ(μ − Xₜ)dt + σ dWₜσ²ₜ = ω + α·ε²ₜ₋₁ + β·σ²ₜ₋₁C − P = S − K·e⁻ʳᵀΔ = ∂V/∂S Γ = ∂²V/∂S²p = (e^(rΔt) − d) ⁄ (u − d)rₜ = ln(Pₜ ⁄ Pₜ₋₁)E[Xₜ₊₁ | ℱₜ] = Xₜf* = (bp − q) ⁄ bz = (x − μ) ⁄ σP(N=k) = λᵏe^(−λ) ⁄ k!Θ = −∂V/∂Tν = S·φ(d₁)·√Tmin wᵀΣw s.t. wᵀμ = μ*∫Σ∂∞λ
uantCraft AcademyRoadmapsSkills
Ctrl K
AO
+1.2k Learners
LoginJoin ↗
RoadmapsSkills
AO
+1.2k Learners
Login
  • English
  • Français
  • Español
  • العربية
  • Português
  • Deutsch
  • 日本語
  • 中文
Stochastic Calculus skill›Module 4 · Models beyond Brownian motion›Topic 4.1·~55 minAdvanced

Mean-reverting processes OU and CIR

Skill positionModule 4 of 5 · Topic 1 of 3
4.1 Mean-reverting processes OU and CIR
—Lab score— / 100Total XP—Streak—

Prices that get pulled back

A Brownian motion wanders away for ever. Many things in finance do not: interest rates, volatility, the gap between two related stocks. They are pulled back toward a long-run level. The Ornstein-Uhlenbeck (OU) process does exactly that. In dX=κ(θ−X) dt+σ dWdX=\kappa(\theta-X)\,dt+\sigma\,dWdX=κ(θ−X)dt+σdW the number θ\thetaθ is the level it returns to, κ\kappaκ is the speed of the pull and σ\sigmaσ is the size of the random shocks. The further XXX is above θ\thetaθ, the harder it is pulled down.

dX=κ(θ−X) dt+σ dW,E[Xt]=θ+(X0−θ)e−κt,t1/2=ln⁡2κ,sd(X∞)=σ2κdX=\kappa(\theta-X)\,dt+\sigma\,dW,\quad E[X_t]=\theta+(X_0-\theta)e^{-\kappa t},\quad t_{1/2}=\frac{\ln2}{\kappa},\quad \mathrm{sd}(X_\infty)=\frac{\sigma}{\sqrt{2\kappa}}dX=κ(θ−X)dt+σdW,E[Xt​]=θ+(X0​−θ)e−κt,t1/2​=κln2​,sd(X∞​)=2κ​σ​(1)

Three numbers describe an OU process. The average distance to θ\thetaθ halves every ln⁡2/κ\ln2/\kappaln2/κ time units, the half-life. In the long run XXX settles into a stable range with standard deviation σ/2κ\sigma/\sqrt{2\kappa}σ/2κ​. And XXX can go negative, which is fine for a spread but wrong for an interest rate or a variance. The CIR model fixes this by making the shocks smaller near zero: dr=κ(θ−r) dt+σr dWdr=\kappa(\theta-r)\,dt+\sigma\sqrt r\,dWdr=κ(θ−r)dt+σr​dW. The rate stays above zero when 2κθ≥σ22\kappa\theta\ge\sigma^{2}2κθ≥σ2, called the Feller condition.

A spread that returnsA spread with κ=0.35\kappa=0.35κ=0.35 per day has a half-life of ln⁡2/0.35≈1.98\ln2/0.35\approx1.98ln2/0.35≈1.98 days, so a pairs trade should last a few days and not weeks. For a rate that starts at 0.080.080.08 with θ=0.04\theta=0.04θ=0.04 and κ=0.5\kappa=0.5κ=0.5 per year, the average after two years is 0.04+0.04 e−1≈0.05470.04+0.04\,e^{-1}\approx0.05470.04+0.04e−1≈0.0547: it has covered about 63%63\%63% of the way back.
  • OU process: mean reversion with shocks of constant size. It can go negative.
  • Half-life ln⁡2/κ\ln2/\kappaln2/κ and long-run spread σ/2κ\sigma/\sqrt{2\kappa}σ/2κ​.
  • CIR process: shocks shrink near zero, so the rate stays positive when 2κθ≥σ22\kappa\theta\ge\sigma^{2}2κθ≥σ2.

Lab · what's graded

  • The half-life15 pts
  • The expected level15 pts
  • The long-run spread15 pts
  • Which rates stay positive15 pts
  • Match the vocabulary15 pts
  • Fitting an OU model to data10 pts
  • Why a spread suits an OU model15 pts
0/ 7 answered
Tasks
1Numeric answer15 ptsNot answered

A spread follows an OU process with κ=0.35\kappa=0.35κ=0.35 per day. What is its half-life ln⁡2/κ\ln2/\kappaln2/κ in days? Give two decimals.

h=h =h=accepted: ± 0.01
2Numeric answer15 ptsNot answered

A rate starts at X0=0.08X_0=0.08X0​=0.08 and follows an OU process with θ=0.04\theta=0.04θ=0.04 and κ=0.5\kappa=0.5κ=0.5 per year. What is E[X2]=θ+(X0−θ)e−κtE[X_2]=\theta+(X_0-\theta)e^{-\kappa t}E[X2​]=θ+(X0​−θ)e−κt after t=2t=2t=2 years? Give four decimals.

m=m =m=accepted: ± 0.0003
3Numeric answer15 ptsNot answered

An OU process has σ=0.06\sigma=0.06σ=0.06 and κ=0.18\kappa=0.18κ=0.18. What is its long-run standard deviation σ/2κ\sigma/\sqrt{2\kappa}σ/2κ​?

s=s =s=accepted: ± 0.002
4Choice15 ptsNot answered

For a CIR rate, which parameter sets satisfy the Feller condition 2κθ≥σ22\kappa\theta\ge\sigma^{2}2κθ≥σ2 and so stay positive? Pick all that apply.

5Match15 ptsNot answered

Match each item with its meaning.

Pick the partner of each item on the left.

OU process
CIR process
κ\kappaκ
θ\thetaθ
6Order the steps10 ptsNot answered

Put the steps in order.

Drag to reorder, or focus an item, press Space to lift it, the arrow keys to move it and Space to drop it.

  1. 1Compute the half-life
  2. 2Regress each change on the previous level
  3. 3Take the series and its changes
  4. 4Read the speed and the level from the fit
7Explain in words15 ptsNot answered

In one or two sentences, explain why the gap between two related stocks is modelled with an OU process and how a trader can use that.

Math modeKeyboard or LaTeX inputTask 1 of 7 · Ctrl ⏎ to check

Log in to run your code.

Every lecture is free to read. Create an account or log in to run code, run tests and submit this lab.

  • In-browser IDE with a bash terminal — nothing to install
  • Instant grading, XP and your place on the skill
Create an accountLog in
OR
Continue with GitHub