Learn R Programming

Sim.DiffProc (version 2.8)

bridgesde1d: Simulation of 1-Dim Diffusion Bridge

Description

The (S3) generic function bridgesde1d for simulation of 1-dim diffusion bridge.

Usage

bridgesde1d(N, ...)
## S3 method for class 'default':
bridgesde1d(N = 1000, x0 = 0, y = 0, t0 = 0, T = 1, Dt, 
   drift, diffusion, alpha = 0.5, mu = 0.5, type = c("ito", "str"), 
   method = c("euler", "milstein", "predcorr", "smilstein", "taylor", 
   "heun", "rk1", "rk2", "rk3"), ...)
							  
							  
## S3 method for class 'bridgesde1d':
summary(object, \dots)
## S3 method for class 'bridgesde1d':
time(x, \dots)
## S3 method for class 'bridgesde1d':
plot(x, \dots)
## S3 method for class 'bridgesde1d':
lines(x, \dots)
## S3 method for class 'bridgesde1d':
points(x, \dots)

Arguments

N
number of simulation steps.
x0
initial value of the process at time t0.
y
terminal value of the process at time T.
t0
initial time.
T
final time.
Dt
time step of the simulation (discretization). If it is missing a default $\Delta t = \frac{T-t_{0}}{N}$.
drift
drift coefficient: an expression of two variables t and x.
diffusion
diffusion coefficient: an expression of two variables t and x.
alpha, mu
weight of the predictor-corrector scheme; the default alpha = 0.5 and mu = 0.5.
type
if type="ito" simulation diffusion bridge of Ito type, else type="str" simulation diffusion bridge of Stratonovich type; the default type="ito".
method
numerical methods of simulation, the default method = "euler"; see snssde1d.
x, object
an object inheriting from class "bridgesde1d".
...
further arguments for (non-default) methods.

Value

  • bridgesde1d returns an object inheriting from class "bridgesde1d".
  • Xan invisible ts object.

newcommand

\CRANpkg

href

http://CRAN.R-project.org/package=#1

pkg

#1

Details

The function bridgesde1d returns a trajectory of the diffusion bridge starting at x at time t0 and ending at y at time T. The methods of approximation are classified according to their different properties. Mainly two criteria of optimality are used in the literature: the strong and the weak (orders of) convergence. The method of simulation can be one among: Euler-Maruyama Order 0.5, Milstein Order 1, Milstein Second-Order, Predictor-Corrector method, Ito-Taylor Order 1.5, Heun Order 2 and Runge-Kutta Order 1, 2 and 3. For more details see vignette("SDEs").

References

Bladt, M. and Sorensen, M. (2007). Simple simulation of diffusion bridges with application to likelihood inference for diffusions. Working Paper, University of Copenhagen. Available at http://www.math.ku.dk/~michael/diffusionbridgepreprint.pdf Iacus, S.M. (2008). Simulation and inference for stochastic differential equations: with R examples. Springer-Verlag, New York

See Also

bridgesde2d and bridgesde3d for 2 and 3-dim. DBridge in package sde.

Examples

Run this code
## Example 1: Ito Bridge sde
## dX(t) = 2*(1-X(t)) *dt + dW(t)
## x0 = 0 at time t0=0 , and y = 0 at time T=1

f <- expression( 2*(1-x) )
g <- expression( 1 )
X <- bridgesde1d(drift=f,diffusion=g,y=0,N=1000,Dt=0.001)
X
plot(X)

## Example 2: Stratonovich Bridge sde
## dX(t) = 2*(1-X(t)) *dt + x o dW(t)
## x0 = 0 at time t0=0 , and y = 0 at time T=1

f <- expression( 2*(1-x) )
g <- expression( x )
X <- bridgesde1d(drift=f,diffusion=g,y=0,N=1000,Dt=0.001,type="str")
X
plot(X)

Run the code above in your browser using DataLab