Learn R Programming

Sim.DiffProc (version 2.5)

PredCorr3D: Predictor-Corrector Method For Three-Dimensional SDE

Description

Predictor-Corrector method of simulation numerical solution of Three dimensional stochastic differential equations.

Usage

PredCorr3D(N, T = 1, t0, x0, y0, z0, Dt, alpha = 0.5, mu = 0.5, driftx, drifty, driftz, diffx, diffy, diffz, Step = FALSE, Output = FALSE)

Arguments

N
size of process.
T
final time.
t0
initial time.
x0
initial value of the process X(t) at time t0.
y0
initial value of the process Y(t) at time t0.
z0
initial value of the process Z(t) at time t0.
Dt
time step of the simulation (discretization).
alpha
weight alpha of the predictor-corrector scheme.
mu
weight mu of the predictor-corrector scheme.
driftx
drift coefficient of process X(t): an expression of three variables t , x and y, z.
drifty
drift coefficient of process Y(t): an expression of three variables t , x and y, z.
driftz
drift coefficient of process Z(t): an expression of three variables t , x and y, z.
diffx
diffusion coefficient of process X(t): an expression of three variables t , x and y, z.
diffy
diffusion coefficient of process Y(t): an expression of three variables t , x and y, z.
diffz
diffusion coefficient of process Z(t): an expression of three variables t , x and y, z.
Step
if Step = TRUE ploting step by step.
Output
if output = TRUE write a output to an Excel (.csv).

Value

  • data.frame(time,X(t),Y(t),Z(t)) and plot of process 3-D.

Details

the system for stochastic differential equation Three dimensional is :$$dX(t) = ax(t,X(t),Y(t),Z(t))* dt + bx(t,X(t),Y(t),Z(t))* dWx(t)$$ $$dY(t) = ay(t,X(t),Y(t),Z(t))* dt + by(t,X(t),Y(t),Z(t))* dWy(t)$$ $$dZ(t) = az(t,X(t),Y(t),Z(t))* dt + bz(t,X(t),Y(t),Z(t))* dWz(t)$$ with driftx=ax(t,X(t),Y(t),Z(t)), drifty=ay(t,X(t),Y(t),Z(t)), driftz=az(t,X(t),Y(t),Z(t)) and diffx=bx(t,X(t),Y(t),Z(t)), diffy=by(t,X(t),Y(t),Z(t)),diffz=bz(t,X(t),Y(t),Z(t)) The method we present here just tries to approximate the states of the process first. This method is of weak convergence order 1. dW1(t) and dW2(t), dW3(t) are brownian motions independent. The predictor-corrector algorithm is as follows. First consider the simple approximation (the predictor), Then choose two weighting coefficients alpha and mu in [0,1] and calculate the corrector.

See Also

snssde numerical solution of one-dimensional SDE. snssde2D numerical solution of Two-dimensional SDE. snssde3D numerical solution of Three-dimensional SDE. PredCorr predictor-corrector method for one-dimensional SDE. PredCorr2D predictor-corrector method for Two-dimensional SDE.

Examples

Run this code
driftx <- expression(0)
 drifty <- expression(0)
 driftz <- expression(0)
 diffx <- expression(1)
 diffy <- expression(1)
 diffz <- expression(1)
 PredCorr3D(N=1000, T = 1, t0=0, x0=0, y0=0, z0=0, Dt=0.001, alpha = 0.5, mu = 0.5, 
     driftx, drifty, driftz, diffx, diffy, diffz)

Run the code above in your browser using DataLab