StochasticIntegrators.jl
Geometric integrators for stochastic differential equations, built on the JuliaGNI ecosystem.
The package implements stochastic Runge-Kutta methods for the SDE, PSDE and SPSDE problem types of GeometricEquations.jl, plugged into the integrator interface of GeometricIntegratorsBase.jl. Its distinguishing feature is that most of these methods are structure preserving: applied to a stochastic Hamiltonian system they are symplectic, or — for forced and dissipative systems — Lagrange-d'Alembert variational integrators. That is what keeps a long integration from accumulating spurious energy drift, and what makes the results usable for ergodic averages.
Much of the theory these methods rest on is developed in
M. Kraus and T. M. Tyranowski, Variational integrators for stochastic dissipative Hamiltonian systems, IMA Journal of Numerical Analysis, 2021.
arXiv:1904.06205
Installation
using Pkg
Pkg.add("StochasticIntegrators")Quick start
using StochasticIntegrators
using GeometricProblems.KuboOscillator
prob = sdeproblem() # a Kubo oscillator driven by 1-d noise
sol = integrate(prob, BurrageE1()) # explicit, strong
sol.q[end]2-element Vector{Float64}:
0.49777465086984346
-0.04712085489541754Everything follows the usual JuliaGNI shape: a problem describes the system, a method describes the scheme, and integrate(problem, method) runs it and returns a GeometricSolution.
Two things are specific to the stochastic case.
The driving noise belongs to the problem. A WienerProcess(m) in the problem's noise field says the system is driven by $m$ independent Wiener processes; the integrator draws the increments. Replacing it with a GridProcess prescribes them instead, which is how a run is made reproducible or two methods compared on one sample path — see Noise Processes.
Strong and weak convergence are properties of the method, not options. A strong method tracks individual sample paths; a weak one only reproduces expectations, and is fed cheaper increments accordingly. Choosing the wrong kind silently gives answers of the wrong accuracy, so the package derives it from the method rather than offering it as a keyword — see Theory.
Choosing a method
| you want | use |
|---|---|
| a cheap explicit scheme, sample paths matter | BurrageR2 — two stages, strong order 1.0 |
| the best strong order per explicit step | BurrageCL — four stages, strong order 1.5 |
| accuracy per step, sample paths matter | StochasticGLRK, StochasticDIRK |
| a Hamiltonian system, long integration | StochasticStoermerVerlet |
| a forced or damped Hamiltonian system | ModifiedStochasticStoermerVerlet |
| expectations, ergodic averages, distributions | SRKw2, RoesslerRS1 |
The Methods page gives each family in full.