Methods
Six families of stochastic Runge-Kutta methods, distinguished along three axes: which problem type they apply to, whether they are explicit or implicit, and whether they converge in the strong or the weak sense.
| family | problem | solve | convergence | structure of the schemes provided |
|---|---|---|---|---|
SERK | SDEProblem | explicit | strong | — |
SIRK | SDEProblem | implicit | strong | symplectic |
WERK | SDEProblem | explicit | weak | — |
WIRK | SDEProblem | implicit | weak | symplectic |
SIPRK | PSDEProblem | implicit | strong | symplectic |
SISPRK | SPSDEProblem | implicit | strong | Lagrange-d'Alembert, except StochasticLobattoIIIABD2 |
The last column is a property of the coefficients, not of the family: each of these types accepts any tableau of its kind, and one that violates the conditions of Theory is not symplectic whatever its type says. That is why issymplectic returns missing rather than true — the claim belongs to the named schemes, and scripts/tableau_conditions.jl is what establishes it for each of them.
Each family has a concrete type carrying a tableau and a random number generator, and a set of named constructors for the individual schemes. BurrageE1() is a SERK; there is no separate descriptor layer to specialise.
The method hierarchy
StochasticIntegrators.StochasticMethod — Type
StochasticMethod <: GeometricMethodRoot of the stochastic method hierarchy.
GeometricIntegratorsBase splits GeometricMethod into DeterministicMethod and nothing else; the stochastic branch lives here. A stochastic method differs from a deterministic one in that each step consumes a realisation of the driving noise, drawn according to convergence from the AbstractStochasticProcess carried by the problem.
StochasticIntegrators.SDEMethod — Type
Stochastic method for a SDEProblem.
StochasticIntegrators.PSDEMethod — Type
Stochastic method for a PSDEProblem.
StochasticIntegrators.SPSDEMethod — Type
Stochastic method for a SPSDEProblem.
StochasticIntegrators.convergence — Function
convergence(method)Whether a method needs increments that approximate the driving Wiener process in the strong (mean-square) or the weak sense — :strong or :weak.
This is a property of the scheme, not a choice the caller makes. A strong scheme is derived against the true increments $\Delta W^r = \int_{t_n}^{t_{n+1}} dW^r$, and needs them drawn from the correct Gaussian law, because it is asked to track an individual sample path. A weak scheme is derived only against the moments of the increments, and deliberately replaces them with a cheap discrete random variable that matches those moments — which is valid for computing expectations and wrong for tracking a path.
Feeding a scheme the other kind of increment produces plausible-looking numbers of the wrong accuracy, silently, which is why this is derived from the method rather than left as an option. See sample_noise! for the two laws.
julia> convergence(BurrageE1())
:strong
julia> convergence(StochasticStoermerVerlet())
:strong
julia> convergence(SRKw1())
:weakStochasticIntegrators.issdemethod — Function
issdemethod(method)Whether method integrates an SDEProblem. Accepts an instance or a type, and answers false for any other GeometricMethod, so it can be asked of a method of unknown kind.
StochasticIntegrators.ispsdemethod — Function
ispsdemethod(method)Whether method integrates a PSDEProblem. See issdemethod.
StochasticIntegrators.isspsdemethod — Function
isspsdemethod(method)Whether method integrates an SPSDEProblem, the split form in which the forcing is given as two separate terms. See issdemethod.
StochasticIntegrators.nstages — Function
Number of internal stages of a stochastic Runge-Kutta method.
Explicit strong methods
StochasticIntegrators.SERK — Type
SERK(tableau; rng = Random.default_rng())Stochastic explicit Runge-Kutta method for a SDEProblem, of strong (mean-square) convergence.
Each internal stage is built from the stages before it, so a step costs one evaluation of the drift and the diffusion per stage and involves no solve:
\[Q_i = q_n + \Delta t \sum_{j<i} a^{v}_{ij} V_j + \sum_r \Delta W^r \sum_{j<i} a^{B}_{ij} B_j^{\cdot r} + \frac{1}{\Delta t} \sum_r \Delta Z^r \sum_{j<i} a^{B_2}_{ij} B_j^{\cdot r} .\]
Being explicit it is cheap per step but has a bounded stability region, which for a stiff drift or a large noise intensity forces a much smaller time step than the implicit methods.
Constructed through one of the named schemes: StochasticEuler, StochasticHeun, Platen, BurrageR2, BurrageCL, BurrageE1, BurrageG5.
StochasticIntegrators.TableauSERK — Type
TableauSERK{T}Tableau of a stochastic explicit Runge-Kutta method.
Three Butcher tableaus, all strictly lower triangular: qdrift for the drift, qdiff for the diffusion terms carrying the Wiener increments $\Delta W$, and qdiff2 for the terms carrying the iterated integrals $\Delta Z$. A method that uses only $\Delta W$ leaves qdiff2 empty, which is recorded by giving it the name :NULL; hasdiffusion2 is the predicate.
No overall order is stored. Unlike in the deterministic case the order of a stochastic Runge-Kutta method is not a property of the coefficients alone — it depends on the dimension of the driving Wiener process and on whether the diffusion matrix satisfies the commutativity conditions. The o fields of the three tableaus are the classical orders of the underlying deterministic schemes and nothing more.
Each Butcher tableau it holds gets its own type parameter, so that the fields are concrete: RungeKutta.Tableau is Tableau{T,S,R∞,L}, and a field declared ::Tableau{T} would be abstract and make every coefficient access allocate. The constructors infer them.
StochasticIntegrators.hasdiffusion2 — Function
Whether a tableau carries a second diffusion tableau, applied to the iterated integrals ΔZ.
Explicit methods cost one evaluation of the drift and diffusion per stage and involve no solve, which makes them by far the cheapest per step. The price is a bounded stability region: for a stiff drift or a large noise intensity they force a much smaller time step than the implicit families, and none of them is structure preserving, so the energy of an oscillator drifts over a long run.
StochasticIntegrators.StochasticEuler — Function
StochasticEuler(; rng = Random.default_rng())Stochastic Euler method — the one-stage explicit scheme
\[q_{n+1} = q_n + \Delta t \, v(t_n, q_n) + \sum_r \Delta W^r \, B^{\cdot r}(t_n, q_n) .\]
Strong order 0.5 in general. The cheapest thing that works, and the natural baseline: any scheme worth using should beat it at equal cost.
StochasticIntegrators.StochasticHeun — Function
StochasticHeun(; rng = Random.default_rng())Stochastic Heun method — the two-stage explicit trapezoidal scheme, with the same tableau applied to the drift and the diffusion. Strong order 0.5, weak order 1.0 in general.
StochasticIntegrators.Platen — Function
Platen(; rng = Random.default_rng())Platen's two-stage explicit method, Eq. (52) of Burrage & Burrage (1996), High strong order explicit Runge-Kutta methods for stochastic ordinary differential equations.
Strong order 1.0 for a one-dimensional Wiener process. Its long-time behaviour is poor — it is not structure-preserving, and the energy of an oscillator drifts visibly over long runs — so it is mainly of interest for short integrations and for comparison.
StochasticIntegrators.BurrageR2 — Function
BurrageR2(; rng = Random.default_rng())Two-stage explicit R2 method of Burrage & Burrage, Eq. (51) of High strong order explicit Runge-Kutta methods for stochastic ordinary differential equations (1996).
Strong order 1.0 for a one-dimensional Wiener process. This is also the predictor used for the initial guess of the implicit SIRK methods.
StochasticIntegrators.BurrageCL — Function
BurrageCL(; rng = Random.default_rng())Four-stage explicit CL method of Burrage & Burrage, Eq. (56) of High strong order explicit Runge-Kutta methods for stochastic ordinary differential equations (1996). Strong order 1.5 for a one-dimensional Wiener process.
StochasticIntegrators.BurrageE1 — Function
BurrageE1(; rng = Random.default_rng())Four-stage explicit E1 method of Burrage & Burrage, Order conditions for stochastic Runge-Kutta methods by B-series (2000).
Strong order 1.0 for a one-dimensional Wiener process, and measured at 1.05 on the Kubo oscillator by scripts/convergence_order.jl.
It carries a second diffusion tableau against the iterated integrals $\Delta Z$. Those terms are necessary to exceed the order-1.0 ceiling that schemes built from $\Delta W$ alone are subject to, but they are not sufficient on their own — this method uses them and is still of order 1.0, whereas BurrageCL and BurrageG5 reach 1.5.
StochasticIntegrators.BurrageG5 — Function
BurrageG5(; rng = Random.default_rng())Five-stage explicit G5 method of Burrage & Burrage, Order conditions for stochastic Runge-Kutta methods by B-series (2000). Like BurrageE1 it uses the $\Delta Z$ terms.
BurrageCL, BurrageE1 and BurrageG5 carry a second diffusion tableau applied to the iterated integrals $\Delta Z$. Those terms are necessary to exceed the mean-square order 1.0 ceiling that schemes built from $\Delta W$ alone are subject to, but not sufficient on their own: BurrageCL and BurrageG5 reach order 1.5, while BurrageE1 carries the same terms and is of order 1.0. scripts/convergence_order.jl measures both, and the gap between them is the only check in the package on the $\Delta Z$ code path.
Implicit strong methods
StochasticIntegrators.SIRK — Type
SIRK(tableau; K = 0, rng = Random.default_rng())Stochastic implicit Runge-Kutta method for a SDEProblem, of strong (mean-square) convergence.
The internal stages are coupled, so each step solves
\[Y_i = \Delta t \sum_j a^{v}_{ij} \, v(Q_j) + \sum_r \Delta W^r \sum_j a^{B}_{ij} \, B^{\cdot r}(Q_j), \qquad Q_i = q_n + Y_i\]
for the stage increments $Y_i$ by Newton's method, in $D \times S$ unknowns. Note that the unknowns are the increments themselves rather than the stage derivatives: unlike the deterministic case the drift and the diffusion enter with different coefficients, so there is no single derivative to solve for.
K sets the Milstein-Tretyakov truncation of the Wiener increments — see truncation. It defaults to 0, no truncation.
Constructed through StochasticGLRK or StochasticDIRK.
StochasticIntegrators.TableauSIRK — Type
TableauSIRK{T}Tableau of a stochastic implicit Runge-Kutta method: qdrift for the drift, qdiff for the diffusion.
As for TableauSERK no overall order is stored, because the order of a stochastic Runge-Kutta method depends on the noise as well as on the coefficients. The o fields are the classical orders of the underlying deterministic schemes.
Each Butcher tableau it holds gets its own type parameter, so that the fields are concrete: RungeKutta.Tableau is Tableau{T,S,R∞,L}, and a field declared ::Tableau{T} would be abstract and make every coefficient access allocate. The constructors infer them.
The stage equations are coupled and solved by Newton's method in $D \times S$ unknowns. Note that the unknowns are the stage increments $Y_i$, not stage derivatives: the drift and the diffusion enter with different coefficients, so unlike the deterministic case there is no single derivative to solve for.
StochasticIntegrators.StochasticGLRK — Function
StochasticGLRK(s; K = 0, rng = Random.default_rng())s-stage stochastic Gauss-Legendre Runge-Kutta method: the Gauss collocation tableau applied to both the drift and the diffusion.
For s = 1 this is the stochastic implicit midpoint rule, which is the scheme Kraus & Tyranowski list first among their examples and the simplest Lagrange-d'Alembert integrator. Because drift and diffusion share one tableau, the symplecticity conditions reduce to the classical $\alpha_i a_{ij} + \alpha_j a_{ji} = \alpha_i \alpha_j$ that Gauss satisfies by construction, so the whole family is symplectic for a stochastic Hamiltonian system.
Setting the noise to zero recovers the deterministic Gauss method of the same number of stages, which is a useful check on an implementation.
StochasticIntegrators.StochasticDIRK — Function
StochasticDIRK(c = 0.5; K = 0, rng = Random.default_rng())Two-stage diagonally implicit stochastic Runge-Kutta method.
This is the family of Kraus & Tyranowski, Variational integrators for stochastic dissipative Hamiltonian systems, §3.3.3, where it is shown to be the most general two-stage DIRK satisfying both the Lagrange-d'Alembert conditions and the conditions for mean-square order 1.0. Every one of the six coefficient matrices is
\[a = \begin{pmatrix} c/2 & 0 \\ c & (1-c)/2 \end{pmatrix}, \qquad \alpha = (c, \; 1-c) ,\]
with c free. c = 0 and c = 1 collapse it to the stochastic midpoint method.
Being diagonally implicit, its stages can be solved one after another rather than all at once, which is what makes it cheaper than StochasticGLRK at equal stage count. The paper reports it as remaining accurate at time steps where explicit schemes have long since failed.
Partitioned methods
StochasticIntegrators.SIPRK — Type
SIPRK(tableau; K = 0, rng = Random.default_rng())Stochastic implicit partitioned Runge-Kutta method for a PSDEProblem, of strong (mean-square) convergence.
For a stochastic Hamiltonian system
\[\begin{aligned} d q &= \frac{\partial H}{\partial p} \, dt + \sum_r \frac{\partial h_r}{\partial p} \circ dW^r, \\ d p &= -\frac{\partial H}{\partial q} \, dt - \sum_r \frac{\partial h_r}{\partial q} \circ dW^r, \end{aligned}\]
a partitioned method applies different coefficients to the $q$ and $p$ equations, which is what makes it possible to be symplectic without being fully implicit in both. When the coefficients satisfy the Lagrange-d'Alembert conditions
\[\alpha_i \bar a_{ij} + \alpha_j a_{ji} = \alpha_i \alpha_j, \qquad \beta_i \bar b_{ij} + \beta_j b_{ji} = \beta_i \beta_j, \qquad \ldots\]
the scheme is a variational integrator: it arises from a discrete Lagrange-d'Alembert principle and preserves the symplectic structure pathwise. In practice that is what stops the energy of an oscillator from drifting over long integrations, which is the whole reason to prefer these methods to a general-purpose stochastic solver.
The solve is in $2 D S$ unknowns — the stage increments of both $q$ and $p$.
Constructed through StochasticSymplecticEuler or StochasticStoermerVerlet.
StochasticIntegrators.TableauSIPRK — Type
TableauSIPRK{T}Tableau of a stochastic implicit partitioned Runge-Kutta method: qdrift, pdrift for the drift parts of the $q$ and $p$ equations, qdiff, pdiff for their diffusion parts.
In the notation of Kraus & Tyranowski, Variational integrators for stochastic dissipative Hamiltonian systems, qdrift $= (a, \alpha)$, qdiff $= (b, \beta)$, pdrift $= (\bar a, \alpha)$ and pdiff $= (\bar b, \beta)$. Note that the $q$ and $p$ tableaus of a pair share their weight vectors — only their coefficient matrices differ. That is a requirement of the Lagrange-d'Alembert conditions, not a convention.
As elsewhere, no overall order is stored: the order of a stochastic Runge-Kutta method depends on the noise as well as on the coefficients.
Each Butcher tableau it holds gets its own type parameter, so that the fields are concrete: RungeKutta.Tableau is Tableau{T,S,R∞,L}, and a field declared ::Tableau{T} would be abstract and make every coefficient access allocate. The constructors infer them.
A partitioned method applies different coefficients to the $q$ and $p$ equations, which is what makes it possible to be symplectic without being fully implicit in both. Use these for a stochastic Hamiltonian system without forcing.
StochasticIntegrators.StochasticSymplecticEuler — Function
StochasticSymplecticEuler(; K = 0, rng = Random.default_rng())One-stage stochastic symplectic Euler method — implicit in $q$, explicit in $p$.
Satisfies all eight Lagrange-d'Alembert conditions, so it is a variational integrator. Its mean-square order conditions, however, are not satisfied in general: $\beta^T b e = 1 \neq 1/2$. It attains strong order 1.0 only for special choices of the stochastic Hamiltonians and forces — for instance $h = h(q)$ with $f = 0$, for which every term of the order conditions carries a vanishing factor and the conditions hold trivially. Outside such cases expect order 0.5.
Verified against the conditions of Kraus & Tyranowski by scripts/tableau_conditions.jl; the method itself does not appear in that paper.
StochasticIntegrators.StochasticStoermerVerlet — Function
StochasticStoermerVerlet(; K = 0, rng = Random.default_rng())Two-stage stochastic Störmer-Verlet method, built from the Lobatto IIIA-IIIB pair.
This is the scheme of Kraus & Tyranowski §3.3.3, Example 2, and its tableau matches theirs exactly: $(a, b) =$ Lobatto IIIA(2), $(\bar a, \bar b) =$ Lobatto IIIB(2), all weights $(1/2, 1/2)$. It satisfies both the Lagrange-d'Alembert conditions and the conditions for mean-square order 1.0.
It is the efficient choice among the strong partitioned methods. The stage equations decouple: the first is solved on its own, the second becomes explicit when the Hamiltonians are separable, and the last is an explicit update. If the forcing is independent of $p$ the whole method is explicit.
Split partitioned methods
StochasticIntegrators.SISPRK — Type
SISPRK(tableau; K = 0, rng = Random.default_rng())Stochastic implicit split partitioned Runge-Kutta method for a SPSDEProblem, of strong (mean-square) convergence.
This is the method of Kraus & Tyranowski for stochastic forced (dissipative) Hamiltonian systems
\[\begin{aligned} d q &= \frac{\partial H}{\partial p} dt + \sum_r \frac{\partial h_r}{\partial p} \circ dW^r , \\ d p &= \left[ -\frac{\partial H}{\partial q} + F \right] dt + \sum_r \left[ -\frac{\partial h_r}{\partial q} + f_r \right] \circ dW^r . \end{aligned}\]
The point of the split is that the Hamiltonian and the forcing terms of the $p$ equation get different coefficients — $(\bar a, \bar b)$ against $(\hat a, \hat b)$. That extra freedom is what allows the scheme to satisfy the Lagrange-d'Alembert conditions in the presence of forcing, making it a discrete Lagrange-d'Alembert variational integrator rather than merely a symplectic method with a dissipative term bolted on. It is the reason such a scheme tracks the correct energy decay of a damped system over long integrations instead of accumulating its own spurious drift.
Constructed through StochasticLobattoIIIABD2 or ModifiedStochasticStoermerVerlet.
StochasticIntegrators.TableauSISPRK — Type
TableauSISPRK{T}Tableau of a stochastic implicit split partitioned Runge-Kutta method.
Six Butcher tableaus. qdrift, qdiff act on the $q$ equation; the $p$ equation is split, with pdrift1, pdiff1 acting on the Hamiltonian part and pdrift2, pdiff2 on the forcing part. In the notation of Kraus & Tyranowski, Variational integrators for stochastic dissipative Hamiltonian systems, Eq. (SPRK):
| field | paper | acts on |
|---|---|---|
qdrift | $(a, \alpha)$ | $\partial H / \partial p$ |
qdiff | $(b, \beta)$ | $\partial h_r / \partial p$ |
pdrift1 | $(\bar a, \alpha)$ | $-\partial H / \partial q$ |
pdiff1 | $(\bar b, \beta)$ | $-\partial h_r / \partial q$ |
pdrift2 | $(\hat a, \hat \alpha)$ | $F$ |
pdiff2 | $(\hat b, \hat \beta)$ | $f_r$ |
The paper's tableau shares weight vectors: $\alpha$ is used for both qdrift and pdrift1, and $\beta$ for both qdiff and pdiff1; only the forcing tableaus carry independent weights $\hat\alpha$, $\hat\beta$. This is a consequence of the Lagrange-d'Alembert conditions, not a convention, so the constructor checks it — a tableau that violates it cannot be a variational integrator whatever else it satisfies.
Each Butcher tableau it holds gets its own type parameter, so that the fields are concrete: RungeKutta.Tableau is Tableau{T,S,R∞,L}, and a field declared ::Tableau{T} would be abstract and make every coefficient access allocate. The constructors infer them.
For a forced or dissipative stochastic Hamiltonian system. The $p$ equation is split so that the Hamiltonian part $-\partial H/\partial q$ and the forcing part $F$ receive different Runge-Kutta coefficients — the freedom that allows the Lagrange-d'Alembert conditions to be satisfied in the presence of forcing. See Theory.
StochasticIntegrators.StochasticLobattoIIIABD2 — Function
StochasticLobattoIIIABD2(; K = 0, rng = Random.default_rng())Two-stage stochastic Lobatto IIIA-IIIB-IIID method, with the Lobatto IIID pair of L. Jay in the forcing slots $\hat a$, $\hat b$.
Satisfies the conditions for mean-square order 1.0 for one Wiener process, but not the Lagrange-d'Alembert conditions — so it is not a variational integrator. Concretely, conditions (6) and (8) of Kraus & Tyranowski fail at $i = j = 1$: with $\hat b =$ Lobatto IIID(2) $= \begin{pmatrix} 1/4 & -1/4 \\ 3/4 & 1/4 \end{pmatrix}$,
\[\beta_i \hat b_{ij} + \hat\beta_j b_{ji} = \tfrac{1}{2}\cdot\tfrac{1}{4} + \tfrac{1}{2}\cdot 0 = \tfrac{1}{8} \neq \tfrac{1}{4} = \beta_i \hat\beta_j .\]
Conditions (1)–(4), which involve only the IIIA/IIIB pair, do hold. This is checked in scripts/tableau_conditions.jl, which asserts the failure rather than merely tolerating it.
Included for comparison: it shows what is lost when the forcing tableaus are chosen for deterministic accuracy rather than for the variational structure.
StochasticIntegrators.ModifiedStochasticStoermerVerlet — Function
ModifiedStochasticStoermerVerlet(c = 0.0; K = 0, rng = Random.default_rng())Two-stage modified stochastic Störmer-Verlet method: the Lobatto IIIA-IIIB pair with a one-parameter family
\[\hat a = \begin{pmatrix} c & 0 \\ c & 0 \end{pmatrix}, \qquad \hat\alpha = (c, \; 1-c)\]
in the forcing drift slot.
Satisfies both the Lagrange-d'Alembert conditions and the conditions for mean-square order 1.0. Neither set constrains c at all: $\hat a$ and $\hat\alpha$ enter the order conditions only through $\sum_i \hat\alpha_i = c + (1-c) = 1$, and the symplecticity residuals are identically zero in c. The constructor nevertheless restricts c to $[0,1]$, which keeps the collocation nodes $(c, c)$ inside the time step — a restriction on the method rather than one the conditions impose.
At $c = 1/2$ it reduces to the plain stochastic Störmer-Verlet method of Kraus & Tyranowski, of which this is a generalisation to forced systems with a free parameter.
All of the above is checked by scripts/tableau_conditions.jl.
Weak methods
StochasticIntegrators.WERK — Type
WERK(tableau; rng = Random.default_rng())Weak explicit Runge-Kutta method for a SDEProblem.
A weak method approximates expectations $E[\varphi(q(T))]$ rather than individual sample paths, which is what one actually wants for computing statistics — mean energy, ergodic limits, distributions. That freedom is what makes it cheap: the true Gaussian increments are replaced by the discrete random variables of sample_noise!, which match the moments the scheme was derived against and cost a single uniform draw apiece.
Structurally it is more elaborate than a strong method. Beyond the drift stages $H^{(0)}_i$ it carries a separate family of stages $H^{(l)}_i$ and $\hat H^{(l)}_i$ for each noise dimension $l$, and the diffusion matrix is evaluated at a different stage vector for each of its columns. That is what buys second-order weak accuracy for multi-dimensional noise.
Constructed through RoesslerRS1 or RoesslerRS2.
StochasticIntegrators.TableauWERK — Type
TableauWERK{T}Tableau of a weak explicit Runge-Kutta method, in the layout of Rößler, Second order Runge-Kutta methods for Stratonovich stochastic differential equations, BIT 47 (2007), Eq. (5.1).
Seven strictly lower triangular Butcher tableaus. In the notation of the paper,
| field | paper | field | paper |
|---|---|---|---|
qdrift0 | $A^{(0)}$ | qdiff0 | $B^{(0)}$ |
qdrift1 | $A^{(1)}$ | qdiff1 | $B^{(1)}$ |
qdrift2 | $A^{(2)}$ | qdiff2 | $B^{(2)}$ |
qdiff3 | $B^{(3)}$ |
with weights qdrift0.b $= \alpha$, qdiff0.b $= \beta_1$, qdiff3.b $= \beta_2$ and nodes qdrift0.c, qdrift1.c, qdrift2.c $= c^{(0)}, c^{(1)}, c^{(2)}$. The o fields are meaningless here and set to zero.
Each Butcher tableau it holds gets its own type parameter, so that the fields are concrete: RungeKutta.Tableau is Tableau{T,S,R∞,L}, and a field declared ::Tableau{T} would be abstract and make every coefficient access allocate. The constructors infer them.
StochasticIntegrators.WIRK — Type
WIRK(tableau; rng = Random.default_rng())Weak implicit Runge-Kutta method for a SDEProblem.
Like WERK it targets expectations rather than sample paths, and like SIRK it solves for its stage increments. It carries $m+1$ families of internal stages — one, $Q^{(0)}$, against which the drift is evaluated, and one $Q^{(l)}$ per noise dimension, against which column $l$ of the diffusion is evaluated. The solver system is correspondingly larger: $D \times S \times (1 + m)$ unknowns rather than $D \times S$.
The methods of Wang, Hong & Xu implemented here are symplectic, which for a stochastic Hamiltonian system is what keeps the energy from drifting over long runs — the property that makes a weak method usable for ergodic averages in the first place.
StochasticIntegrators.TableauWIRK — Type
TableauWIRK{T}Tableau of a weak implicit Runge-Kutta method, in the layout of Wang, Hong & Xu, Construction of Symplectic Runge-Kutta Methods for Stochastic Hamiltonian Systems, Commun. Comput. Phys. 21(1),
In the notation of that paper qdrift0 $= A^{(0)}$, qdrift1 $= A^{(1)}$, qdiff0 $= B^{(0)}$, qdiff1 $= B^{(1)}$, qdiff3 $= B^{(3)}$, with weights qdrift0.b $= \alpha$ and qdiff0.b $= \beta$, and nodes qdrift0.c, qdrift1.c.
Kraus & Tyranowski, §3.4, show that the symplecticity conditions of that paper are equivalent to their weak Lagrange-d'Alembert conditions, so these methods remain variational integrators when a forcing term is added.
Each Butcher tableau it holds gets its own type parameter, so that the fields are concrete: RungeKutta.Tableau is Tableau{T,S,R∞,L}, and a field declared ::Tableau{T} would be abstract and make every coefficient access allocate. The constructors infer them.
Weak methods target expectations rather than sample paths. Structurally they are more elaborate than the strong ones: beyond the drift stages they carry a separate family of internal stages for each noise dimension, and the diffusion matrix is evaluated at a different stage vector for each of its columns. That is what buys second-order weak accuracy for multi-dimensional noise, and it is why they cost noticeably more per stage.
StochasticIntegrators.RoesslerRS1 — Function
RoesslerRS1(; rng = Random.default_rng())Weak explicit Runge-Kutta method RS1 of Rößler, Second order Runge-Kutta methods for Stratonovich stochastic differential equations, BIT 47 (2007). Weak order 2.0.
StochasticIntegrators.RoesslerRS2 — Function
RoesslerRS2(; rng = Random.default_rng())Weak explicit Runge-Kutta method RS2 of Rößler, Second order Runge-Kutta methods for Stratonovich stochastic differential equations, BIT 47 (2007). Weak order 2.0.
StochasticIntegrators.SRKw1 — Function
SRKw1(λ = 0.0; rng = Random.default_rng())One-stage weak implicit Runge-Kutta method SRKw1 of Wang, Hong & Xu, Construction of Symplectic Runge-Kutta Methods for Stochastic Hamiltonian Systems, Commun. Comput. Phys. 21(1), 2017. Weak order 1.0.
λ is a free parameter of the family; λ = 1/2 reduces the method to the implicit midpoint rule with the Wiener increments replaced by the discrete weak variables.
Reproduced in Kraus & Tyranowski §3.4.3, where it is shown that the symplecticity conditions of Wang, Hong & Xu are equivalent to the weak Lagrange-d'Alembert conditions — so this is a variational integrator for forced systems too.
StochasticIntegrators.SRKw2 — Function
SRKw2(λ₁ = 0.0, λ₂ = 0.0, λ₃ = 0.0; rng = Random.default_rng())Four-stage weak implicit Runge-Kutta method SRKw2 of Wang, Hong & Xu (2017). Weak order 2.0 for systems driven by one-dimensional noise.
The three parameters are free and, as the paper notes, have no effect on $q_{n+1}$ or $p_{n+1}$; they default to zero for convenience. Of the weak methods here this is the most accurate.
The methods of Wang, Hong & Xu implemented as SRKw1 and SRKw2 are symplectic, which for a stochastic Hamiltonian system is what keeps the energy from drifting over the long runs a weak method is typically used for. Kraus & Tyranowski show their symplecticity conditions to be equivalent to the weak Lagrange-d'Alembert conditions, so they remain variational integrators when forcing is added.
Usage
Every method is used the same way:
using StochasticIntegrators
using GeometricProblems.KuboOscillator
integrate(sdeproblem(), BurrageE1()).q[end]
integrate(sdeproblem(), StochasticGLRK(1)).q[end]
integrate(psdeproblem(), StochasticStoermerVerlet()).q[end]
integrate(spsdeproblem(), ModifiedStochasticStoermerVerlet()).q[end]1-element Vector{Float64}:
0.496672470197487Methods are matched to problem types by dispatch. Handing a SIRK a PSDEProblem raises an error naming both, rather than silently doing something wrong:
try
integrate(psdeproblem(), StochasticGLRK(1))
catch e
e
endArgumentError("SIRK does not support problems of type PSDE.")Ensembles work without further ceremony, each member drawing its own realisation:
sol = integrate(sdeensemble(), BurrageE1())
length(sol)3Keyword arguments are passed to the method, not to integrate:
using Random
integrate(sdeproblem(), StochasticGLRK(2; K = 1, rng = Xoshiro(42))).q[end]2-element Vector{Float64}:
0.4965418920699439
-0.05870391315406612To build an integrator once and step it yourself, or to inspect it:
int = GeometricIntegrator(sdeproblem(), BurrageE1())
sol = integrate(int)
sol.q[end]2-element Vector{Float64}:
0.4991710425431062
-0.028779129686869832Tableaus
Each named method wraps a tableau, and the tableaus are available on their own — for inspecting coefficients, for checking the conditions of Theory, or for building a method with non-default options.
StochasticIntegrators.TableauStochasticEuler — Function
Tableau for the explicit 1-stage stochastic Euler method
StochasticIntegrators.TableauStochasticHeun — Function
Tableau for the explicit 2-stage stochastic Heun method
StochasticIntegrators.TableauPlaten — Function
Tableau for the explicit Platen method Platen's method cited in Eq. (52) in K. Burrage, P. Burrage (1996) "High strong order explicit Runge-Kutta methods for stochastic ordinary differential equations". According to the paper, the method has strong order 1.0 for one-dimensional Brownian motion. Appears to have a rather poor long-time performance.
StochasticIntegrators.TableauBurrageR2 — Function
Tableau for the explicit 2-stage R2 method due to K. Burrage and P. Burrage Method cited in Eq. (51) in K. Burrage, P. Burrage (1996) "High strong order explicit Runge-Kutta methods for stochastic ordinary differential equations". According to the paper, the method has strong order 1.0 for one-dimensional Brownian motion
StochasticIntegrators.TableauBurrageCL — Function
Tableau for the explicit 4-stage CL method due to K. Burrage and P. Burrage Method cited in Eq. (56) in K. Burrage, P. Burrage (1996) "High strong order explicit Runge-Kutta methods for stochastic ordinary differential equations". According to the paper, the method has strong order 1.5 for one-dimensional Brownian motion. Reduces to the classical R-K method of order 4 when noise is zero.
StochasticIntegrators.TableauBurrageE1 — Function
Tableau for the explicit 4-stage E1 method due to K. Burrage and P. Burrage Method cited in Eq. (4.2)-(4.3) in K. Burrage, P. Burrage (2000) "Order conditions for stochastic Runge-Kutta methods by B-series". According to the paper, the method has strong order 1.0 for one-dimensional Brownian motion.
StochasticIntegrators.TableauBurrageG5 — Function
Tableau for the explicit 5-stage G5 method due to K. Burrage and P. Burrage Method cited in Section 4 of K. Burrage, P. Burrage (2000) "Order conditions for stochastic Runge-Kutta methods by B-series". According to the paper, the method has strong order 1.5 for one-dimensional Brownian motion.
StochasticIntegrators.TableauStochasticGLRK — Function
Tableau for the s-stage Gauss-Lobatto SFIRK method
StochasticIntegrators.TableauStochasticDIRK — Function
Tableau for the 2-stage stochastic symplectic DIRK method Tableau for the stochastic symplectic DIRK method Satisfies the conditions for Lagrange-d'Alembert integrators. Satisfies the conditions for strong convergence of order 1.0 for one Wiener process
StochasticIntegrators.TableauStochasticSymplecticEuler — Function
Tableau for the stochastic symplectic Euler method Tableau for the stochastic symplectic Euler method Satisfies the conditions for Lagrange-d'Alembert integrators. Satisfies the conditions for strong convergence of order 1.0 for one Wiener process for special choices of the stochastic Hamiltonians and forces, e.g., h=h(q), f=0.
StochasticIntegrators.TableauStochasticStoermerVerlet — Function
Tableau for the 2-stage stochastic LobattoIIA-IIB method (Stormer-Verlet)
StochasticIntegrators.TableauStochasticLobattoIIIABD2 — Function
Tableau for the 2-stage stochastic LobattoIIIA-IIIB-IIID method (based on the deterministic LobattoIIIA-IIIB-IIID due to L. Jay) It satisfies the conditions for convergence of order 1.0 for one Wiener process, but it doesn't satisfy the conditions for Lagrange-d'Alembert integrators
StochasticIntegrators.TableauModifiedStochasticStoermerVerlet — Function
Tableau for the 2-stage modified stochastic LobattoIIIA-IIIB method Satisfies the conditions for Lagrange-d'Alembert integrators and the conditions for convergence of order 1.0 for one Wiener process
StochasticIntegrators.TableauRoesslerRS1 — Function
Tableau for the explicit 4-stage RS1 method due to Andreas Rössler Method cited in Table 5.2 in Andreas Rossler, "Second order Runge-Kutta methods for Stratonovich stochastic differential equations", BIT Numerical Mathematics (2007) 47 According to the paper, the method has weak order 2.0.
StochasticIntegrators.TableauRoesslerRS2 — Function
Tableau for the explicit 4-stage RS2 method due to Andreas Rössler Method cited in Table 5.3 in Andreas Rossler, "Second order Runge-Kutta methods for Stratonovich stochastic differential equations", BIT Numerical Mathematics (2007) 47 According to the paper, the method has weak order 2.0.
StochasticIntegrators.TableauSRKw1 — Function
Tableau for the 1-stage SRKw1 method due to Wang, Hong & Xu Method cited in Wang, Hong, Xu, "Construction of Symplectic Runge-Kutta Methods for Stochastic Hamiltonian Systems", Commun. Comput. Phys. 21(1), 2017 According to the paper, the method has weak order 1.0.
StochasticIntegrators.TableauSRKw2 — Function
Tableau for the 4-stage SRKw2 method due to Wang, Hong & Xu Method cited in Wang, Hong, Xu, "Construction of Symplectic Runge-Kutta Methods for Stochastic Hamiltonian Systems", Commun. Comput. Phys. 21(1), 2017 According to the paper, the method has weak order 2.0 when applied to systems driven by one-dimensional noise.
So BurrageE1() and SERK(TableauBurrageE1()) are the same thing, and the second form is how to pass a tableau built with other parameters:
SIRK(TableauStochasticDIRK(0.3); K = 1)SIRK method with tableau StochasticSymplecticDIRK