This is a julia package for computing accurate approximations of the time-dependent boundary crossing probability for a general diffusion process. The implemented algorithm is based on a Brownian bridge corrected Markov chain algorithm proposed in:
Liang, V. and Borovkov, K.: On Markov chain approximations for computing boundary crossing probabilities of diffusion processes. J. Appl. Probab. 60 1386–1415 (2023).
For
where we assume
For two continuous functions
More generally, the tool can compute expressions of the form
and
which are known to be probabilistic solutions to the Dirichlet problem for the following parabolic PDEs:
where
It was proved by Liang and Borovkov (2024) that the boundary non-crossing probability functional
The Markov chain approximation can be used to obtain approximations for
To install and import the BoundaryCrossingProbabilities package, run the following at the Julia REPL
using Pkg
Pkg.add(url = "https://github.com/pika-pikachu/BoundaryCrossingProbabilities.jl")
using BoundaryCrossingProbabilities
To set up the boundary crossing probability algorithm, we need to specify parameters of the diffusion process (initial position, drift, diffusion and potential), and the time interval. Let's take the Brownian motion example (
x0 = 0 # Initial condition
μ(t,x) = 0 # Drift coefficient
σ(t,x) = 1 # Diffusion coefficient
V(t,x) = (1im)*x^2 # Potential
T = 1.0 # Terminal Time
Then we set up a Julia Type called MeshParams, which takes in all the diffusion process parameters.
p = BoundaryCrossingProbabilities.MeshParams(
x0, # x0 Initial condition
T, # Terminal time
μ, # Drift coefficient
σ, # Diffusion coefficient
V, # Potential
false, # no target set
[1.2,3], # Target set X_T \in [a,b]
"Brownian", #bridge correction,
false, # one sided boundary
25, # number of time steps
0, # δ, 1/2 + δ is the space step power before the final time
1, # pn power of the space step at the final time
2, # γ, constant space scaling
"trapezoidal" # integration scheme
);
Then we define the upper and lower boundaries
gU(t) = 4 - t^2
gL(t) = -4 + t^2
Now we can obtain the solution to the problem.
plotFlag = true
interpolationFlag = false
non_crossing_probability, v = BoundaryCrossingProbabilities.BKE(p, t -> gU(t), t -> gL(t), interpolationFlag, plotFlag);
#soltn_FKE, u = BoundaryCrossingProbabilities.FKE(p, t -> gU(t), t -> gL(t), interpolationFlag, plotFlag);