sde.sim.ea {sde} | R Documentation |
A rejection-method scheme for diffusions.
sde.sim.ea(t0 = 0, T = 1, X0 = 1, N = 100, delta, drift, drift.x, k1, k2, phi, max.psi = 1000, rh, A)
t0 |
time origin |
T |
horizon of simulation |
X0 |
initial value of the process |
N |
number of simulation steps |
delta |
time-step of the simulation |
drift |
drift coeffcient: a expression of two variables t and x |
drift.x |
partial derivative of drift coeffcient wrt to x : a function of two variables t and x |
k1 |
lower bound for psi(x) = 0.5*drift(x)^2 + 0.5*drift.x(x) |
k2 |
upper bound for psi(x) = 0.5*drift(x)^2 + 0.5*drift.x(x) |
phi |
the function psi(x) - k1 |
max.psi |
upper value of the support of psi to search for its maximum |
rh |
the rejection function. Seed details. |
A |
A(x) is the integral of the drift between 0 and x |
If missing k1
and k2
as well as A
, rh
and phi
are calculated numerically by the function.
X |
an invisible ts object |
Stefano Maria Iacus
Beskos, A. and Roberts, G.O. (2005) Exact simulation of diffusions, Ann. Appl. Probab., 4, 2422-2444.
set.seed(123) d <- expression(sin(x)) d.x <- expression(cos(x)) A <- function(x) 1-cos(x) sde.sim.ea(delta=1/20, X0=0, N=500, drift=d, drift.x = d.x, A=A) -> Y plot(Y, main="Periodic drift")