Estimating the CIR and CKLS interest rate models, from the Euler approximation to the exact likelihood, and how much the shortcut biases the speed of mean reversion.
The third MASM18 lab moves from discrete-time models to stochastic differential equations. Interest rates are modelled in continuous time, but observed only at discrete times, and the likelihood of an SDE between two observations is rarely available in closed form. The lab estimates two short-rate models with methods that approximate that likelihood more and more closely, and measures what each approximation costs.
The Cox-Ingersoll-Ross model pulls the rate back towards a level $\theta$ at speed $\kappa$, with noise that shrinks as the rate approaches zero:
$$dr_t = \kappa(\theta - r_t)\,dt + \sigma\sqrt{r_t}\,dW_t.$$
The CKLS model frees the exponent on the noise, $\sigma r_t^{\gamma}\,dW_t$, so the data can decide how strongly volatility depends on the level. CIR is the special case $\gamma = 1/2$.
Each model comes with 500 simulated observations. The sampling interval is not given, so it is set to one, and $\kappa$ and $\sigma$ are measured per observation step.
The simplest approximation replaces $dt$ by the step $\Delta$ and $dW_t$ by a normal increment. Each step is then normal, with mean $r_{k-1} + \kappa(\theta - r_{k-1})\Delta$ and variance $\sigma^2 r_{k-1}^{2\gamma}\Delta$, and the likelihood is a product of normal densities. The same two conditional moments give a GMM estimator: the residual and the error in its variance both have conditional mean zero, so each can be multiplied by $1$ and by $r_{k-1}$ to give four moment conditions.
For CIR the two give $\hat\kappa = 0.396$ and $0.390$. The exact transition density of CIR is known, a scaled noncentral $\chi^2$, and maximising the exact likelihood gives $\hat\kappa = 0.544$. Both Euler-based methods sit well outside its 95 percent interval, $(0.420,\ 0.669)$.
The gap has a simple cause. Over one step, the exact mean moves a fraction $1 - e^{-\kappa\Delta}$ of the way to $\theta$, while the Euler step moves a fraction $\kappa\Delta$. So the Euler methods estimate $(1 - e^{-\kappa\Delta})/\Delta$ instead of $\kappa$. At the exact estimate that is 0.420, close to the Euler 0.396. With $\kappa\Delta$ near 0.5 the bias is large, and it shrinks only when the data is sampled more densely.
The long-run level is unaffected: every method puts $\hat\theta$ at 0.060, the sample mean.
The extra tasks try three ways to improve on Euler without the exact density.
Shoji and Ozaki. The transformation $y = 2\sqrt{r}$ turns the CIR noise into a constant $\sigma$. The drift of $y$ is then linearised over each step, which gives a Gaussian transition with its own mean and variance. This lifts $\hat\kappa$ to 0.499, and the maximised log-likelihood of the data to 1136.0, against 1093.4 for Euler and 1138.5 for the exact density.
Simulated maximum likelihood. Each interval is split into $M$ substeps, $K = 1000$ Euler paths are simulated over all but the last, and the Gaussian density of the last substep is averaged over the paths. With $M = 1$ this is Euler; as $M$ grows it approaches the exact density. On the transformed data, $\hat\kappa$ rises from 0.399 at $M = 1$ to 0.461, 0.490 and 0.515 at $M = 2, 3, 5$.
The random numbers are drawn once and reused at every evaluation, so the simulated likelihood is a smooth function of the parameters. Even so, on the raw rates the result depends on the draw: across four seeds $\hat\kappa$ ranges from 0.441 to 0.486, and its standard error from 0.016 to 0.086. The cause is paths that end near zero, where $\sigma\sqrt{r}$ is tiny and a single path's density can dominate the average. On the transformed data, where every path has the same spread, $\hat\kappa$ stays between 0.484 and 0.492.
Exact moments. Dynkin's formula, $\tfrac{d}{dt}E[f(X_t)] = E[\mathcal{A}f(X_t)]$, turns the first three conditional moments of CIR into linear differential equations with closed-form solutions. The first is
$$E[r_t \mid r_0] = \theta + (r_0 - \theta)e^{-\kappa t},$$
and the second and third follow the same way. Six moment conditions built on them carry no discretisation error at all. GMM on these conditions gives $\hat\kappa = 0.540$ and $\hat\sigma = 0.146$, against 0.544 and 0.144 from the exact likelihood, with no simulation and no Bessel function. Its $J$ statistic, 1.58 on three degrees of freedom ($p = 0.66$), gives no reason to doubt the CIR model.
| Method | $\hat\kappa$ | $\hat\sigma$ |
|---|---|---|
| Euler quasi ML | 0.396 (0.040) | 0.121 (0.004) |
| GMM, Euler moments | 0.390 (0.040) | 0.116 (0.005) |
| Simulated ML, $M = 3$, transformed | 0.490 (0.053) | 0.132 (0.005) |
| Shoji and Ozaki | 0.499 (0.056) | 0.141 (0.005) |
| GMM, exact moments | 0.540 (0.062) | 0.146 (0.006) |
| Exact ML | 0.544 (0.064) | 0.144 (0.006) |
Standard errors are in brackets. The rows run from the crudest approximation to the exact likelihood, and the estimates rise in the same order.
For the CKLS data every method finds $\hat\gamma$ above $1/2$: 0.68 by Euler quasi ML, 0.79 by GMM and 0.91 by simulated ML. The Euler interval, $(0.47,\ 0.90)$, still contains $1/2$. The GMM interval just excludes it, and the simulated ML interval, $(0.72,\ 1.10)$, clearly does.
The estimates are less decisive than they look. Near the mean rate of 0.06, a larger $\gamma$ combined with a larger $\sigma$ gives almost the same noise level, $\sigma r^{\gamma}$. So the likelihood is a long narrow ridge in the $(\sigma, \gamma)$ plane, and the three estimates lie along it. The data fixes the noise level at typical rates well, and how it scales with the rate much less well.
Euler quasi-likelihood, two-step GMM with an optimal weight matrix, the exact CIR likelihood through the noncentral $\chi^2$ density, the Shoji-Ozaki local linearisation, simulated maximum likelihood with common random numbers, and GMM on exact moments derived with Dynkin's formula, all written in Python with SciPy. The moment formulas were checked against a numerical solution of their differential equations, and the Bessel-function likelihood against SciPy's noncentral $\chi^2$. Two typos in the lab manual's description of that distribution turned up along the way. The course supplies its lab code in MATLAB.
Back to all engineering work, or the lecture notes.