BoundaryCrossingProbabilities
Computes the boundary crossing probability for a general diffusion process and time-dependent boundary.
https://github.com/pika-pikachu/boundarycrossingprobabilities.jl
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 4 DOI reference(s) in README -
✓Academic publication links
Links to: scholar.google -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (7.6%) to scientific vocabulary
Keywords
Repository
Computes the boundary crossing probability for a general diffusion process and time-dependent boundary.
Basic Info
- Host: GitHub
- Owner: pika-pikachu
- License: gpl-3.0
- Language: Julia
- Default Branch: main
- Homepage: https://arxiv.org/abs/2112.05268
- Size: 1.31 MB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
- Releases: 0
Topics
Metadata Files
README.md
BoundaryCrossingProbabilities.jl
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
Boundary crossing probabilities for diffusion processes with time-dependent boundaries
For $T>0,$ $x_0 \in \mathbb{R},$ let $X$ be a solution to the following stochastic differential equation (SDE):
$$ \begin{cases} dXt = \mu(t,Xt)dt +\sigma(t,Xt)dWt, \quad t \in (0,T),\ X0 = x0. \end{cases}$$
where we assume $\mu$ and $\sigma$ satisfy the usual sufficient for the existence and uniqueness of a strong solution to the above SDE.
For two continuous functions $g-$ and $g+,$ this package computes an approximation of the non-crossing probability
$$ F(g-,g+) := \mathbf{P}(g-(t) < Xt < g_+(t) , t\in [0,T]). $$
More generally, the package can be used to compute Feynman-Kac type expectations of the form
$$ v(t,x) = \mathbf{E}[e^{-\intt^TV(s,Xs)\,ds}\psi(XT);g{-}(s) < Xs < g+(s), s \in [t,T] | X_t = x], $$
and
$$ u(t,x) = \frac{\partial}{\partial x}\mathbf{E}[e^{-\int0^tV(s,Xs)\,ds} ; Xt \leq x, g{-}(s) < Xs < g+(s), s \in [0,t]|X0 = x0], $$
which are known to be probabilistic solutions to the Dirichlet problem for the following parabolic partial differential equations:
$$ Lv = 0, \quad v(t,g_{\pm}(t)) =0, \quad v(T,x)= \psi(x), $$
$$ L^*u = 0, \quad u(t,g{\pm}(t)) =0, \quad u(0,x)= \delta{x_0}(x), $$
where
$$ L f(s,x) := \partialsf(s,x) - V(s,x)f(s,x) + \mu(s,x) \partialxf(s,x) + \frac{1}{2}\sigma^2(s,x) \partial_{xx}f(s,x).$$
Code tutorial
Installation
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
Example 1: Daniels boundary
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,
$$ g(t) = \frac{1}{2} - t \log\left( \frac{1}{4}\left(1 + \sqrt{1 + 8e^{-1/t}}\right) \right),\quad t>0. $$
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 ($\mu \equiv 0,$ $\sigma \equiv 1$).
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
Example 2: Complex potential
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 ($\mu \equiv 0,$ $\sigma \equiv 1$) with a complex potential term $V(t,x):= ix^2$.
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
noncrossingprobability, 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);
```

Sensitivity of boundary crossing probabilities with respect to boundary perturbations
It was proved by Liang and Borovkov (2024) that the boundary non-crossing probability functional $F(g) := F(-\infty,g)$ is Gateaux differentiable and the derivative admits the following representation:
$$ \nablah F(g) := \lim{\varepsilon \to 0}\frac{F(g+\varepsilon h) -F(g) }{\varepsilon} = -\int0^T h(t)v'(t,g(t))f{\tau}(t)dt,\quad h \in H, \quad g \in C^2.$$
The Markov chain approximation can be used to obtain approximations for $v'(t,g(t))$ and $f_{\tau}(t)$ for all $t \in [0,T].$
Owner
- Name: Vincent L.
- Login: pika-pikachu
- Kind: user
- Repositories: 1
- Profile: https://github.com/pika-pikachu
Citation (CITATION.cff)
cff-version: 1.0.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Liang"
given-names: "Vincent"
orcid: "https://orcid.org/0009-0009-3524-9598"
- family-names: "Borovokov"
given-names: "Konstantin"
orcid: "https://orcid.org/0000-0003-1258-7120"
title: "On Markov chain approximations for computing boundary crossing probabilities of diffusion processes"
version: 1.0.0
doi: 10.1017/jpr.2023.11
date-released: 2023-12-18
url: "https://github.com/pika-pikachu/BoundaryCrossingProbabilities.jl"
preferred-citation:
type: article
authors:
- family-names: "Liang"
given-names: "Vincent"
orcid: "https://orcid.org/0009-0009-3524-9598"
- family-names: "Borovkov"
given-names: "Konstantin"
orcid: "https://orcid.org/0000-0003-1258-7120"
doi: "10.1017/jpr.2023.11"
journal: "Journal of Applied Probability"
month: 12
start: 1386 # First page number
end: 1415 # Last page number
title: "On Markov chain approximations for computing boundary crossing probabilities of diffusion processes"
issue: 60
volume: 4
year: 2023
GitHub Events
Total
- Push event: 9
Last Year
- Push event: 9
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 10.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
- Total downloads: unknown
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 1
juliahub.com: BoundaryCrossingProbabilities
Computes the boundary crossing probability for a general diffusion process and time-dependent boundary.
- Homepage: https://arxiv.org/abs/2112.05268
- Documentation: https://docs.juliahub.com/General/BoundaryCrossingProbabilities/stable/
- License: GPL-3.0
-
Latest release: 1.0.0
published almost 2 years ago