
Last chance! 50% off unlimited learning
Sale ends in
PredCorr2D(N, T = 1, t0, x0, y0, Dt, alpha = 0.5, mu = 0.5, driftx,
drifty, diffx, diffy, Step = FALSE, Output = FALSE)
X(t)
at time t0
.Y(t)
at time t0
.discretization
).alpha
of the predictor-corrector scheme.mu
of the predictor-corrector scheme.X(t)
: an expression of three variables t
, x
and y
.Y(t)
: an expression of three variables t
, x
and y
.X(t)
: an expression of three variables t
, x
and y
.Y(t)
: an expression of three variables t
, x
and y
.Step = TRUE
ploting step by step.output = TRUE
write a output
to an Excel 2007.driftx=ax(t,X(t),Y(t))
, drifty=ay(t,X(t),Y(t))
and
diffx=bx(t,X(t),Y(t))
, diffy=by(t,X(t),Y(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)
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.diffBridge
Creating Diffusion Bridge Models. snssde
numerical solution of one-dimensional SDE. snssde2D
numerical solution of Two-dimensional SDE. PredCorr
predictor-corrector method for one-dimensional SDE.## Example 1
driftx <- expression(cos(t*x*y))
drifty <- expression(cos(t))
diffx <- expression(0.1)
diffy <- expression(0.1)
PredCorr2D(N=5000, T = 1, t0=0, x0=0, y0=0, Dt=0.001, alpha = 0.5,
mu = 0.5, driftx, drifty, diffx, diffy, Step = FALSE,
Output = FALSE)
## ploting Step by Step
##PredCorr2D(N=5000, T = 1, t0=0, x0=0, y0=0, Dt=0.001, alpha = 0.5,
## mu = 0.5, driftx, drifty, diffx, diffy, Step = TRUE,
## Output = FALSE)
## Example 2
## BM 2-D
driftx <- expression(0)
drifty <- expression(0)
diffx <- expression(1)
diffy <- expression(1)
PredCorr2D(N=5000, T = 1, t0=0, x0=0, y0=0, Dt=0.001, alpha = 0.5,
mu = 0.5, driftx, drifty, diffx, diffy, Step = FALSE,
Output = FALSE)
## ploting Step by Step
##PredCorr2D(N=5000, T = 1, t0=0, x0=0, y0=0, Dt=0.001, alpha = 0.5,
## mu = 0.5, driftx, drifty, diffx, diffy, Step = TRUE,
## Output = FALSE)
## Example 3
driftx <- expression(0.03*t*x-x^3)
drifty <- expression(0.03*t*y-y^3)
diffx <- expression(0.1)
diffy <- expression(0.1)
PredCorr2D(N=5000, T = 1, t0=0, x0=0, y0=0, Dt=0.001, alpha = 0.5,
mu = 0.5, driftx, drifty, diffx, diffy, Step = FALSE,
Output = FALSE)
## ploting Step by Step
## PredCorr2D(N=5000, T = 1, t0=0, x0=0, y0=0, Dt=0.001, alpha = 0.5,
## mu = 0.5, driftx, drifty, diffx, diffy, Step = FALSE,
## Output = FALSE)
Run the code above in your browser using DataLab