Learn R Programming

Sim.DiffProc (version 2.5)

Hyprocg: Creating The General Hyperbolic Diffusion (by Milstein Scheme)

Description

Simulation the general hyperbolic diffusion by milstein scheme.

Usage

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

Value

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

Details

A process X satisfying : $$dX(t) = (0.5*sigma^2*(beta-(gamma*X(t))/sqrt(theta^2+(X(t)-mu)^2))*dt + dW(t)$$ With (0.5*sigma^2*(beta-(gamma*X(t))/sqrt(theta^2+(X(t)-mu)^2)):drift coefficient and sigma :diffusion coefficient, W(t) is Wiener process, discretization dt = (T-t0)/N. The parameters gamma > 0 and 0 <= abs(beta)="" <="" gamma<="" code=""> determine the shape of the distribution, and theta >= 0, and mu are, respectively, the scale and location parameters of the distribution. Constraints: gamma > 0 , 0 <= abs(beta)="" <="" gamma<="" code=""> , theta >= 0 , sigma > 0.

See Also

Hyproc Hyperbolic Process, CIRhy modified CIR and hyperbolic Process, snssde Simulation Numerical Solution of SDE.

Examples

Run this code
## Hyperbolic Process 
## dX(t) = 0.5 * (2)^2*(0.25-(0.5*X(t))/sqrt(2^2+(X(t)-1)^2)) *dt + 2* dW(t)
## One trajectorie
 Hyprocg(N=1000,M=1,T=100,t0=0,x0=-10,beta=0.25,gamma=0.5,theta=2,mu=1,sigma=2)

Run the code above in your browser using DataLab