You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/solvers/sde_solvers.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# SDE solvers
2
2
3
3
See also [How to choose a solver](../../usage/how-to-choose-a-solver.md#stochastic-differential-equations)
4
-
and [SDE example](../../devdocs/sde_example.ipynb/#table-of-available-srk-methods-in-diffrax) which contains a table of SDE solvers and their properties.
4
+
and [SDE example](../../../examples/sde_example.ipynb/#table-of-available-srk-methods-in-diffrax) which contains a table of SDE solvers and their properties.
Copy file name to clipboardExpand all lines: docs/usage/how-to-choose-a-solver.md
+24-27Lines changed: 24 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,54 +42,51 @@ For "split stiffness" problems, with one term that is stiff and another term tha
42
42
43
43
## Stochastic differential equations
44
44
45
-
SDE solvers are relatively specialised depending on the type of problem. Each solver will converge to either the Itô solution or the Stratonovich solution. In addition some solvers require "commutative noise".
45
+
SDE solvers are relatively specialised depending on the type of problem. Each solver will converge to either the Itô solution or the Stratonovich solution of the SDE. The Itô and Stratonovich solutions coincide iff the SDE has additive noise (as defined below). In addition some solvers require the SDE to have "commutative noise" or "additive noise". All of these terms are defined below.
46
46
47
-
!!! info "Commutative noise"
47
+
### General (noncommutative) noise
48
+
This includes any SDE of the form $dy(t) = f(y(t), t) dt + g(y(t), t) dw(t),$ where $t \in [0, T]$, $y(t) \in \mathbb{R}^e$, and $w$ is a standard Brownian motion on $\mathbb{R}^d$. We refer to $f: \mathbb{R}^e \times [0, T] \to \mathbb{R}^e$ as the drift vector field (VF) and $g: \mathbb{R}^e \times [0, T] \to \mathbb{R}^{e \times d}$ is the diffusion matrix field with columns $g_i$ for $i = 1, \ldots, d$.
Some common special cases in which this condition is satisfied are:
58
+
- when $g$ is a diagonal operator (i.e. $g(y,t)$ is a diagonal matrix for all $y, t$ and the i-th diagonal entry depends only on $y_i$),
59
+
- when the dimension of BM is $d=1$, or
60
+
- when the noise is additive (see below).
58
61
59
-
- the diffusion is additive ($σ$ is independent of $y$);
60
-
- the noise is scalar ($w$ is scalar-valued);
61
-
- the diffusion is diagonal ($σ$ is a diagonal matrix and such that the i-th
62
-
diagonal entry depends only on $y_i$; *not* to be confused with the simpler
63
-
but insufficient condition that $σ$ is only a diagonal matrix)
62
+
- The solver with the highest order of convergence for commutative noise SDEs is [`diffrax.SlowRK`][]. [`diffrax.ItoMilstein`][] and [`diffrax.StratonovichMilstein`][] are alternatives which evaluate the vector field fewer times per step, but also compute its derivative.
63
+
64
+
65
+
### Additive noise
66
+
We say that the diffusion is additive when $g$ does not depend on $y(t)$ and the SDE can be written as $dy(t) = f(y(t), t) dt + g(t) dw(t)$.
67
+
68
+
Additive noise is a special case of commutative noise. For additive noise SDEs, the Itô and Stratonovich solutions conicide. Some solvers are specifically designed for additive noise SDEs, of these [`diffrax.SEA`][] is the cheapest, [`diffrax.ShARK`][] is the most accurate and [`diffrax.SRA1`][] is another alternative.
64
69
65
70
### Itô
66
71
67
72
For Itô SDEs:
68
73
74
+
- For general noise [`diffrax.Euler`][] is a typical choice.
69
75
- If the noise is commutative then [`diffrax.ItoMilstein`][] is a typical choice;
70
-
- If the noise is noncommutative then [`diffrax.Euler`][] is a typical choice.
71
76
72
77
### Stratonovich
73
78
74
79
For Stratonovich SDEs:
75
80
76
81
- If cheap low-accuracy solves are desired then [`diffrax.EulerHeun`][] is a typical choice.
77
-
- Otherwise, and if the noise is commutative, then [`diffrax.SlowRK`][] has the best order of convergence, but is expensive per step. [`diffrax.StratonovichMilstein`][] is a good cheap alternative.
78
-
- If the noise is noncommutative, [`diffrax.GeneralShARK`][] is the most efficient choice, while [`diffrax.Heun`][] is a good cheap alternative.
79
-
- If the noise is noncommutative and an embedded method for adaptive step size control is desired, then [`diffrax.SPaRK`][] is the recommended choice.
Then the diffusion matrix $σ$ is said to be additive if $σ(t, y) = σ(t)$. That is to say if the diffusion is independent of $y$.
82
+
- For general noise, [`diffrax.GeneralShARK`][] is the most efficient choice, while [`diffrax.Heun`][] is a good cheap alternative.
83
+
- If an embedded method for adaptive step size control is desired and the noise is noncommutative then [`diffrax.SPaRK`][] is the recommended choice.
84
+
- If the noise is commutative, then [`diffrax.SlowRK`][] has the best order of convergence, but is expensive per step. [`diffrax.StratonovichMilstein`][] is a good cheaper alternative.
88
85
89
-
In this case the Itô solution and the Stratonovich solution coincide, and mathematically speaking the choice of Itô vs Stratonovich is unimportant. Special solvers for additive-noise SDEs tend to do particularly well as compared to the general Itô or Stratonovich solvers discussed above.
86
+
### More information about SDE solvers
90
87
91
-
- The cheapest (but least accurate) solver is [`diffrax.SEA`][].
92
-
- Otherwise [`diffrax.ShARK`][] or [`diffrax.SRA1`][] are good choices.
88
+
A detailed example of how to simulate SDEs can be found in the [SDE example](../examples/sde_example.ipynb).
89
+
A table of all SDE solvers and their properties can be found in [SDE solver table](../devdocs/SDE_solver_table.md).
0 commit comments