Learn R Programming

Sim.DiffProc (version 2.5)

CIRhy: Creating The modified CIR and hyperbolic Process (by Milstein Scheme)

Description

Simulation the modified CIR and hyperbolic process by milstein scheme.

Usage

CIRhy(N, M, t0, T, x0, 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.
r
constant ( -r * X(t) :drift coefficient).
sigma
constant positive ( sigma * sqrt(1+X(t)^2) :diffusion coefficient).
output
if output = TRUE write a output to an Excel (.csv).

Value

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

Details

The stochastic differential equation of the modified CIR is : $$dX(t) = -r *X(t)*dt + sigma *sqrt(1 + X(t)^2) *dW(t)$$ With -r*X(t) :drift coefficient and sigma*sqrt(1+X(t)^2) :diffusion coefficient, W(t) is Wiener process, the discretization dt = (T-t0)/N. Constraints: r + (sigma^2)/2 > 0 (this is needed to make the process positive recurrent).

See Also

CEV Constant Elasticity of Variance Models, CIR Cox-Ingersoll-Ross Models , 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
## The modified CIR and hyperbolic Process  
## dX(t) = - 0.3 *X(t) *dt + 0.9 * sqrt(1+X(t)^2) * dW(t)
## One trajectorie
 CIRhy(N=1000,M=1,T=1,t0=0,x0=1,r=0.3,sigma=0.9)

Run the code above in your browser using DataLab