Note
Go to the end to download the full example code.
CIR Process#
Simulate and visualise paths
# Author: Dialid Santiago <d.santiago@outlook.com>
# License: MIT
# Description: Simulate and visualise a CIR process
from aleatory.processes import CIRProcess
from aleatory.styles import qp_style
qp_style() # Use quant-pastel-style
p = CIRProcess()
fig = p.draw(n=200, N=200, figsize=(12, 7), colormap="terrain")
fig.show()
![CIR Process $X(\theta=1.0, \mu=2.0, \sigma=0.5)$ starting at $x_0=$5.0, Monte Carlo Simulated Paths $\{{X_t, t \in [t_0, T]\}}$, $X_T$ Marginal](../_images/sphx_glr_plot_cir_001.png)
p = CIRProcess(theta=1.0, mu=10.0, sigma=2.0, initial=1.0, T=10.0)
fig = p.draw(n=200, N=200, figsize=(12, 7), colormap="Oranges")
fig.show()
![CIR Process $X(\theta=1.0, \mu=10.0, \sigma=2.0)$ starting at $x_0=$1.0, Monte Carlo Simulated Paths $\{{X_t, t \in [t_0, T]\}}$, $X_T$ Marginal](../_images/sphx_glr_plot_cir_002.png)
fig = p.plot(n=100, N=10, figsize=(12, 7))
fig.show()

Total running time of the script: (0 minutes 3.163 seconds)