Skip to content

Commit faeb05f

Browse files
committed
add AlgorithmInterpretation
1 parent c0c6008 commit faeb05f

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/SciMLBase.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,4 +839,6 @@ export ContinuousCallback, DiscreteCallback, CallbackSet, VectorContinuousCallba
839839

840840
export Clocks, TimeDomain, is_discrete_time_domain, isclock, issolverstepclock, iscontinuous
841841

842+
export AlgorithmInterpretation
843+
842844
end

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)