Tutorials › Stochastic Calculus › Estimating Ornstein-Uhlenbeck Parameters from Discrete Data

Computational Projects in Stochastic Calculus · Tutorial 599 of 600

Estimating Ornstein-Uhlenbeck Parameters from Discrete Data

Learn how exact-transition regression estimates the Ornstein–Uhlenbeck drift and diffusion parameters, and how to check whether the resulting estimates are admissible.

Intermediate 12 min read

What You'll Learn

  • Derive the conditional Gaussian transition over a fixed sampling interval.
  • Compute the least-squares intercept, slope, and residual sum of squares.
  • Recover the Ornstein–Uhlenbeck mean-reversion rate, level, and volatility.
  • Identify when fitted regression coefficients do not correspond to valid parameters.
  • Distinguish a positive-residual variance MLE from the zero-residual boundary case.

From Continuous-Time Dynamics to a Regression

Suppose observations of a mean-reverting process are available at equally spaced times. The exact transition law turns each consecutive pair into a linear regression observation with a Gaussian error. The regression is useful because it fits the discrete-time law directly; the fitted coefficients can then be translated back to the continuous-time parameters. That translation has constraints, so a numerical regression output is not automatically a valid Ornstein–Uhlenbeck fit.

Work on a filtered probability space \((\Omega,\mathcal{F},(\mathcal{F}_t)_{t\ge0},\mathbb{P})\) carrying a standard Brownian motion \(B_t\). Consider the Ornstein–Uhlenbeck SDE \(dX_t=\kappa(\theta-X_t)\,dt+\sigma\,dB_t\), where \(\kappa>0\) is the mean-reversion rate, \(\theta\in\mathbb{R}\) is the long-run level, and \(\sigma>0\) is the diffusion coefficient. Observe \(X_{t_k}\) at \(t_k=kh\), where \(h>0\), for \(k=0,\ldots,n\). Set \(U_k=X_{t_k}\) and \(Y_k=X_{t_{k+1}}\).

For each finite \(T\), the stochastic integral below has integrand \(s\mapsto e^{-\kappa(t-s)}\), which is deterministic, progressively measurable, and satisfies \(\mathbb{E}\int_0^t e^{-2\kappa(t-s)}\,ds<\infty\). Thus it belongs to the Ito-integrand class \(\mathcal{L}^2\).

Theorem: For \(h>0\), the exact one-step transition is \(X_{(k+1)h}=a+bX_{kh}+\varepsilon_k\), where \(b=e^{-\kappa h}\), \(a=\theta(1-b)\), and, conditional on \(\mathcal{F}_{kh}\), \(\varepsilon_k\) is normal with mean \(0\) and variance \(q=\dfrac{\sigma^2}{2\kappa}(1-b^2)\). The innovations over successive intervals are independent, and each is independent of the information at the start of its interval.

Proof. Apply Ito's formula to \(f(t,x)=e^{\kappa t}x\). Its partial derivatives are \(f_t=\kappa e^{\kappa t}x\), \(f_x=e^{\kappa t}\), and \(f_{xx}=0\), so the second-order correction is \(\tfrac12 f_{xx}\sigma^2\,dt=0\). The drift terms cancel, giving \(d(e^{\kappa t}X_t)=\kappa\theta e^{\kappa t}\,dt+\sigma e^{\kappa t}\,dB_t\). Integrating from \(s\) to \(t\) and multiplying by \(e^{-\kappa t}\) yields \(X_t=\theta+(X_s-\theta)e^{-\kappa(t-s)}+\sigma\int_s^t e^{-\kappa(t-u)}\,dB_u\). The integral is centered normal, independent of \(\mathcal{F}_s\), with variance \(\sigma^2\int_s^t e^{-2\kappa(t-u)}\,du=\frac{\sigma^2}{2\kappa}(1-e^{-2\kappa(t-s)})\). Brownian increments on disjoint intervals are independent, so the corresponding integrals are independent. Taking \(s=kh\) and \(t=(k+1)h\) gives the stated coefficients and variance. \(\square\)

Least-Squares Fit and Its Justification

Given the \(n\) pairs \((U_k,Y_k)\), fit an intercept and slope by minimizing the residual sum of squares \(S(a,b)=\sum_{k=0}^{n-1}(Y_k-a-bU_k)^2\). Define \(\bar U=n^{-1}\sum_k U_k\), \(\bar Y=n^{-1}\sum_k Y_k\), and \(S_{UU}=\sum_k(U_k-\bar U)^2\). If \(S_{UU}>0\), the predictors are not all equal, and the unconstrained least-squares coefficients are uniquely determined.

Proposition: If \(n\ge1\) and \(S_{UU}>0\), the unique minimizer over \(a,b\in\mathbb{R}\) is \(\hat b=\dfrac{\sum_k(U_k-\bar U)(Y_k-\bar Y)}{S_{UU}}\) and \(\hat a=\bar Y-\hat b\bar U\). Its minimum residual sum of squares is \(S_{\min}=\sum_k(Y_k-\hat a-\hat bU_k)^2\).

