Skip to content

Solving the Ornstein–Uhlenbeck SDE With an Integrating Factor

Original question

Can you derive the solution to the Ornstein-Uhlenbeck stochastic differential equation using the integrating factor method?

For dXt=κ(θ−Xt) dt+σ dWtdX_t=\kappa(\theta-X_t)\,dt+\sigma\,dW_t with κ>0\kappa>0, centre the process at θ\theta and multiply by eκte^{\kappa t}. The resulting equation has zero drift. Integrating and undoing the transformation gives

Xt=θ+(X0−θ)e−κt+σ∫0te−κ(t−u) dWu.X_t=\theta+(X_0-\theta)e^{-\kappa t} +\sigma\int_0^t e^{-\kappa(t-u)}\,dW_u.
The conditional mean decays toward θ\theta, and the conditional variance approaches σ2/(2κ)\sigma^2/(2\kappa) as the forecast horizon grows.

Choose the integrating factor and cancel the drift

Put Yt=eκt(Xt−θ)Y_t=e^{\kappa t}(X_t-\theta). The integrating factor has finite variation, so its quadratic covariation with XX is zero. The product rule gives
dYt=κeκt(Xt−θ) dt+eκt(−κ(Xt−θ) dt+σ dWt)=σeκt dWt.dY_t=\kappa e^{\kappa t}(X_t-\theta)\,dt +e^{\kappa t}\big(-\kappa(X_t-\theta)\,dt+\sigma\,dW_t\big) =\sigma e^{\kappa t}\,dW_t.
Integrate this equality from ss to tt and multiply by e−κte^{-\kappa t}. Conditional on information at ss, the stochastic integral over (s,t](s,t] is a centred Gaussian because the integrand is deterministic and the future Brownian increments are independent of the past. With h=t−sh=t-s, the conditional mean is θ+(Xs−θ)e−κh\theta+(X_s-\theta)e^{-\kappa h} and the Itô isometry gives the variance:
σ2∫ste−2κ(t−u) du=σ22κ(1−e−2κh).\sigma^2\int_s^t e^{-2\kappa(t-u)}\,du =\frac{\sigma^2}{2\kappa}(1-e^{-2\kappa h}).
This also gives an exact simulation update. Draw a standard normal, multiply it by the conditional standard deviation and add the conditional mean.

Centre the process at θ\theta before choosing the factor. The drift of the centred process is −κ(Xt−θ)-\kappa(X_t-\theta), so differentiating eκte^{\kappa t} contributes precisely the term needed to cancel it. After integrating, divide both the initial term and the stochastic integral by eκte^{\kappa t}. Inside the integral, the surviving factor e−κ(t−s)e^{-\kappa(t-s)} makes an older shock count less than a recent shock. Since the integrand is deterministic, the integral is Gaussian and its variance comes from integrating the squared kernel.

For a forecast from time ss, restart the solution at the observed XsX_s and integrate only over Brownian increments after ss. The conditional mean is θ+(Xs−θ)e−κ(t−s)\theta+(X_s-\theta)e^{-\kappa(t-s)}. The noise integral has mean zero given the past. For its variance, integrate e−2κ(t−u)e^{-2\kappa(t-u)} from u=su=s to u=tu=t, then multiply by σ2\sigma^2. The factor of two is there because the exponential kernel is squared. As the forecast horizon grows, this variance tends to σ2/(2κ)\sigma^2/(2\kappa) for κ>0\kappa>0.

Use the kernel to calculate a conditional forecast

For an original exercise, use κ=1.2\kappa=1.2, θ=0.03\theta=0.03, σ=0.01\sigma=0.01 and X0=0.05X_0=0.05. Over half a year, the conditional mean is 0.03+0.02e−0.6≈0.040980.03+0.02e^{-0.6}\approx0.04098. The variance is 0.012(1−e−1.2)/2.4≈0.00002910.01^2(1-e^{-1.2})/2.4\approx0.0000291, giving a standard deviation of about 0.005400.00540. If these are rates quoted as decimals, the mean is about 4.10%4.10\% and the standard deviation is 0.540.54 percentage points. The long-run standard deviation is 0.01/2.4≈0.006450.01/\sqrt{2.4}\approx0.00645, larger than the half-year value because more shocks can accumulate.

If you start the model at a normal random value with mean θ\theta and variance σ2/(2κ)\sigma^2/(2\kappa), independent of the future Brownian increments, the initial variance decays by e−2κte^{-2\kappa t}. The new shocks contribute the complementary amount. The marginal distribution then stays the same at every time, which explains why the long-run variance is also the stationary variance.

References and next steps