Interactive model — experiment with these parameters in sItô

The continuous-time Cox–Ingersoll–Ross (CIR) [2] process stays nonnegative:

$$dx_t = \kappa(\theta - x_t)\,dt + \sigma\sqrt{x_t}\,dW_t$$

Its Euler–Maruyama discretization can still step below zero whenever a negative Gaussian increment overwhelms the remaining state. With $\kappa = 2$, $\theta = 0.04$, $\sigma = 0.5$, $x_0 = 0.04$, horizon $T = 1$, and $100$ time steps, evaluating $\sqrt{x_n}$ directly turns $58\%$ of simulated paths into NaN—about $5{,}700$ paths out of $10^4$.

Two standard fixes keep every path finite:

  • Absolute value: replace $\sqrt{x_n}$ with $\sqrt{|x_n|}$ in the diffusion coefficient.
  • Full truncation: replace $x_n$ with $\max(x_n, 0)$ in both the drift $\kappa\bigl(\theta - \max(x_n, 0)\bigr)$ and the diffusion $\sigma\sqrt{\max(x_n, 0)}$.

Both schemes allow negative intermediate values (and leave roughly $4\%$ to $5\%$ of paths below zero at $T = 1$ on a $100$-step grid) [1], while keeping the terminal moments close to the exact law.

Comparison against the exact distribution

At $T = 1$, $x_1$ follows a non-central chi-square distribution. Because the Feller condition fails here ($2\kappa\theta = 0.16 < \sigma^2 = 0.25$), the true process touches zero, making boundary excursions common even in continuous time.

SchemeMeanVariance$P(x_1 < 5 \times 10^{-3})$Paths below zero
Exact law$0.0400$$2.454 \times 10^{-3}$$0.2129$$0$
Absolute value, $100$ steps$0.0400$$2.51 \times 10^{-3}$$0.215$$5.2\%$
Full truncation, $100$ steps$0.0400$$2.49 \times 10^{-3}$$0.220$$4.3\%$
Absolute value, $10^3$ steps$0.0399$$2.43 \times 10^{-3}$$0.212$$1.3\%$

At $10^4$ paths, Monte Carlo standard errors are about $5 \times 10^{-4}$ for the mean, $3\%$ for the variance, $0.2$ percentage points for the negative fraction, and $0.4$ percentage points for $P(x_1 < 5 \times 10^{-3})$. A $4 \times 10^5$-path reference simulation confirms that both $100$-step schemes overstate variance by $1\%$ to $2\%$, while refining the grid to $10^3$ steps cuts the negative fraction to $1.3\%$ and removes the variance excess.

CIR absolute-value Euler fan chart with Feller violated showing paths undershooting zero down below -0.1 CIR absolute-value Euler fan chart with Feller violated showing paths undershooting zero down below -0.1
CIR Euler paths with $|x_n|$ repair ($100$ steps, $2\kappa\theta < \sigma^2$): keeping paths finite lets excursions drop below zero rather than halting in NaN, while preserving mean $0.040$. Open absolute-value fan in sItô ↗
Terminal CIR density showing dashed 5% quantile right at zero (-0.00015) with 5.4% negative overshoot mass Terminal CIR density showing dashed 5% quantile right at zero (-0.00015) with 5.4% negative overshoot mass
Terminal density $x_1$ under the $100$-step $|x|$ scheme: the dashed $5\%$ quantile sits just below zero ($-0.00015$), matching the $5.4\%$ negative-path overshoot on the coarse grid. Inspect terminal overshoot in sItô ↗

Run this in sItô

Open sItô with this model pre-loaded to inspect the path distribution, summary statistics, and parameter sensitivities—or change any setting and rerun:

For the boundary condition behind zero crossings, see the Feller condition. Expression syntax is detailed in the sItô Reference, and the compiler architecture in Compiling parametric SDEs into fast Monte Carlo simulations.

Related notes: The Lamperti transform · Correlation in the Heston model