Learn R Programming

Sim.DiffProc (version 2.5)

diffBridge: Creating Diffusion Bridge Models (by Euler Scheme)

Description

Simulation of diffusion bridge models by euler scheme.

Usage

diffBridge(N, t0, T, x, y, drift, diffusion, Output = FALSE)

Arguments

N
size of process.
t0
initial time.
T
final time.
x
initial value of the process at time t0.
y
terminal value of the process at time T.
drift
drift coefficient: an expression of two variables t and x.
diffusion
diffusion coefficient: an expression of two variables t and x.
Output
if Output = TRUE write a Output to an Excel (.csv).

Value

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

Details

The function diffBridge returns a trajectory of the diffusion bridge starting at x at time t0 and ending at y at time T, the discretization dt = (T-t0)/N.

See Also

CEV Constant Elasticity of Variance Models, CKLS Chan-Karolyi-Longstaff-Sanders Models, CIR Cox-Ingersoll-Ross Models, CIRhy modified CIR and hyperbolic Process, 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, snssde Simulation Numerical Solution of SDE.

Examples

Run this code
## example 1 : Ornstein-Uhlenbeck Bridge Model (x0=1,t0=0,y=3,T=1)
 drift     <- expression( (3*(2-x)) )
 diffusion <- expression( (2) )
 diffBridge(N=1000,t0=0,T=1,x=1,y=1,drift,diffusion) 


## example 2 : Brownian Bridge Model (x0=0,t0=0,y=1,T=1)
 drift     <- expression( 0)
 diffusion <- expression( 1 )
 diffBridge(N=1000,t0=0,T=1,x=0,y=0,drift,diffusion) 

## example 3 : Geometric Brownian Bridge Model (x0=1,t0=1,y=3,T=3)
 drift     <- expression( (3*x) )
 diffusion <- expression( (2*x) )
 diffBridge(N=1000,t0=0,T=10,x=1,y=1,drift,diffusion)

## example 4 : sde\ dX(t)=(0.03*t*X(t)-X(t)^3)*dt+0.1*dW(t) (x0=0,t0=0,y=2,T=100)
 drift     <- expression( (0.03*t*x-x^3) )
 diffusion <- expression( (0.1) )
 diffBridge(N=1000,t0=0,T=100,x=1,y=1,drift,diffusion)

Run the code above in your browser using DataLab