SDE Solvers

SDE Solvers

Recommended Methods

For most Ito diagonal and scalar noise problems where a good amount of accuracy is required and mild stiffness may be an issue, the SRIW1Optimized algorithm should do well. If the problem has additive noise, then SRA1Optimized will be the optimal algorithm. For commutative noise, RKMilCommute is a strong order 1.0 method which utilizes the commutivity property to greatly speed up the Wiktorsson approximation and can choose between Ito and Stratonovich. For non-commutative noise, EM and EulerHeun are the choices (for Ito and Stratonovich interpretations respectively).

For stiff problems with diagonal noise, ImplicitRKMil is the most efficient method and can choose between Ito and Stratonovich. If the noise is non-diagonal, ImplicitEM and ImplicitEulerHeun are for Ito and Stratonovich respectively. For each of these methods, the parameter theta can be chosen. The default is theta=1/2 which will not dampen numerical oscillations and thus is symmetric (and almost symplectic) and will lead to less error when noise is sufficiently small. However, theta=1/2 is not L-stable in the drift term, and thus one can receive more stability (L-stability in the drift term) with theta=1, but with a tradeoff of error efficiency in the low noise case. In addition, the option symplectic=true will turns these methods into an implicit Midpoint extension which is symplectic in distribution but has an accuracy tradeoff.

Mass Matrices and Stochastic DAEs

The ImplicitRKMil, ImplicitEM, and ImplicitEulerHeun methods can solve stochastic equations with mass matrices (including stochastic DAEs written in mass matrix form) when either symplectic=true or theta=1.

Special Noise Forms

Some solvers are for specialized forms of noise. Diagonal noise is the default setup. Non-diagonal noise is specified via setting noise_rate_prototype to a matrix in the SDEProblem type. A special form of non-diagonal noise, commutative noise, occurs when the noise satisfies the following condition:

\[\sum_{i=1}^d g_{i,j_1}(t,u) \frac{\partial g_{k,j_2}}{\partial x_i} = \sum_{i=1}^d g_{i,j_2}(t,x) \frac{\partial g_{k,j_1}}{\partial x_i}\]

for every $j_1,j_2$ and $k$. Additive noise is when $g(t,u)=g(t)$, i.e. is independent of u. Multiplicative noise is $g_i(t,u)=a_i u$.

Special Keyword Arguments

Full List of Methods


Each of the StochasticDiffEq.jl solvers come with a linear interpolation. Orders are given in terms of strong order.

Nonstiff Methods

Example usage:

sol = solve(prob,SRIW1())

Tableau Controls

For SRA and SRI, the following option is allowed:

Stiff Methods


One unique feature of StochasticDiffEq.jl is the StochasticCompositeAlgorithm, which allows you to, with very minimal overhead, design a multimethod which switches between chosen algorithms as needed. The syntax is StochasticCompositeAlgorithm(algtup,choice_function) where algtup is a tuple of StochasticDiffEq.jl algorithms, and choice_function is a function which declares which method to use in the following step. For example, we can design a multimethod which uses EM() but switches to RKMil() whenever dt is too small:

choice_function(integrator) = (Int(integrator.dt<0.001) + 1)
alg_switch = StochasticCompositeAlgorithm((EM(),RKMil()),choice_function)

The choice_function takes in an integrator and thus all of the features available in the Integrator Interface can be used in the choice function.


†: Does not step to the interval endpoint. This can cause issues with discontinuity detection, and discrete variables need to be updated appropriately.