Stochastic Calculus

Lesson 10 of 11

Ornstein-Uhlenbeck, Vasicek and CIR

How to solve a mean-reverting SDE with an integrating factor, and the two interest-rate models built on it: Vasicek, which can go negative, and CIR, which can't.

What solving an SDE means

An SDE such as dXt=μ(Xt) dt+σ(Xt) dWtdX_t = \mu(X_t)\,dt + \sigma(X_t)\,dW_t is a rule for the next small step. Solving it means writing XtX_t explicitly in terms of tt, the starting value and the Brownian path, possibly through an integral against dWdW. You check the answer the same way you check an ODE solution: differentiate it with Itô and see that the SDE comes back.

You have already seen one. For GBM, dS=μS dt+σS dWdS = \mu S\,dt + \sigma S\,dW, Itô on ln⁡S\ln S gave constant drift and constant volatility, so

St=S0exp⁡((μ−12σ2)t+σWt).S_t = S_0 \exp\Big(\big(\mu - \tfrac12\sigma^2\big)t + \sigma W_t\Big).

With μ=0\mu = 0 this is the stochastic exponential eσWt−12σ2te^{\sigma W_t - \frac12\sigma^2 t}, the solution of dX=σX dWdX = \sigma X\,dW and a martingale.

For GBM, the log removed SS from the right-hand side. The next model needs a trick from ordinary differential equations instead. Take the ODE x′=λ(θ−x)x' = \lambda(\theta - x). Move the xx term to the left, x′+λx=λθx' + \lambda x = \lambda\theta, and multiply by the integrating factor eλte^{\lambda t}. The left side becomes exactly (eλtx)′(e^{\lambda t}x)', so you can integrate:

x(t)=θ+(x0−θ)e−λt.x(t) = \theta + (x_0 - \theta)e^{-\lambda t}.

With x0=1%x_0 = 1\%, θ=4%\theta = 4\% and λ=0.5\lambda = 0.5, the gap to 4%4\% starts at 3%3\% and after one year is 3%×e−0.5≈1.82%3\% \times e^{-0.5} \approx 1.82\%, so x(1)≈2.18%x(1) \approx 2.18\%. Each year the gap is multiplied by e−0.5≈0.61e^{-0.5} \approx 0.61.