Proof. For any fixed \(b\), expand the sum around the response mean: \(\sum_k(Y_k-a-bU_k)^2=\sum_k[(Y_k-\bar Y)-b(U_k-\bar U)]^2+n(\bar Y-a-b\bar U)^2\). The cross term vanishes because both centered sums are zero. The second term is minimized uniquely at \(a=\bar Y-b\bar U\). Substitution leaves a quadratic in \(b\), namely \(\sum_k(Y_k-\bar Y)^2-2b\sum_k(U_k-\bar U)(Y_k-\bar Y)+b^2S_{UU}\). Since \(S_{UU}>0\), completing the square gives its unique minimizer as the stated \(\hat b\). Substitution into \(a=\bar Y-b\bar U\) gives \(\hat a\). The minimized value is exactly the sum of squared residuals \(S_{\min}\), by its definition. \(\square\)

For the Gaussian transition model, conditional on the observed starting value \(X_0\), the likelihood is proportional to \(q^{-n/2}\exp[-S(a,b)/(2q)]\), with \(q>0\). Thus, for fixed \(q\), maximizing the likelihood over unrestricted \(a,b\) is equivalent to least squares. For the fitted coefficients, if \(S_{\min}>0\), the maximum-likelihood estimate of the innovation variance is \(\hat q=S_{\min}/n\): differentiating the log likelihood \(-\frac n2\log q-\frac{S_{\min}}{2q}\) gives derivative \(-n/(2q)+S_{\min}/(2q^2)\), which vanishes at \(S_{\min}/n\), increases before that point, and decreases after it. If \(S_{\min}=0\), the likelihood is proportional to \(q^{-n/2}\), which diverges as \(q\downarrow0\). Since \(q=0\) is excluded, there is no finite maximum-likelihood estimate in that case.

To recover continuous-time parameters from an admissible fit, require \(0<\hat b<1\). Then the inverse formulas are \(\hat\kappa=-\frac{\log\hat b}{h}\), \(\hat\theta=\frac{\hat a}{1-\hat b}\), and \(\hat\sigma=\sqrt{\frac{2\hat\kappa\hat q}{1-\hat b^2}}\), provided \(\hat q>0\). These follow by solving \(b=e^{-\kappa h}\), \(a=\theta(1-b)\), and \(q=\sigma^2(1-b^2)/(2\kappa)\). The conditions ensure \(\hat\kappa>0\), a nonzero denominator for \(\hat\theta\), and a positive real volatility.

Worked Fits and Parameter Recovery

Worked Example: A Fit with Admissible Coefficients

Take \(h=1\) and observations \(U=(0,1,2,3)\), \(Y=(\tfrac52,1,\tfrac32,4)\). Find the regression and recover the OU parameters from the conditional Gaussian maximum-likelihood variance.

There are \(n=4\) pairs. The means are \(\bar U=(0+1+2+3)/4=\tfrac32\) and \(\bar Y=(\tfrac52+1+\tfrac32+4)/4=\tfrac94\). The centered predictor values are \(-\tfrac32,-\tfrac12,\tfrac12,\tfrac32\), so \(S_{UU}=\tfrac94+\tfrac14+\tfrac14+\tfrac94=5\). The centered responses are \(\tfrac14,-\tfrac54,-\tfrac34,\tfrac74\). Their products with the centered predictors sum to \(-\tfrac38+\tfrac58-\tfrac38+\tfrac{21}{8}=\tfrac52\). Therefore \(\hat b=(\tfrac52)/5=\tfrac12\), and \(\hat a=\tfrac94-\tfrac12\cdot\tfrac32=\tfrac32\).

The fitted values are \(\tfrac32,2,\tfrac52,3\), giving residuals \(1,-1,-1,1\) and \(S_{\min}=1+1+1+1=4\). Since this is positive, \(\hat q=4/4=1\). The coefficient \(\hat b=\tfrac12\) is admissible, so \(\hat\kappa=-\log(\tfrac12)=\log 2\), \(\hat\theta=(\tfrac32)/(\tfrac12)=3\), and \(\hat\sigma^2=2\log 2/(1-\tfrac14)=\tfrac83\log 2\). Hence \(\hat\sigma=\sqrt{\tfrac83\log 2}\).

Check: Substitution gives \(e^{-\hat\kappa h}=e^{-\log2}=\tfrac12\), \(\hat\theta(1-\hat b)=3\cdot\tfrac12=\tfrac32\), and \(\frac{\hat\sigma^2}{2\hat\kappa}(1-\hat b^2)=\frac{(\tfrac83\log2)}{2\log2}\cdot\tfrac34=1=\hat q\). Each fitted transition parameter is recovered.

Worked Example: Comparing a Fit with Known Simulation Parameters

Suppose a simulated data set has \(h=1\), predictors \(U=(0,1,2,3)\), and responses \(Y=(\tfrac{11}{10},\tfrac9{10},\tfrac{17}{10},\tfrac72)\). The simulation used \(\kappa=\log(\tfrac54)\), \(\theta=3\), and \(\sigma=1\). Fit the regression and compare its parameter estimates with those values.

