CIR¶
The Cox–Ingersoll–Ross (CIR) model
quantflow.sp.cir.CIR
pydantic-model
¶
Bases: IntensityProcess
The Cox-Ingersoll-Ross (CIR) model is a mean-reverting square-root diffusion process.
where \(w_t\) is a standard Wiener process. The process stays strictly positive (Feller condition) when
Fields:
-
rate(float) -
kappa(float) -
sigma(float) -
theta(float) -
sample_algo(SamplingAlgorithm)
feller_condition
property
¶
Value of \(2\kappa\theta - \sigma^2\); positive means the Feller condition holds.
is_positive
property
¶
True if the Feller condition holds, guaranteeing the process stays strictly positive.
sample
¶
sample_from_draws
¶
Source code in quantflow/sp/cir.py
sample_euler
¶
Source code in quantflow/sp/cir.py
sample_implicit
¶
Use an implicit scheme to preserve positivity of the process.
Source code in quantflow/sp/cir.py
characteristic_exponent
¶
Characteristic exponent of the CIR process.
where \(x_0\) is the initial rate.
Source code in quantflow/sp/cir.py
integrated_log_laplace
¶
Log-Laplace transform of the time-integrated CIR process.
where \(\gamma = \sqrt{\kappa^2 + 2u\sigma^2}\), \(D = 2\gamma + (\gamma+\kappa)(e^{\gamma t}-1)\), and \(x_0\) is the initial rate.
Source code in quantflow/sp/cir.py
domain_range
¶
analytical_mean
¶
Analytical mean of the CIR process at time \(t\).
Source code in quantflow/sp/cir.py
analytical_variance
¶
Analytical variance of the CIR process at time \(t\).
Source code in quantflow/sp/cir.py
analytical_pdf
¶
The marginal pdf of the CIR process is the scaled non-central chi-squared.
\(I_q\) is the modified Bessel function of the first kind of order \(q\).
Source code in quantflow/sp/cir.py
characteristic
¶
Characteristic function at time t for a given input parameter u
The characteristic function represents the Fourier transform of the probability density function
where \(\phi\) is the characteristic exponent, which can be more easily computed for many processes.
| PARAMETER | DESCRIPTION |
|---|---|
t
|
Time horizon
TYPE:
|
u
|
Characteristic function input parameter
TYPE:
|
Source code in quantflow/sp/base.py
convexity_correction
¶
analytical_std
¶
Analytical standard deviation of the process at time t
This has a closed form solution if the process has an analytical variance
analytical_cdf
¶
marginal
¶
frequency_range
¶
Maximum frequency when calculating characteristic functions
Source code in quantflow/sp/base.py
support
¶
Support of the process at time t