The Levy area algorithms of StochasticDiffEqLevyArea: Fourier() (the
plain truncated Fourier series, error order 1/2 in the number of terms),
Milstein() (with Milstein's Gaussian tail approximation, order 1/2),
Wiktorsson() (Wiktorsson's tail sum correction, order 1) and MronRoe()
(the Mrongowius and Roessler correction, order 1). MaxL2() and
FrobeniusL2() are the error norms used to choose the number of terms.
Usage
AbstractIteratedIntegralAlgorithm
AbstractErrorNorm
Fourier()
Milstein()
Wiktorsson()
MronRoe()
MaxL2()
FrobeniusL2()
terms_needed(dim, stepsize, eps, alg, norm, q_12 = NULL)
optimal_algorithm(
dim,
stepsize,
eps = stepsize^(3/2),
norm = NULL,
q_12 = NULL
)
coefficient_length(m, n, alg)
LevyAreaCoefficients(X, Y, tail, m, n)
generate_coefficients(m, n, alg, rng = NULL)
levyarea(W, n, alg, coeffs = NULL, rng = NULL)
iterated_integrals(
W,
h,
eps = NULL,
ito_correction = TRUE,
error_norm = NULL,
alg = NULL,
rng = NULL,
q_12 = NULL
)
reconstruct_path(dW, h, coeffs, t_points)
iterated_integrals_subinterval(
dW,
h,
coeffs,
t_start,
t_end,
n_quadrature = 64L,
ito_correction = TRUE
)Arguments
- dim, m
Dimension of the Wiener process.
- eps
Error bound, or a
LevyAreaCoefficients()object.- alg
A Levy area algorithm.
- q_12
Square roots of the covariance eigenvalues of a Q-Wiener process.
- n
Number of Fourier terms.
- X, Y, tail
The Fourier coefficient matrices and the tail random numbers.
- rng
NULL(R's generator) or a function ofnreturningnstandard normal numbers.- W
A Wiener increment (normalized for
levyarea()).- coeffs
A
LevyAreaCoefficients()object.- h, stepsize
Step size.
- ito_correction
Ito (
TRUE) or Stratonovich (FALSE) integrals.- error_norm, norm
An error norm.
- dW
The Wiener increment over the step.
- t_points
Times in
[0, h].- t_start, t_end
The sub-interval of the step.
- n_quadrature
Number of Riemann sum points.
Details
levyarea(W, n, alg) approximates the antisymmetric Levy area matrix of
the normalized Wiener increment W (the increment over the step divided by
the square root of the step) with n Fourier terms. The random numbers
come from coeffs, a LevyAreaCoefficients() object, when given (a
deterministic computation), and are otherwise drawn as
generate_coefficients() draws them.
iterated_integrals(W, h, eps) simulates the matrix of iterated integrals
of the increment W over a step h with error at most eps (default
h^(3/2)) in the norm error_norm, with the algorithm of fewest random
numbers unless alg is given; ito_correction = TRUE gives Ito
integrals, FALSE Stratonovich ones. Passing coefficients as eps uses
them (with MronRoe() by default); q_12 gives the square roots of the
covariance eigenvalues of a Q-Wiener process. A scalar W gives the exact
integral W^2 / 2 (minus h / 2 for Ito).
terms_needed(dim, stepsize, eps, alg, norm) is the number of Fourier
terms for an error at most eps, optimal_algorithm(dim, stepsize, eps, norm) the algorithm needing the fewest random numbers and
coefficient_length(m, n, alg) the number of random numbers of an
algorithm. reconstruct_path(dW, h, coeffs, t_points) evaluates the
Brownian path of the Fourier expansion at times inside the step and
iterated_integrals_subinterval(dW, h, coeffs, t_start, t_end) the
iterated integrals over a part of the step, by a Riemann sum over
n_quadrature points of the reconstructed path.
AbstractIteratedIntegralAlgorithm and AbstractErrorNorm are the class
names of the algorithms and error norms.
Examples
W <- c(0.3, -0.7, 1.1)
cf <- generate_coefficients(3, 4, MronRoe())
levyarea(W, 4, MronRoe(), cf)
#> [,1] [,2] [,3]
#> [1,] 0.0000000 0.1351927 -0.3665144
#> [2,] -0.1351927 0.0000000 -0.5838942
#> [3,] 0.3665144 0.5838942 0.0000000
iterated_integrals(W * sqrt(0.01), 0.01, cf)
#> [,1] [,2] [,3]
#> [1,] -0.004550000 0.0003019265 -0.002015144
#> [2,] -0.002401927 -0.0025500000 -0.009688942
#> [3,] 0.005315144 0.0019889423 0.001050000
terms_needed(3, 0.01, 0.01^1.5, Fourier(), MaxL2())
#> [1] 16
optimal_algorithm(3, 0.01)
#> MronRoe()