Skip to contents

Algorithms for solve() on SDE problems, named as in StochasticDiffEq.jl. EM() is the Euler-Maruyama method (strong order 0.5) and EulerHeun() its Stratonovich counterpart; both are fixed step methods (pass dt). LambaEM() is Euler-Maruyama with Lamba's error estimate, adaptive for any noise. RKMil() is the Runge-Kutta Milstein method (strong order 1) and SRIW1() and SOSRI() are Rößler's strong order 1.5 SRI methods (SOSRI is stability optimized); these three take diagonal or scalar noise and adapt their step size by default (pass adaptive = FALSE and dt for fixed steps). Adaptive methods use rejection sampling with memory, so a rejected step does not bias the Brownian path. LambaEulerHeun() is the Stratonovich counterpart of LambaEM(). RKMilCommute() is the Runge-Kutta Milstein method for commutative noise (strong order 1 for any noise shape with commuting diffusion columns). SRA1(), SRA2(), SRA3(), SOSRA() and SOSRA2() are Rößler's strong order 1.5 methods for additive noise (diffusion independent of the state; SOSRA and SOSRA2 are stability optimized). Without alg_hints, SOSRI() is the default for diagonal noise and LambaEM() for other noise; alg_hints = "additive" selects SOSRA(), "commutative" RKMilCommute() and "stratonovich" RKMil(interpretation = "Stratonovich") or LambaEulerHeun(), as in StochasticDiffEq.

Usage

EM(split = TRUE)

EulerHeun()

LambaEM(split = TRUE)

RKMil(interpretation = c("Ito", "Stratonovich"))

SRIW1()

SOSRI()

LambaEulerHeun()

SRA1()

SRA2()

SRA3()

SOSRA()

SOSRA2()

RKMilCommute(interpretation = c("Ito", "Stratonovich"))

# S3 method for class 'SDEProblem'
solve(a, b, ...)

Arguments

split

For EM(): evaluate the diffusion at the Euler predictor (TRUE, the default) rather than at the previous state. For LambaEM(): evaluate it at the previous state (TRUE) rather than at the predictor, as StochasticDiffEq's out of place cache does.

interpretation

"Ito" or "Stratonovich" for RKMil() and RKMilCommute().

a

An SDEProblem.

b

An SDE algorithm; SOSRI() or LambaEM() by default.

...

Solver options, see Details.

Value

An algorithm object.

Details

Solver options of solve() for SDE problems: dt, adaptive, abstol and reltol (default 1e-2), delta (weight of the drift error estimate), seed (sets the random number generator for this solve and restores the previous state afterwards), saveat, tstops, callback, save_everystep, dtmax, maxiters. The solution's Brownian path is sol$W, a list with the step times t and the matrix W of cumulative increments. As in StochasticDiffEq, solutions are interpolated linearly between steps and events inside a step are located on that interpolant; the Brownian path then continues from a bridge sample at the event time, so the state at an event carries the interpolation error of its step.

Examples

prob <- SDEProblem(function(u, p, t) p[1] * u, function(u, p, t) p[2] * u,
                   1, c(0, 1), c(1.5, 0.3))
sol <- solve(prob, SRIW1(), seed = 2)
sol$retcode
#> [1] "Success"