Interactive model — experiment with these parameters in sItô

The Cox–Ingersoll–Ross (CIR) [2] square-root process

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

remains strictly positive almost surely if and only if Feller’s condition $2\kappa\theta \ge \sigma^2$ holds [1]. In terms of the stationary distribution, that boundary condition states simply that the Gamma shape parameter $\alpha = \frac{2\kappa\theta}{\sigma^2}$ is at least $1$.

Stationary Gamma law near zero

For $\kappa, \theta, \sigma > 0$, the invariant distribution of $X_t$ is Gamma with shape $\alpha = \frac{2\kappa\theta}{\sigma^2}$ and rate $\beta = \frac{2\kappa}{\sigma^2}$, giving mean $\theta$ and variance $\frac{\theta\sigma^2}{2\kappa}$. Near $x = 0$, the stationary density scales like $x^{\alpha - 1}$: when $\alpha \ge 1$ the density stays finite at zero and the origin is unattainable, whereas when $\alpha < 1$ the density diverges at zero and the process hits the boundary and reflects. Thus Feller’s condition $2\kappa\theta \ge \sigma^2$ and $\alpha \ge 1$ are equivalent, governing both CIR short rates and the variance process in the Heston model.

CIR square-root diffusion with Feller condition violated (2κθ < σ²) piling density onto the boundary x = 0 CIR square-root diffusion with Feller condition violated (2κθ < σ²) piling density onto the boundary x = 0
CIR variance paths when the Feller condition fails (θ = 0.2, 2κθ = 0.8 < σ² = 1): the lower 5% quantile and density mass press against zero rather than staying strictly positive. Open this run 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 (both runs take $\kappa = 2$, $\sigma = 1$, $T = 5$, $2 \times 10^3$ paths, $500$ steps, and $\sqrt{|x|}$ in the diffusion):

Regime ($\kappa = 2, \sigma = 1$)Shape $\alpha$Stationary varianceLow-level tailExact tail prob.Simulated prob.
$\theta = 1$ (met)40.25$\mathbb{P}(X < 0.2)$$9.1 \times 10^{-3}$$\approx 0.01$
$\theta = 0.2$ (violated)0.80.05$\mathbb{P}(X < 0.05)$0.2716$\approx 0.26$ (SE $0.01$)

When $\alpha = 0.8$, more than a quarter of the stationary mass piles up below $0.05$, whereas the $\alpha = 4$ regime leaves less than $1\%$ below $0.2$. Using $\sqrt{|x|}$ via sqrt(abs(x))—documented in the sItô Reference—prevents negative steps on the Euler grid from terminating the run and keeps the simulated terminal distribution close to the exact Gamma law even when Feller’s condition fails. The underlying simulation pipeline is described in Compiling parametric SDEs into fast Monte Carlo simulations.

Related notes: Square-root processes on a grid, Short-rate models compared, Correlation in the Heston model.