Iterated Stochastic Integrals in Julia
This package implements state-of-the-art methods for the simulation of iterated stochastic integrals. These appear e.g. in higher order algorithms for the solution of stochastic (partial) differential equations.
This package can be installed from the Julia package manager (type ])
pkg> add LevyArea
Load the package and generate a Wiener increment:
julia> using LevyArea
julia> m = 5; # dimension of Wiener process
julia> h = 0.01; # step size or length of time interval
julia> err = 0.05; # error bound
julia> W = sqrt(h) * randn(m); # increment of Wiener process
Here,
The default call uses h^(3/2) as the precision and chooses the best algorithm automatically:
julia> II = iterated_integrals(W,h)
If not stated otherwise, the default error criterion is the II
containing a realisation
of the approximate iterated stochastic integrals that correspond
to the given increment
The desired precision can be optionally provided using a third positional argument:
julia> II = iterated_integrals(W,h,err)
Again, the software package automatically chooses the optimal algorithm.
To determine which algorithm is chosen by the package without simulating any iterated
stochastic integrals yet, the function optimal_algorithm
can
be used. The arguments to this function are the dimension of the Wiener
process, the step size and the desired precision:
julia> alg = optimal_algorithm(m,h,err); # output: Fourier()
It is also possible to choose the algorithm directly using the
keyword argument alg
. The value can be one of
Fourier()
, Milstein()
, Wiktorsson()
and MronRoe()
:
julia> II = iterated_integrals(W,h; alg=Milstein())
As the norm for the considered error, e.g., the MaxL2()
and FrobeniusL2()
:
julia> II = iterated_integrals(W,h,err; error_norm=FrobeniusL2())
If iterated stochastic integrals for some
julia> q = [1/k^2 for k=1:m]; # eigenvalues of cov. operator
julia> QW = sqrt(h) * sqrt.(q) .* randn(m); # Q-Wiener increment
julia> IIQ = iterated_integrals(QW,sqrt.(q),h,err)
In this case, the function iterated_integrals
utilizes a
scaling of the iterated stochastic integrals and also adjusts the error
estimates appropriately such that the error bound holds w.r.t.\ the
iterated stochastic integrals
Note that all discussed keyword arguments are optional and can be combined as needed.
Additional information can be found, e.g., using the Julia help mode:
julia> ?iterated_integrals
julia> ?optimal_algorithm
or by reading the documentation.
Please cite this package and/or the accompanying paper if you found this package useful. Example BibLaTeX code can be found in the CITATION.bib file.
A Matlab version of this package is also available under LevyArea.m.