Learn R Programming

Sim.DiffProc (version 2.5)

CIR: Creating Cox-Ingersoll-Ross (CIR) Square Root Diffusion Models (by Milstein Scheme)

Description

Simulation cox-ingersoll-ross models by milstein scheme.

Usage

CIR(N, M, t0, T, x0, theta, r, sigma, output = FALSE)

Arguments

N
size of process.
M
number of trajectories.
t0
initial time.
T
final time.
x0
initial value of the process at time t0.
theta
constant positive ( (r - theta * X(t)) :drift coefficient).
r
constant positive ( (r - theta * X(t)) :drift coefficient).
sigma
constant positive ( sigma * sqrt(X(t)) :diffusion coefficient).
output
if output = TRUE write a output to an Excel (.csv).

Value

  • data.frame(time,x) and plot of process.

Details

Another interesting family of parametric models is that of the Cox-Ingersoll-Ross process. This model was introduced by Feller as a model for population growth and became quite popular in finance after Cox, Ingersoll, and Ross proposed it to model short-term interest rates. It was recently adopted to model nitrous oxide emission from soil by Pedersen and to model the evolutionary rate variation across sites in molecular evolution. The discretization dt = (T-t0)/N, and the stochastic differential equation of CIR is : $$dX(t) = (r - theta *X(t))*dt + sigma *sqrt(X(t)) *dW(t)$$ With (r - theta *X(t)) :drift coefficient and sigma*sqrt(X(t)) :diffusion coefficient, W(t) is Wiener process. Constraints: 2*r > sigma^2.

See Also

CEV Constant Elasticity of Variance Models, CIRhy modified CIR and hyperbolic Process, CKLS Chan-Karolyi-Longstaff-Sanders Models, DWP Double-Well Potential Model, GBM Model of Black-Scholes, HWV Hull-White/Vasicek Models, INFSR Inverse of Feller s Square Root models, JDP Jacobi Diffusion Process, PDP Pearson Diffusions Process, ROU Radial Ornstein-Uhlenbeck Process, diffBridge Diffusion Bridge Models, snssde Simulation Numerical Solution of SDE.

Examples

Run this code
## Cox-Ingersoll-Ross Models 
## dX(t) = (0.1 - 0.2 *X(t)) *dt + 0.05 * sqrt(X(t)) * dW(t)
## One trajectorie
 CIR(N=1000,M=1,t0=0,T=1,x0=0.2,theta=0.2,r=0.1,sigma=0.05)

Run the code above in your browser using DataLab