The means are \(\bar U=\tfrac32\) and \(\bar Y=(\tfrac{11}{10}+\tfrac9{10}+\tfrac{17}{10}+\tfrac{35}{10})/4=\tfrac{18}{10}=\tfrac95\). The centered response values are \(-\tfrac7{10},-\tfrac9{10},-\tfrac1{10},\tfrac{17}{10}\). Multiplying by the centered predictors gives \(\tfrac{21}{20},\tfrac9{20},-\tfrac1{20},\tfrac{51}{20}\), which sum to \(4\). Since \(S_{UU}=5\), \(\hat b=4/5\), and \(\hat a=\tfrac95-\tfrac45\cdot\tfrac32=\tfrac35\).

The fitted values are \(\tfrac35,\tfrac75,\tfrac{11}{5},3\). The residuals are \(\tfrac12,-\tfrac12,-\tfrac12,\tfrac12\), so \(S_{\min}=4\cdot\tfrac14=1\) and \(\hat q=1/4\). Recovery gives \(\hat\kappa=-\log(\tfrac45)=\log(\tfrac54)\), exactly the simulation value, and \(\hat\theta=(\tfrac35)/(\tfrac15)=3\), also exact. The volatility estimate satisfies \(\hat\sigma^2=\frac{2\log(5/4)(1/4)}{1-16/25}=\frac{25}{18}\log(\tfrac54)\), so \(\hat\sigma=\sqrt{\frac{25}{18}\log(\tfrac54)}\).

Check: For the stated simulation parameters, \(b=e^{-\log(5/4)}=4/5\), \(a=3(1/5)=3/5\), and \(q=\frac{1}{2\log(5/4)}(1-16/25)=\frac{9}{50\log(5/4)}\). The fitted variance \(1/4\) need not equal this theoretical one-step variance in a finite sample. The recovered volatility is correspondingly not forced to equal \(1\); this comparison separates exact coefficient recovery in this sample from sampling variation in the estimated innovation variance.

Admissibility and a Likelihood Pitfall

Worked Example: A Regression Slope That Cannot Be Recovered

Let \(h=1\), \(U=(0,1,2)\), and \(Y=(1,3,5)\). The means are \(\bar U=1\) and \(\bar Y=3\). The centered predictor values are \(-1,0,1\), so \(S_{UU}=2\). The centered responses are \(-2,0,2\), and the cross-product sum is \(2+0+2=4\). Thus \(\hat b=4/2=2\) and \(\hat a=3-2\cdot1=1\). All three residuals are zero.

The unconstrained regression slope \(2\) is not a valid OU transition coefficient: \(e^{-\kappa h}\) lies strictly between \(0\) and \(1\) whenever \(\kappa,h>0\). In particular, \(-\log(2)\) is negative, not an admissible mean-reversion rate. This regression output cannot be converted into OU parameters by the inverse formulas. A fit constrained to the OU parameter space would instead require constrained optimization; it is not the unconstrained least-squares answer.

Check: A positive \(\kappa\) and \(h=1\) imply \(e^{-\kappa}<1\), whereas the fitted value is \(2>1\). The incompatibility is in the slope itself, before attempting to estimate the level or volatility.

A related variance pitfall occurs even when the predictors vary. For example, take \(n=2\), \(U=(0,1)\), and \(Y=(1,3)\). The line \(Y=1+2U\) has residual sum of squares \(S_{\min}=0\). The conditional likelihood at that line is proportional to \(q^{-2/2}=q^{-1}\), so it tends to infinity as \(q\downarrow0\). Reporting \(\hat q=S_{\min}/n=0\) as an MLE is incorrect: zero is only a boundary limit, and no maximum exists over \(q>0\). Also, the slope \(2\) fails the OU admissibility condition. The example demonstrates two separate checks, not one issue.

Do not silently clip an inadmissible slope to \(0\) or \(1\). Neither endpoint corresponds to a finite positive \(\kappa\): \(b=1\) would give \(\kappa=0\), while \(b=0\) is only approached as \(\kappa\) grows without bound. If the scientific model requires \(\kappa>0\), estimate within that parameter space and report the constraint used. Finally, the fitted intercept and slope summarize the conditional transition law; a finite data set does not guarantee that either coefficient, or the resulting volatility, equals its simulation value.

Check Your Understanding

Use the formulas and conditions above to work through these checks.

  1. For \(h>0\), explain why an admissible fitted slope must satisfy \(0<\hat b<1\), and recover \(\hat\kappa\) when \(\hat b=\tfrac34\).
  2. If \(S_{UU}>0\), show how centering the predictors and responses leads to the formulas for \(\hat a\) and \(\hat b\).
  3. For \(n=5\) and \(S_{\min}=10\), compute the conditional Gaussian maximum-likelihood estimate of \(q\).
  4. Explain why \(S_{\min}=0\) does not yield a finite MLE when the variance parameter is restricted to \(q>0\).
  5. Given admissible \(\hat a,\hat b,\hat q\), write the three formulas recovering \(\hat\kappa,\hat\theta,\hat\sigma\), and state the condition needed for each denominator or square root.