Skip to content

Commit a1cc13a

Browse files
Merge pull request #777 from prbzrg/Add-AlgorithmInterpretation
add `AlgorithmInterpretation`
2 parents c0c6008 + 4bf01f7 commit a1cc13a

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/alg_traits.jl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,17 +244,24 @@ function alg_order(alg::AbstractODEAlgorithm)
244244
error("Order is not defined for this algorithm")
245245
end
246246

247+
EnumX.@enumx AlgorithmInterpretation Ito Stratonovich
248+
247249
"""
248-
Integral interpolation for the SDE solver algorithm. SDEs solutions depend on the chosen definition of the stochastic integral. In the Ito calculus,
249-
the left-hand rule is taken, while Stratonovich calculus uses the right-hand rule. Unlike in standard Riemannian integration, these integral rules do
250-
not converge to the same answer. In the context of a stochastic differential equation, the underlying solution (and its mean, variance, etc.) is dependent
251-
on the integral rule that is chosen. This trait describes which interpretation the solver algorithm subscribes to, and thus whether the solution should
250+
alg_interpretation(alg)
251+
252+
Integral interpolation for the SDE solver algorithm. SDEs solutions depend on the chosen definition of the stochastic integral. In the Ito calculus,
253+
the left-hand rule is taken, while Stratonovich calculus uses the right-hand rule. Unlike in standard Riemannian integration, these integral rules do
254+
not converge to the same answer. In the context of a stochastic differential equation, the underlying solution (and its mean, variance, etc.) is dependent
255+
on the integral rule that is chosen. This trait describes which interpretation the solver algorithm subscribes to, and thus whether the solution should
252256
be interpretated as the solution to the SDE under the Ito or Stratonovich interpretation.
253257
254258
For more information, see https://oatml.cs.ox.ac.uk/blog/2022/03/22/ito-strat.html as a good high-level explanation.
255259
256260
!!! note
257-
The expected solution statistics are dependent on this output. Solutions from solvers with different
261+
262+
The expected solution statistics are dependent on this output. Solutions from solvers with different
258263
interpretations are expected to have different answers on almost all SDEs without additive noise.
259264
"""
260-
function alg_interpretation end
265+
function alg_interpretation(alg::AbstractSciMLAlgorithm)
266+
error("Algorithm interpretation is not defined for this algorithm. It can be either `AlgorithmInterpretation.Ito` or `AlgorithmInterpretation.Stratonovich`")
267+
end

0 commit comments

Comments
 (0)