Iterated integral evaluators of the SDE solvers
Source:R/stochastic-levyarea.R
iterated_integral_evaluators.RdHigher order SDE solvers need the Stratonovich iterated integrals J of
the Wiener increment. An algorithm chooses how to approximate them with an
IteratedIntegralApprox: IICommutative() assumes commutative noise, so
the integrals are dW dW' / 2, and IILevyArea() approximates the Levy
areas with the algorithm of optimal_algorithm(). get_Jalg(dW, dt, prob, alg) turns that choice (the ii_approx of alg) and the noise of the
problem into an evaluator: JDiagonal_oop() (dW^2 / 2 for diagonal or
scalar noise), JCommute_oop() (dW dW' / 2), a Levy area algorithm, or
their in place counterparts JDiagonal_iip(dW), JCommute_iip(dW) and
IteratedIntegralAlgorithm_iip(dW, levyalg), which keep the result in
their field J. get_iterated_I(dt, dW, dZ, alg, p, c, gamma) evaluates
it (get_iterated_I! in Julia, for the in place evaluators); with a Levy
area algorithm p terms are used, by default the number for the error
c * dt^(gamma + 1/2), and the random numbers come from coeffs or
rng as in levyarea().
Usage
IteratedIntegralApprox
IICommutative()
IILevyArea()
JDiagonal_oop()
JDiagonal_iip(dW)
JCommute_oop()
JCommute_iip(dW)
IteratedIntegralAlgorithm_iip(dW, levyalg)
get_iterated_I(
dt,
dW,
dZ,
alg,
p = NULL,
c = 1,
gamma = 1,
coeffs = NULL,
rng = NULL
)
get_Jalg(dW, dt, prob, alg)Arguments
- dW
The Wiener increment.
- levyalg
A Levy area algorithm.
- dt
The step size.
- dZ
The second increment (unused by these evaluators).
- alg
An evaluator, or for
get_Jalg()an SDE algorithm with anii_approx.- p
Number of Levy area terms, or
NULL.- c, gamma
Constant and exponent of the error target.
- coeffs, rng
Random numbers of a Levy area algorithm, see
levyarea().- prob
An SDE problem.
Value
An approximation choice, an evaluator, or the matrix (vector for diagonal noise) of iterated integrals.
Examples
dW <- c(0.1, -0.2)
get_iterated_I(0.01, dW, NULL, JCommute_oop())
#> [,1] [,2]
#> [1,] 0.005 -0.01
#> [2,] -0.010 0.02
J <- JDiagonal_iip(dW)
get_iterated_I(0.01, dW, NULL, J)
#> [1] 0.005 0.020
J$J
#> [1] 0.005 0.020
IILevyArea()
#> IILevyArea()