aleatory.processes.CIRProcess#
- class aleatory.processes.CIRProcess(theta=1.0, mu=2.0, sigma=0.5, initial=5.0, T=1.0, rng=None)[source]#
Cox–Ingersoll–Ross (CIR) Process#
Notes#
A Cox–Ingersoll–Ross process \(X = \{X : t \geq 0\}\) is characterised by the following Stochastic Differential Equation
\[dX_t = \theta(\mu - X_t) dt + \sigma \sqrt{X_t} dW_t, \ \ \ \ \forall t\in (0,T],\]with initial condition \(X_0 = x_0\), where
\(\theta\) is the rate of mean reversion
\(\mu\) is the long term mean value.
\(\sigma>0\) is the instantaneous volatility
\(W_t\) is a standard Brownian Motion.
It can be seen that each \(X_t\) follows a non-central chi-square distribution.
Constructor, Methods, and Attributes#
- __init__(theta=1.0, mu=2.0, sigma=0.5, initial=5.0, T=1.0, rng=None)[source]#
- Parameters:
theta (float) – the parameter \(\theta\) in the above SDE
mu (float) – the parameter \(\mu\) in the above SDE
sigma (float) – the parameter \(\sigma>0\) in the above SDE
initial (float) – the initial condition \(x_0\) in the above SDE
T (float) – the right hand endpoint of the time interval \([0,T]\) for the process
rng (numpy.random.Generator) – a custom random number generator
Methods
__init__([theta, mu, sigma, initial, T, rng])- param float theta:
the parameter \(\theta\) in the above SDE
draw(n, N[, T, marginal, envelope, title, ...])Simulates and plots paths/trajectories from the instanced stochastic process.
estimate_covariances([times])estimate_expectations()estimate_quantiles(q)estimate_stds()estimate_variances()get_marginal(t)marginal_df()marginal_expectation([times])marginal_nc_parameter([times])marginal_scale([times])marginal_stds([times])marginal_variance([times])plot(n, N[, T, title, suptitle])Simulates and plots paths/trajectories from the instanced stochastic process.
plot_covariance([times, title])plot_kernel([times, colormap, matrix_shape, ...])plot_kernel3d([times, title])plot_mean_variance([times, title])plot_paths_and_kernel(n, N[, T, title, ...])Plots the paths of the process and the covariance kernel.
process_covariance([times])process_expectation()process_stds()process_variance()sample(n)simulate(n, N[, T])Simulate paths/trajectories from the instanced stochastic process.
Attributes
TEnd time of the process.
murngsigmatheta