Here's the probability (I think) that a particle in Brownian motion (w/ standard deviation $\sqrt{t}$) will exceed $m$ between times $t_1$ and $t_2$:
$$\frac1{2\sqrt{2\pi}}\int_{-\infty }^m \frac1{\sqrt{t_1}}e^{-\frac{x^2}{2t_1}}\left(1+\mathrm{erf}\left(\frac{m-x}{2\sqrt{t_2-t_1}}\right)\right)\mathrm{d}x$$
or, in Mathematica (slightly different form):
p[m_,t1_,t2_] := Integrate[
PDF[NormalDistribution[0,Sqrt[t1]]][x]*
CDF[NormalDistribution[x, Sqrt[2]*Sqrt[t2-t1]]][m],
{x,-Infinity,m}, Assumptions -> {
t2 >= t1 >= 0, Element[m,Reals], Element[t2, Reals], Element[t1, Reals]}
]
Mathematica can numerically integrate this for specific values of m
,
t1
, and t2
, but it's not superfast.
I now want to find the partial derivatives of p[]
with respect to each
of its variables. Ideally in closed-form (Mathematica can't find one),
but a good approximation if not.
I've tried power series and a few other techniques, but I've found
nothing good enough for a wide range of values for m
, t1
, and t2
.
Solving this problem will calculate the "Greeks" for box options:
https://money.stackexchange.com/questions/4312/calculating-fair-value-of-an-oanda-com-box-option