Learn R Programming

Sim.DiffProc (version 2.5)

PDP: Creating Pearson Diffusions Process (by Milstein Scheme)

Description

Simulation the pearson diffusions process by milstein scheme.

Usage

PDP(N, M, t0, T, x0, theta, mu, a, b, c, 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.
mu
constant.
a
constant.
b
constant.
c
constant.
output
if output = TRUE write a output to an Excel (.csv).

Value

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

Details

A class that further generalizes the Ornstein-Uhlenbeck and Cox-Ingersoll-Ross processes is the class of Pearson diffusion, the pearson diffusions process is the solution to the stochastic differential equation : $$dX(t) = -theta *(X(t)-mu)*dt + sqrt( 2*theta*(a*X(t)^2 + b *X(t)+ c))* dW(t)$$ With -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).
  1. When thediffusion coefficient = sqrt(2*theta*c)i.e,(a=0,b=0), we recover the Ornstein-Uhlenbeck process.
  2. Fordiffusion 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 > 1the invariant distribution is aGamma lawwith scale parameter1and shape parametermu.
  3. Fora > 0anddiffusion 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 = 0the invariant distribution is a scaledt distributionwithv=(1+a^(-1))degrees of freedom and scale parameterv^(-0.5), while formu =! 0the distribution is a form of skewedt distributionthat is called Pearson typeIVdistribution.
  4. Fora > 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 distributionwith shape parameter1 + a^-1and scale parametera/mu.
  5. Fora > 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 distributionwith(2*mu)/aand(2/a)+2degrees of freedom and scale parametermu / (a+1). For0 < mu < 1, some reflecting conditions on the boundaries are also needed.
  6. Ifa < 0andmu > 0are such thatmin(mu,1-mu) >= -aanddiffusion 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 distributionwith parameters-mu/aand(mu-1)/a.

See Also

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.

Examples

Run this code
## 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