Last data update: 2014.03.03

R: Simulation of 1-Dim Diffusion Bridge
bridgesde1dR Documentation

Simulation of 1-Dim Diffusion Bridge

Description

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

Usage

bridgesde1d(N, ...)
## Default S3 method:
bridgesde1d(N = 1000, M=1, 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'
time(x, ...)
## S3 method for class 'bridgesde1d'
mean(x, ...)
## S3 method for class 'bridgesde1d'
median(x, ...)
## S3 method for class 'bridgesde1d'
quantile(x, ...)
## S3 method for class 'bridgesde1d'
kurtosis(x, ...)
## S3 method for class 'bridgesde1d'
skewness(x, ...)
## S3 method for class 'bridgesde1d'
moment(x, order = 2, ...)
## S3 method for class 'bridgesde1d'
bconfint(x, level=0.95, ...)
## S3 method for class 'bridgesde1d'
plot(x, ...)
## S3 method for class 'bridgesde1d'
lines(x, ...)
## S3 method for class 'bridgesde1d'
points(x, ...)							  

Arguments

N

number of simulation steps.

M

number of trajectories.

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 Dt = (T-t0)/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

an object inheriting from class "bridgesde1d".

order

order of moment.

level

the confidence level required.

...

further arguments for (non-default) methods.

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").

Value

bridgesde1d returns an object inheriting from class "bridgesde1d".

X

an invisible ts object.

drift

drift coefficient.

diffusion

diffusion coefficient.

C

numbre of crossing realized.

type

type of sde.

method

the numerical method used.

Author(s)

A.C. Guidoum, K. Boukhetala.

References

Bladt, M. and Sorensen, M. (2007). Simple simulation of diffusion bridges with application to likelihood inference for diffusions. Working Paper, University of Copenhagen.

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

## Ito Bridge sde
## dX(t) = 2*(1-X(t)) *dt + dW(t)
## x0 = 0 at time t0=0 , and y = 1 at time T=1
set.seed(1234)

f <- expression( 2*(1-x) )
g <- expression( 1 )
X <- bridgesde1d(drift=f,diffusion=g,y=1,N=1000,M=100)
X
plot(X,plot.type="single")
lines(time(X),mean(X),col=2)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(Sim.DiffProc)
Package 'Sim.DiffProc' version 3.2 loaded.
help(Sim.DiffProc) for summary information.
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Sim.DiffProc/bridgesde1d.Rd_%03d_medium.png", width=480, height=480)
> ### Name: bridgesde1d
> ### Title: Simulation of 1-Dim Diffusion Bridge
> ### Aliases: bridgesde1d bridgesde1d.default print.bridgesde1d
> ###   time.bridgesde1d mean.bridgesde1d median.bridgesde1d
> ###   quantile.bridgesde1d kurtosis.bridgesde1d skewness.bridgesde1d
> ###   moment.bridgesde1d bconfint.bridgesde1d plot.bridgesde1d
> ###   points.bridgesde1d lines.bridgesde1d
> ### Keywords: sde ts mts
> 
> ### ** Examples
> 
> ## Ito Bridge sde
> ## dX(t) = 2*(1-X(t)) *dt + dW(t)
> ## x0 = 0 at time t0=0 , and y = 1 at time T=1
> set.seed(1234)
> 
> f <- expression( 2*(1-x) )
> g <- expression( 1 )
> X <- bridgesde1d(drift=f,diffusion=g,y=1,N=1000,M=100)
> X
Ito Bridges Sde 1D:
	| dX(t) = 2 * (1 - X(t)) * dt + 1 * dW(t)
Method:
	| Euler scheme of order 0.5
Summary:
	| Size of process	| N  = 1000.
	| Crossing realized	| C  = 86.
	| Initial value		| x0 = 0.
	| Final value		| y = 1.
	| Time of process	| t in [0,1].
	| Discretization	| Dt = 0.001.
> plot(X,plot.type="single")
> lines(time(X),mean(X),col=2)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>