A Julia package for computing accurate approximations of curvilinear boundary crossing probabilities for diffusion processes on a finite time interval. The implemented algorithm in this package is based on the Brownian bridge corrected Markov chain approximation proposed in:
Authors
- Vincent Liang, The University of Melbourne
- Konstantin Borovkov, The University of Melbourne
For
where we assume
For two continuous functions
More generally, the package can be used to compute Feynman-Kac type expectations of the form
and
which are known to be probabilistic solutions to the Dirichlet problem for the following parabolic partial differential equations:
where
To install and import the BoundaryCrossingProbabilities package, run the following in the Julia REPL:
using Pkg
Pkg.add(url = "https://github.com/pika-pikachu/BoundaryCrossingProbabilities.jl")
using BoundaryCrossingProbabilities
In 1969, the statistician H. Daniels applied the method of images to obtain a closed-form expression for the boundary-crossing probability of the Brownian motion for a particular one-sided time-dependent boundary, now commonly known as the Daniels boundary,
gU(t) = 1/2 - t * log(0.25 * (1 + sqrt(1 + 8*exp(-1/t))))
gL(t) = -3.75 # Assume -3.75 is sufficiently remote from initial position.
Next, we 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) = 0 # Potential
T = 1.0 # Terminal time
Next, we set up a Julia Type called MeshParams, which takes in all the parameters to be used in the algorithm.
p = BoundaryCrossingProbabilities.MeshParams(
x0, # Initial condition
T, # Terminal time
μ, # Drift coefficient
σ, # Diffusion coefficient
V, # Potential
false, # Target set
[1.2,3], # Target set X_T \in [a,b]
"Brownian", # bridge correction,
true, # One sided boundary flag
40, # Number of time steps n
0, # δ, 1/2 + δ is the space step power before the final time
1, # pn power of the space step at the final time
1.5, # γ, space scaling
"trapezoidal" # Integration scheme
);
Now we can run the algorithm with the following lines of code.
plotFlag = false
interpolationFlag = false
taboo_transition_density = BoundaryCrossingProbabilities.FKE(p, t -> gU(t), t -> gL(t), interpolationFlag, plotFlag);
boundary_crossing_probability = 1 - sum(taboo_transition_density)
which returns
0.47978213105150136 - 0.0im
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 and Markov chain approximation 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);
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