
PDP(N, M, t0, T, x0, theta, mu, a, b, c, output = FALSE)
t0
.output = TRUE
write a output
to an Excel (.csv).-theta *(X(t)-mu) :drift coefficient
and sqrt( 2*theta*(a*X(t)^2 + b *X(t)+ c)) :diffusion coefficient
, W(t)
is Wiener process, discretization dt = (T-t0)/N
.
With theta > 0
and a
, b
, and c
such that the diffusion coefficient is well-defined i.e., the square root can be extracted for all the values of the state space of X(t)
.
diffusion coefficient = sqrt(2*theta*c)
i.e,(a=0,b=0)
, we recover the Ornstein-Uhlenbeck process.diffusion coefficient = sqrt(2*theta*X(t))
and0 < mu <= 1<="" code="">i.e,(a=0,b=1,c=0)
, we obtain the Cox-Ingersoll-Ross process, and ifmu > 1
the invariant distribution is aGamma law
with scale parameter1
and shape parametermu
.
a > 0
anddiffusion coefficient = sqrt(2*theta*a*(X(t)^2+1))
i.e,(b=0,c=a)
, the invariant distribution always exists on the real line, and formu = 0
the invariant distribution is a scaledt distribution
withv=(1+a^(-1))
degrees of freedom and scale parameterv^(-0.5)
, while formu =! 0
the distribution is a form of skewedt distribution
that is called Pearson typeIV
distribution.a > 0
,mu > 0
, anddiffusion coefficient = sqrt(2*theta*a*X(t)^2)
i.e,(b=0,c=0)
, the distribution is defined on the positive half line and it is aninverse Gamma distribution
with shape parameter1 + a^-1
and scale parametera/mu
.a > 0
,mu >= a
, anddiffusion coefficient = sqrt(2*theta*a*X(t)*(X(t)+1))
i.e,(b=a,c=0)
, the invariant distribution is the scaledF distribution
with(2*mu)/a
and(2/a)+2
degrees of freedom and scale parametermu / (a+1)
. For0 < mu < 1
, some reflecting conditions on the boundaries are also needed.a < 0
andmu > 0
are such thatmin(mu,1-mu) >= -a
anddiffusion coefficient = sqrt(2*theta*a*X(t)*(X(t)-1))
i.e,(b=-a,c=0)
, the invariant distribution exists on the interval[0,1]
and is aBeta distribution
with parameters-mu/a
and(mu-1)/a
.CEV
Constant Elasticity of Variance Models, CIR
Cox-Ingersoll-Ross 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, ROU
Radial Ornstein-Uhlenbeck Process, diffBridge
Diffusion Bridge Models, snssde
Simulation Numerical Solution of SDE.## example 1
## theta = 5, mu = 10, (a=0,b=0,c=0.5)
## dX(t) = -5 *(X(t)-10)*dt + sqrt( 2*5*0.5)* dW(t)
PDP(N=1000,M=1,T=1,t0=0,x0=1,theta=5,mu=10,a=0,b=0,c=0.5)
## example 2
## theta = 0.1, mu = 0.25, (a=0,b=1,c=0)
## dX(t) = -0.1 *(X(t)-0.25)*dt + sqrt( 2*0.1*X(t))* dW(t)
PDP(N=1000,M=1,T=1,t0=0,x0=1,theta=0.1,mu=0.25,a=0,b=1,c=0)
## example 3
## theta = 0.1, mu = 1, (a=2,b=0,c=2)
## dX(t) = -0.1*(X(t)-1)*dt + sqrt( 2*0.1*(2*X(t)^2+2))* dW(t)
PDP(N=1000,M=1,T=1,t0=0,x0=1,theta=0.1,mu=1,a=2,b=0,c=2)
## example 4
## theta = 0.1, mu = 1, (a=2,b=0,c=0)
## dX(t) = -0.1*(X(t)-1)*dt + sqrt( 2*0.1*2*X(t)^2)* dW(t)
PDP(N=1000,M=1,T=1,t0=0,x0=1,theta=0.1,mu=1,a=2,b=0,c=0)
## example 5
## theta = 0.1, mu = 3, (a=2,b=2,c=0)
## dX(t) = -0.1*(X(t)-3)*dt + sqrt( 2*0.1*(2*X(t)^2+2*X(t)))* dW(t)
PDP(N=1000,M=1,T=1,t0=0,x0=0.1,theta=0.1,mu=3,a=2,b=2,c=0)
## example 6
## theta = 0.1, mu = 0.5, (a=-1,b=1,c=0)
## dX(t) = -0.1*(X(t)-0.5)*dt + sqrt( 2*0.1*(-X(t)^2+X(t)))* dW(t)
PDP(N=1000,M=1,T=1,t0=0,x0=0.1,theta=0.1,mu=0.5,a=-1,b=1,c=0)
Run the code above in your browser using DataLab