## 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