1 Introduction

Let T > 0 be a fixed real number and let S(t), t ∈ [0,T], be a Gaussian process with mean 0 and covariance

$$ \mathbb{E} S(t)S(t^{\prime})=\max\{0,1-|t-t^{\prime}|\} . $$

This process is often called Slepian process and can be expressed in terms of the standard Brownian motion W(t) by

$$ \begin{array}{@{}rcl@{}} S(t)=W(t)-W(t+1), t\ge 0. \end{array} $$
(1.1)

Let a and b be fixed real numbers and x < a. We are interested in an explicit formula for the first-passage probability

$$ \begin{array}{@{}rcl@{}} F_{a,b}(T | x) := \text{Pr}(S(t)<a+bt \text{ for all } t\in[0,T] | S(0)=x); \end{array} $$
(1.2)

note Fa,b(T|x) = 0 for xa.

The case of a constant barrier, when b = 0, has attracted significant attention in literature. In his seminal paper Slepian (1961), D.Slepian has shown how to derive an explicit expression for Fa,0(T|x) in the case T ≤ 1; see also Mehr and McFadden (1965). The case T > 1 is much more complicated than the case T ≤ 1. Explicit formulas for Fa,0(T|x) with general T were derived in Shepp (1971); these formulas are special cases of results formulated in Section 2. We believe our paper can be considered as a natural extension of the methodology developed in Slepian (1961) and Shepp (1971); hence the title of this paper.

In the case T ≤ 1, Slepian’s method for deriving formulas for Fa,0(T|x) can be easily extended to the case of a general linear barrier. An explicit formula for the first-passage probability Fa,b(T|x) was first derived in Zhigljavsky and Kraskovsky (1988, p. 81) (published in Russian) and more than 20 years later it was independently derived in Bischoff and Gegg (2016) and Deng (2017). In Zhigljavsky and Kraskovsky (1988), the first-passage probability Fa,b(T|x) for T ≤ 1 was obtained by using the fact that S(t) is a conditionally Markov process on the interval [0,1]. It was shown in Mehr and McFadden (1965) that after conditioning on S(0) = x, S(t) can be expressed in terms of the Brownian motion by S(t) = (2 − t)W(g(t)) + x(1 − t) (0 ≤ t ≤ 1) with g(t) = t/(2 − t). Consequently, the first-passage probabilities for S(t), t ∈ [0,T] with T ≤ 1 can be obtained using first-passage formulas for the Brownian motion. This methodology, like many others, fails for T > 1.

For general T > 0, including the case T > 1, explicit formulas for Fa,b(T|x) were unknown. Derivation of these formulas is the main objective of this paper. To do this, we generalise the methodology of Shepp (1971). The principal distinction between Shepp’s methodology and our results is the use of an alternative way of computing coincidence probabilities. Shepp’s proofs heavily rely on the so-called Karlin-McGregor identity, see Karlin and McGregor (1959); we use an extension of this identity formulated in Katori (2011) and discussed in Section 2.1.

The Karlin-McGregor identity has many deep implications in probability. In Katori (2011) and Katori and Tanemura (2010), the identity was used to show a connection between n independent Brownian motion processes conditioned to never collide and eigenvalues of random matrices. More specifically, if X(t) represents a system of n independent Brownian motions starting from the origin and conditioned never to collide with each other, then the distribution of X(t) can be obtained using the probability density of eigenvalues of random matrices in the Gaussian Unitary Ensemble, also see Katori et al. (2004) and Katori and Tanemura (2002). Moreover, if an appropriate initial distribution of X(t) is used, then it can be shown that non-colliding Brownian motion is a determinantal process; by this, we mean that any joint transition density can be expressed by a determinant of a matrix kernel, see Katori and Tanemura (2007). In Böhm and Mohanty (1997), after a slight generalisation of the Karlin-McGregor identity (a generalisation different to the one used in this paper), the authors show applications in queuing theory. Another important application of the Karlin-McGregor identity deals with finding boundary crossing probabilities for various scan statistics, see Naus (1982), Glaz et al. (2009), and Noonan and Zhigljavsky (2020).

The structure of the paper is as follows. In Section 2.2, we provide an expression for Fa,b(T|x) for integer T and in Section 2.4 we extend the results for non-integer T. In Sections 3 and 4, we extend the results to the case of piecewise-linear barriers. In Section 5, we outline an application to a change-point detection problem; this application was our main motivation for this research. In the A, we provide detailed proofs of all theorems.

2 Linear barrier a + b t

The key result of this section is Theorem 1, where an explicit formula is derived for the first-passage probability Fa,b(T|x) defined in Eq. 1.2 under the assumption that T is a positive integer, T = n. First, we formulate a lemma that is key to the advances of this paper and can be obtained from Katori (2011, p. 5) or Katori (2012, p.40). In this lemma, we use the notation

$$ \begin{array}{@{}rcl@{}} \varphi_s(z) := \frac{1}{\sqrt{2\pi s} }e^{-z^2/(2s)} \end{array} $$
(2.1)

for the normal density with variance s. For the standard Brownian motion process W(t), φs(ac)dc = Pr(W(s) ∈ dc|W(0) = a) is the transition probability. We shall also use

$$ \mathbb{W}_{n+1} = \{ \boldsymbol{x}=(x_{0}, \ldots, x_{n})^{\prime}\in\mathbb{R}^{n+1} : x_{0}<x_{1}<\ldots<x_{n} \} $$

for the so-called Weyl chamber of type An, see Fulton and Harris (2013) for details.

2.1 An important auxiliary result

Lemma 1

(From Katori 2011, p. 5) For any s > 0 and a positive integer n, let Wμ(t) := (W0(t),W1(t),…,Wn(t)), t ∈ [0,s], be an (n + 1)-dimensional Brownian motion process with drift \(\boldsymbol {\mu }=(\mu _{0},\mu _{1},\ldots ,\mu _{n})^{\prime }\). Then

$$ \begin{array}{@{}rcl@{}} \text{Pr}\left\{ \boldsymbol{W}^{\boldsymbol{\mu}}(t) \in \mathbb{W}_{n+1} \forall t \in [0,s],\!\! \boldsymbol{W}^{\boldsymbol{\mu}}(s)\in \boldsymbol{dc} | \boldsymbol{W}^{\boldsymbol{\mu}}(0) =\mathbf{a} \right\} \\ = \exp\left( -\frac{s}{2}\|\boldsymbol{\mu}\|^2+\boldsymbol{\mu}^{\prime}(\mathbf{c}-\mathbf{a}) \right)\det\left[\varphi_{s}({a}_{i}-{c}_{j}) \right]_{i,j=0}^n dc_{0} dc_{1}{\ldots} dc_n \end{array} $$
(2.2)

where ∥⋅∥ denotes the Euclidean norm, \(\mathbf {a}=(a_{0},a_{1},\ldots ,a_{n})^{\prime }\in \mathbb {W}_{n+1}, \mathbf {c}=(c_{0},\) \(c_{1},\ldots ,c_{n})^{\prime } \in \mathbb {W}_{n+1}\) and dc = (dc0,…,dcn), where dc0,…,dcn are infinitesimal intervals around c0,…,cn.

Lemma 1 is an extension of the Karlin-McGregor identity of (1959), when applied specifically to the Brownian motion, and accommodates for different drift parameters μi of Wi(t).

Corollary 1

Under the same assumptions as Lemma 1, we have

$$ \begin{array}{@{}rcl@{}} &&\!\!\!\!\!\!\!\!\!\!\!\!\text{Pr}\left\{ \boldsymbol{W}^{\boldsymbol{\mu}}(t) \in \mathbb{W}_{n+1} \forall t \in [0,s]\!\! | \boldsymbol{W}^{\boldsymbol{\mu}}(0) =\mathbf{a}, \boldsymbol{W}^{\boldsymbol{\mu}}(s) = \boldsymbol{c}\right\} \\ &&\!\!\!\!\!\!\!\!\!\!\!\!= \exp\left( -\frac{s}{2}\|\boldsymbol{\mu}\|^{2} + \boldsymbol{\mu}^{\prime}(\mathbf{c}-\mathbf{a}) \right)\det\left[\varphi_{s}({a}_i-{c}_{j}) \right]_{i,j=0}^{n}/{\prod}_{i=0}^{n}\varphi_s({a}_i - {c}_i + {\mu}_is). \end{array} $$
(2.3)

Proof

Denote the transition density for the process Wi(t) by \({\varphi _{s,\mu _{i}}(a-c)}\); that is, \({\varphi _{s,\mu _{i}}(a-c)dc}=\text {Pr}(W_{i}(s)\in dc | W_{i}(0)=a)\). Using the relation \(\varphi _{s,\mu _{i}}(a-c)=\varphi _{s}(a-c+\mu _{i}s)\) and dividing both sides of Eq. 2.2 by Pr(Wμ(s) ∈dc|Wμ(0) = a), we obtain the result. □

2.2 Linear barrier a + b t with integer T

Let φ(t) = φ1(t) and \(\varPhi (t)={\int \limits }_{-\infty }^{t} \varphi (u)du\) be the density and the c.d.f. of the standard normal distribution. Assume that T = n is a positive integer. Define (n + 1)-dimensional vectors

$$ \boldsymbol{\mu} = \left[ \begin{array}{c} 0 \\ b\\ 2b\\ {\vdots} \\ nb \end{array}\right], \mathbf{a} = \left[ \begin{array}{c} 0 \\ x_{1} + a\\ x_{2} + 2a + b\\ {\vdots} \\ x_{n} + na + \frac{(n-1)n}{2}b \end{array}\right], \mathbf{c} = \left[ \begin{array}{c} x_{1} \\ x_{2} + a + b\\ x_{3} + 2a + 3b\\ {\vdots} \\ x_{n+1} + (a + b)n + \frac{(n-1)n}{2}b \end{array}\right] $$
(2.4)

and let μi, ai and ci be i-th components of vectors μ, a and c respectively (i = 0,1,…,n). Note that we start the indexation of vector components at 0.

Theorem 1

For any integer n ≥ 1 and x < a,

$$ \begin{array}{@{}rcl@{}} F_{a,b}(n | x) &=&\frac{1}{\varphi(x)} {\int}_{-x-a-b}^{\infty}{\int}_{x_{2}-a-2b}^{\infty}{\ldots} {\int}_{x_n-a-nb}^{\infty}\exp(-\|\boldsymbol{\mu}\|^2/2 + \boldsymbol{\mu}^{\prime}(\mathbf{c}-\mathbf{a})) \\ &&\times\det\left[\varphi({a}_i-{c}_{j}) \right]_{i,j=0}^n dx_{n+1} dx_{n}\!{\ldots} dx_{2} , \end{array} $$
(2.5)

where μ, a and c are given in Eq. 2.4.

Theorem 1 is a special case of Theorem 3 with (using the notation of Theorem 3) n = T and \(T^{\prime }=0\). Theorem 1 is formulated as a separate theorem as it is the first natural extension of Shepp’s results of (1971). Indeed, if b = 0 then μ = 0 and Eq. 2.5 coincides with Shepp’s formula (2.15) in (1971) expressed in the variables yi = xi + ia (i = 0,1,…,n).

2.3 An alternative representation of formula (2.5)

It is easier to interpret Theorem 1 by expressing the integrals in terms of the values of S(t) at times t = 0,1,…,n. Let x0 = 0,x1 = −x. For i = 0,1,…,n we set si = xixi+ 1 with s0 = x. It follows from the proof of Eq. 2.5, see Appendix A, that s0,s1,…,sn have the meaning of the values of the process S(t) at times t = 0,1,…,n; that is, S(i) = si (i = 0,1,…,n). The range of the variables si in Eq. 2.5 is \((-\infty ,a+bi)\), for i = 0,1,…,n. The variables x1,…,xn+ 1 are expressed via s0,…,sn by xk = −s0s1 −… − sk− 1 (k = 1,…,n + 1) with x0 = 0. Changing the variables, we obtain the following equivalent expression for the probability Fa,b(n|x):

$$ \begin{array}{@{}rcl@{}} F_{a,b}(n | x) &=&\frac{1}{\varphi(x)} {\int}_{-\infty}^{a+b}{\int}_{-\infty}^{a+2b} {\cdots} {\int}_{-\infty}^{a+bn}\exp(-\|\boldsymbol{\mu}\|^2/2 + \boldsymbol{\mu}^{\prime}(\mathbf{c}-\mathbf{a})) \\ &&\times\det\left[\varphi({a}_i-{c}_{j}) \right]_{i,j=0}^n ds_{n}\!{\ldots} ds_{2}ds_{1} , \end{array} $$

where μ is given by Eq. 2.4 but expressions for a and c change:

$$ \begin{array}{@{}rcl@{}} \mathbf{a} = \begin{bmatrix} 0 \\ \!a - s_{0}\\ 2a + b - s_{0} - s_{1}\\ {\vdots} \\ \mathit{na} + \frac{(n-1)n}{2}b - s_{0} - s_{1} - \ldots - s_{n-1} \end{bmatrix}\!, \mathbf{c} = \begin{bmatrix} -s_{0} \\ a + b - s_{0} - s_{1}\\ 2a + 3b - s_{0} - s_{1} - s_{2}\\ {\vdots} \\ (a + b)n + \frac{(n-1)n}{2}b - s_{0} - s_{1} - \ldots - s_{n} \end{bmatrix}. \end{array} $$

In a particular case of n = 1 we obtain:

$$ \begin{array}{@{}rcl@{}} F_{a,b}(1 | x)\!&=&\!\frac{1}{\varphi(x)}{\int}_{-\infty}^{a+b}\exp(-b^2/2 + b(b - s_{1}))\det\begin{bmatrix} \varphi(x) & \varphi(x+s_{1}-a-b) \\ \varphi(a) & \varphi(s_{1}-b) \\ \end{bmatrix} ds_{1} \\ &=&\!\varPhi(a+b)-\exp\left( -(a^2-x^2)/2-b(a-x) \right)\varPhi(x+b), \end{array} $$
(2.6)

which agrees with results in Zhigljavsky and Kraskovsky (1988), Bischoff and Gegg (2016), and Deng (2017).

2.4 Linear barrier a + b t with non-integer T

In this section, we shall provide an explicit formula for the first-passage probability Fa,b(T|x) defined in Eq. 1.2 assuming T > 0 is not an integer. Represent T as T = m + 𝜃, where m = ⌊T⌋≥ 0 is the integer part of T and 0 < 𝜃 < 1. Set n = m + 1 = ⌈T⌉.

Let φ𝜃(t) and φ1−𝜃(t) be as defined in Eq. 2.1. Define the (n + 1)- and n-dimensional vectors as follows: μ1 = μ is as defined in Eq. 2.4,

$$ \begin{array}{@{}rcl@{}} {\mathbf{a}_{1}} = \begin{bmatrix} 0 \\ u_{1} + a\\ u_{2} + 2a + b\\ {\vdots} \\ u_{n} + na + \frac{n(n-1)}{2}b \end{bmatrix}, \mathbf{c}_{1} = \begin{bmatrix} v_{0}\\ v_{1} + a + b\theta \\ v_{2} + 2(a + b\theta) + b\\ {\vdots} \\ v_{n} + n(a + b\theta) + \frac{n(n-1)}{2}b \end{bmatrix}, \end{array} $$
(2.7)
$$ \begin{array}{@{}rcl@{}} \boldsymbol{\mu}_{2} &=& \begin{bmatrix} 0 \\ b\\ 2b\\ {\vdots} \\ mb \end{bmatrix}, \mathbf{a}_{2} = \begin{bmatrix} v_{0} \\ v_{1} + a + b\theta\\ v_{2} + 2(a + b\theta) + b\\ {\vdots} \\ v_{m} + m(a + b\theta) + \frac{(m-1)m}{2}b \end{bmatrix}, \\ \mathbf{c}_{2} &=& \begin{bmatrix} u_{1}\\ u_{2} + a + b \\ u_{3} + 2a + 3b\\ {\vdots} \\ u_{m+1} + m(a + b) + \frac{(m-1)m}{2}b \end{bmatrix}, \end{array} $$
(2.8)

and let a1i and c1i be i-th components of vectors a1 and c1 respectively (i = 0,1, …,n). Similarly, let a2i and c2i be i-th components of vectors a2 and c2 respectively (i = 0,1,…,m). Recall that we start the indexation of vector components at 0.

Theorem 2

For x < a and non-integer T = m + 𝜃 with 0 < 𝜃 < 1, we have

$$ \begin{array}{@{}rcl@{}} F_{a,b}(T | x) \!&=&\! \frac{1}{\varphi(x)} {\int}_{-x-a-b}^{\infty} \!\cdots\! {\int}_{u_m-a-mb}^{\infty}{\int}_{-\infty}^{\infty}{\int}_{v_0-a-b\theta}^{\infty}\!{\cdots} {\int}_{v_m-a-b\theta -mb}^{\infty}\\ &&\!\!\! \exp(-\theta\|\boldsymbol{\mu}_1\|^2/2 + \boldsymbol{\mu}_{1}^{\prime}(\mathbf{c}_1 - \mathbf{a}_1))\exp(-(1 - \theta)\|\boldsymbol{\mu}_{2}\|^2/2 + \boldsymbol{\mu}_{2}^{\prime}(\mathbf{c}_{2}-\mathbf{a}_{2}))\\ &&\!\!\!\times \det [\varphi_{\theta}({{a}_{1}}_i-{{c}_{1}}_{j} )]_{i,j=0}^n \det [\varphi_{1-\theta}({{a}_{2}}_i-{{c}_{2}}_{j} )]_{i,j=0}^m\\&&\!\!\! dv_{m+1}{\ldots} dv_1dv_0 du_{m+1}{\ldots} du_{2} . \end{array} $$

A proof of Theorem 2 is provided in Appendix A. If b = 0 then the above formula for Fa,b(T|x) coincides with Shepp’s formula (2.25) in Shepp (1971) expressed in variables xi = ui + ia and yi = vi + ia (i = 0,1,…,n). For m = 0 and hence T = 𝜃, Theorem 2 agrees with results in Zhigljavsky and Kraskovsky (1988), Bischoff and Gegg (2016), and Deng (2017).

3 Piecewise linear barrier with one change of slope

3.1 Boundary crossing probability

In this section, we provide an explicit formula for the first-passage probability for S(t) with a continuous piecewise linear barrier, where not more than one change of slope is allowed. For any non-negative \(T,T^{\prime }\) and real \(a,b,b^{\prime }\) we define the piecewise-linear barrier \(B_{T,T^{\prime }}(t;a,b,b^{\prime })\) by

$$ \begin{array}{@{}rcl@{}} B_{T,T^{\prime}}(t;a,b,b^{\prime})= \begin{cases} a+bt & t \in [0,T], \\ a+bT + b^{\prime} (t-T) & t \in [T, T+ T^{\prime}] ; \end{cases} \end{array} $$

for an illustration of this barrier, see Fig. 1. We are interested in finding an expression for the first-passage probability

$$ \begin{array}{@{}rcl@{}} \!\!\!\!\!\!\!\!\mathit{F}_{\mathit{a},\mathit{b},b^{\prime}}(\mathit{T},\mathit{T}^{\prime} | x) \!:=\! \text{Pr}(S(t)\!<\! \mathit{B}_{\mathit{T},\mathit{T}^{\prime}}(t;\mathit{a},\mathit{b},\mathit{b}^{\prime})\text{ for all } t\!\in\![0,\mathit{T} + \mathit{T}^{\prime}] | \mathit{S}(0) = x). \end{array} $$
(3.1)

We only consider the case when both T and \(T^{\prime }\) are integers. The case of general \(T,T^{\prime }\) can be treated similarly but the resulting expressions are much more complicated.

Fig. 1
figure 1

Graphical depiction of a general boundary \(B_{T,T^{\prime }}(t;a,b,b^{\prime })\) with b < 0 and \(b^{\prime }>0\)

Define the \((T+T^{\prime } + 1)\)-dimensional vectors as follows:

$$ \begin{array}{@{}rcl@{}} \!\!\!\!\!\!\!\!\!\boldsymbol{\mu}_{3} = \begin{bmatrix} 0 \\ b\\ 2b\\ \vdots\\ T b\\ b^{\prime} +T b\\ 2b^{\prime} +T b\\ \vdots\\ T^{\prime} b^{\prime} + Tb \end{bmatrix}, \mathbf{a}_{3} = \begin{bmatrix} 0 \\ x_{1}+a\\ x_{2}+2a+b\\ {\vdots} \\ x_{T}+Ta +\frac{(T-1)T}{2}b\\ x_{T+1}+(T+1)a+bT +\frac{(T-1)T}{2}b \\ x_{T+2}+(T+2)a+2bT +b^{\prime}+ \frac{(T-1)T}{2}b \\ {\vdots} \\ x_{T+T^{\prime}}+(T + T^{\prime})a+bT T^{\prime} + \frac{(T^{\prime}-\!1)T^{\prime}}{2}b^{\prime} + \frac{(T-1)T}{2}b \end{bmatrix}, \end{array} $$
(3.2)
$$ \begin{array}{@{}rcl@{}} \!\!\!\!\!\!\!\!\!\mathbf{c}_{3} = \begin{bmatrix} x_{1} \\ x_{2}+a+b\\ x_{3}+2a+3b\\ \vdots\\ x_{T}+(T-1)(a+b)+\frac{(T-2)(T-1)}{2}b\\ x_{T+1}+T(a+b)+\frac{(T-1)T}{2}b\\ x_{T+2}+a(T+1)+bT+ \frac{(T-1)T}{2}b +b^{\prime} +T b\\ {\vdots} \\ x_{T+T^{\prime}+1}+a(T+T^{\prime})+bT T^{\prime} +\frac{(T^{\prime}-\!1)T^{\prime}}{2}b^{\prime}+ \frac{(T-1)T}{2}b+T^{\prime} b^{\prime}+Tb. \end{bmatrix}, \end{array} $$
(3.3)

and let a3i and c3i be i-th components of vectors a3 and c3 respectively (\(i=0,1, \ldots , T+T^{\prime } \)).

Theorem 3

For x < a and any positive integers T and \(T^{\prime }\), we have

$$ \begin{array}{@{}rcl@{}} &&\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! F_{a,b,b^{\prime}}(T,T^{\prime} | x) = \frac{1}{\varphi(x)} {\int}_{-x-a-b}^{\infty}{\int}_{x -a-2b}^{\infty}\!\!{\ldots} {\int}_{x_T-a-bT}^{\infty} {\int}_{x_{T+1}-a-bT-b^{\prime}}^{\infty}\!\!\!\cdots\\&&\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! {\int}_{x_{T+T^{\prime}}-a-bT - b^{\prime} T^{\prime}}^{\infty} \\ &&\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \exp(-\|\boldsymbol{\mu}_3\|^2/2 + \boldsymbol{\mu}_{3}^{\prime}(\mathbf{c}_3-\mathbf{a}_{3})) \det\left[\varphi({{a}_3}_i-{{c}_3}_{j}) \right]_{i,j=0}^{T+T^{\prime}} dx_{T+ T^{\prime}+1}{\ldots} dx_{2} . \end{array} $$
(3.4)

The proof of Theorem 3 is included in the appendix, see Appendix A. Note that if \(b=b^{\prime }\) then Eq. 3.4 reduces to Eq. 2.5 with \(n=T+T^{\prime }\).

3.2 Two particular cases of Theorem 3

Below we consider two particular cases of Theorem 3; first, the barrier is B1,1(t;a,−b,b) with b > 0; second, the barrier is \(B_{1,1}(t;a,0,-b^{\prime })\) with \(b^{\prime }>0\). See Figs. 2 and 3 for a depiction of both barriers. As we demonstrate in Section 5, these cases are important for problems of change-point detection.

Fig. 2
figure 2

Barrier B1,1(t;a,−b,b) with b > 0

Fig. 3
figure 3

Barrier \(B_{1,1}(t;a,0,\!-b^{\prime })\) with \(b^{\prime }\!>\!0\)

For the barrier B1,1(t;a,−b,b), an application of Theorem 3 yields

$$ \begin{array}{@{}rcl@{}} F_{a,-b,b}(1,1 | x) \!&=&\! \frac{e^{b^2/2-bx}}{\varphi(x)} {\int}_{-x-a+b}^{\infty} e^{- bx_{2}} \\ & \!\times&\!\det \begin{bmatrix} \varphi(x) & \varphi(\!-x_{2} - a + b) & \varPhi(\!-x_{2} - a + b) \\ \varphi(a) & \varphi(\!-x - x_{2} + b)& \varPhi(\!-x - x_{2} + b) \\ \varphi(x_{2} + 2a - b + x) & \varphi(a)& \varPhi(a) \\ \end{bmatrix} dx_2 . \end{array} $$
(3.5)

For \(B_{1,1}(t;a,0,-b^{\prime })\), Theorem 3 provides:

$$ \begin{array}{@{}rcl@{}} && F_{a,0,-b^{\prime}}(1,1 | x)\\\!&=&\! \frac{e^{{b^{\prime}}^{2}/2}}{\varphi(x)} {\int}_{-x-a}^{\infty}{\int}_{x_{2}-a+b^{\prime}}^{\infty}e^{-b^{\prime}(x_{3}-x_{2}) } \\ &&\times \det \begin{bmatrix} \varphi(x) & \varphi(-x_{2}-a) & \varphi(-x_{3}-2a+b^{\prime}) \\ \varphi(a) & \varphi(-x-x_{2})& \varphi(-x-x_{3}-a+b^{\prime}) \\ \varphi(x_{2}+2a+x) & \varphi(a)& \varphi(x_{2}-x_{3}+b^{\prime}) \end{bmatrix} dx_{3}dx_{2}.\\ \end{array} $$
(3.6)

4 Piecewise linear barrier with two changes in slope

4.1 Boundary crossing probability

Theorem 3 can be generalized to the case when we have more than one change in slope. In the general case, the formulas for the first-passage probability become very complicated; they are already rather heavy in the case of one change in slope.

In this section, we consider just one particular barrier with two changes in slope. For real \(a,b,b^{\prime },b^{\prime \prime }\), define the barrier \(B(t;a,b,b^{\prime },b^{\prime \prime })\) as

$$ \begin{array}{@{}rcl@{}} B(t;a,b,b^{\prime},b^{\prime\prime})= \begin{cases} a+bt, & t \in [0,1], \\ a+b + b^{\prime} (t-1), & t \in [1,2], \\ a+b + b^{\prime}+ b^{\prime\prime}(t-2), & t \in [2,3] . \end{cases} \end{array} $$

As will be explained in Section 5, the corresponding first-passage probability

$$ \begin{array}{@{}rcl@{}} \!\!\!\!\!\!\!\!\!F_{a,b,b^{\prime},b^{\prime\prime}}(3 | x) \!:=\! \text{Pr}(S(t)\!<\! B(t;a,b,b^{\prime},b^{\prime\prime})\text{ for all } t\in[0,3] | S(0) = x) \end{array} $$
(4.1)

is important for some change-point detection problems.

Define the four-dimensional vectors as follows:

$$ \begin{array}{@{}rcl@{}} \boldsymbol{\mu}_{4} &=& \begin{bmatrix} 0 \\ b\\ b+b^{\prime}\\ b+b^{\prime}+b^{\prime\prime} \end{bmatrix}, \mathbf{a}_{4} = \begin{bmatrix} 0 \\ x_{1}+a\\ x_{2}+2a+b\\ x_{3}+3a+2b+b^{\prime} \end{bmatrix},\\ \mathbf{c}_{4} &=& \begin{bmatrix} x_{1} \\ x_{2}+a+b\\ x_{3}+2a+2b+b^{\prime}\\ x_{4}+3a+3b+2b^{\prime}+b^{\prime\prime} \end{bmatrix} \end{array} $$
(4.2)

and let a4i and c4i be i-th components of vectors a4 and c4 respectively (i = 0,1,2,3).

Theorem 4

For any real \(a,b,b^{\prime } ,b^{\prime \prime }\) and x < a

$$ \begin{array}{@{}rcl@{}} F_{a,b,b^{\prime},b^{\prime\prime}}(3 | x)\!&=&\!\frac{1}{\varphi(x)} {\int}_{-x-a-b}^{\infty}{\int}_{x_2-a-b-b^{\prime}}^{\infty}{\int}_{x_3-a-b-b^{\prime}-b^{\prime\prime}}^{\infty} \\ && \exp(-\|\boldsymbol{\mu}_4\|^2/2 + \boldsymbol{\mu}_{4}^{\prime}(\mathbf{c}_4-\mathbf{a}_4)) \det\left[\varphi({{a}_4}_i-{{c}_4}_{j}) \right]_{i,j=0}^{3}\\&& dx_{4} dx_{3} dx_{2}. \quad \end{array} $$
(4.3)

For the proof of Theorem 4, see A A.3.

4.2 A particular case of Theorem 4

In this section, we consider a special barrier B(t;h,0,−μ,μ) (depicted in Fig. 4), which will be used in Section 5. In the notation of Theorem 4, a = h, b = 0, \(b^{\prime }=-\mu \), \(b^{\prime \prime }=\mu \) and we obtain

$$ \begin{array}{@{}rcl@{}} &&\!\!\!\!\! F_{h,0,-\mu,\mu}(3 | x)=\frac{e^{{\mu}^2/2}}{\varphi(x)} {\int}_{-x-h}^{\infty}{\int}_{x_2-h+\mu}^{\infty} e^{-\mu(x_3-x_{2})} \times \\ &&\!\!\!\!\! \det \begin{bmatrix} \varphi(x) & \varphi(-x_2-h) & \varphi(-x_3 - 2h + \mu) & \varPhi(-x_3 - 2h + \mu) \\ \varphi(h) & \varphi(-x - x_{2})& \varphi(-x - x_3 - h + \mu) & \varPhi(-x - x_3 - h + \mu) \\ \varphi(x_2+2h+x) & \varphi(h)& \varphi(x_2 - x_3 + \mu)& \varPhi(x_2-x_3+\mu) \\ \varphi(x_3 + 3h - \mu + x) & \varphi(x_3 + 2h - \mu - x_{2}) & \varphi(h)& \varPhi(h) \\ \end{bmatrix}dx_3dx_2. \end{array} $$
(4.4)
Fig. 4
figure 4

Barrier B(t;h,0, − μ,μ) with μ > 0

4.3 Another linear barrier with two changes in slope

For real h and μ, define the barrier B(t;h,0,0,−μ,μ) by

$$ \begin{array}{@{}rcl@{}} B(t;h,0,0,-\mu,\mu)= \begin{cases} h, & t \in [0,2], \\ h-\mu (t-2), & t \in [2,3], \\ h-\mu+ \mu(t-3), & t \in [3,4] . \end{cases} \end{array} $$

The barrier B(t;h,0,0,−μ,μ) looks similar to the barrier depicted in Fig. 4, except the constant part is two units long. The corresponding first-passage probability

$$ \begin{array}{@{}rcl@{}} \!\!\!\!\!\!\!\!\!\! F_{h,0,0,-\mu,\mu}(4 | x) \!:=\! \text{Pr}(S(t)\!<\! B(t;h,0,0,-\mu,\mu)\text{ for all } t\!\in\![0,4] | S(0) = x) \end{array} $$
(4.5)

will be important in Section 5.

Theorem 5

For any real h, μ and x < h

$$ \begin{array}{@{}rcl@{}} &&\!\!\!\!\!\!F_{h,0,0,-\mu,\mu}(4 | x)\! = \frac{e^{\mu^2/2}}{\varphi(x)} {\int}_{-x-h}^{\infty} dx_{2} {\int}_{x_2-h}^{\infty} dx_{3} {\int}_{x_3-h+\mu}^{\infty} dx_{4} e^{-\mu(x_4-x_{3})}\times \\ &&\!\!\!\!\!\det\! \begin{bmatrix} \varphi(x) & \varphi(\!-x_{2} - h) & \varphi(-x_{3} - 2h\!) & \varphi(-x_{4} - 3h + \mu) & \varPhi(-x_{4} - 3h + \mu)\\ \varphi(h) & \varphi(-x - x_{2})& \!\!\!\! \varphi(-x - x_{3} - h) \!&\!\varphi(-x - x_{4} - 2h + \mu)&\! \varPhi(\!-x - x_{4} - 2h + \mu) \\ \varphi(x_{2} + 2h + x) & \varphi(h)& \varphi(x_{2} - x_{3})& \varphi(x_{2} - x_{4} - h + \mu)&\varPhi(x_{2} - x_{4} - h + \mu) \\ \varphi(x_{3} + 3h + x) \!\!& \varphi(x_{3} + 2h - x_{2}) \!\!& \varphi(h)& \varphi(x_{3} + \mu - x_4)&\varPhi(x_{3} + \mu - x_4) \\ \varphi(x_{4} + 4h - \mu + x) \!& \varphi(x_{4} + 3h - \mu - x_{2}) \!& \varphi(x_{4} + 2h - \mu - x_{3}) \!\!\!\!& \varphi(h)&\varPhi(h) \\ \end{bmatrix}. \end{array} $$
(4.6)

The proof of Theorem 5 is very similar to the proof of Theorem 4.

5 Application to change-point detection

5.1 Formulation of the problem

In this section, we illustrate the natural appearance of the first-passage probabilities for the Slepian process S(t) for piece-wise linear barriers and in particular the barriers considered in Sections 3.2 and 4.2.

Suppose one can observe the stochastic process X(t)(t ≥ 0) governed by the stochastic differential equation

(5.1)

where ν > 0 is the unknown (non-random) change-point and μ≠ 0 is the drift magnitude during the ‘epidemic’ period of duration l with \(0<l<\infty \); μ and l may be known or unknown. The classical change-point detection problem of finding a change in drift of a Wiener process is the problem Eq. 5.1 with \(l=\infty \); that is, when the change (if occurred) is permanent, see for example (Pollak and Siegmund 1985; Moustakides 2004; Polunchenko 2018; Polunchenko and Tartakovsky 2010).

In Eq. 5.1, under the null hypothesis \(\mathbb {H}_{0}\), we assume \(\nu = \infty \) meaning that the process dX(t) has zero mean for all t ≥ 0. On the other hand, under the alternative hypothesis \(\mathbb {H}_{1}\), \(\nu <\infty \). In the definition of the test power, we will assume that ν is large. However, for the tests discussed below to be well-defined and approximations to be accurate, we only need ν ≥ 1 (under \(\mathbb {H}_{1}\)).

In this section, we only consider the case of known l, in which case we can assume l = 1 (otherwise we change the time-scale by tt/l and the barrier by \(B \to B/\sqrt {l}\)). When testing for an epidemic change on a fixed interval [0,T] with l unknown, one possible approach is to construct the test statistic on the base of \(\max \limits _{0<s<t<T}[W(t)-W(s)]\), the maximum over all possible choices of l and locations. This idea was discussed in Siegmund (1986), where asymptotic approximations are offered. The case when l is unknown is more complicated and the first-passage probabilities that have to be used are more involved.

We define the test statistic used to monitor the epidemic alternative as

$$ \begin{array}{@{}rcl@{}} S_1(t) ={\int}_{t}^{t+1}dX(t) t\ge0 . \end{array} $$

The stopping rule for S1(t) is defined as follows

$$ \begin{array}{@{}rcl@{}} \tau(h) = \inf \{t: S_{1}(t) \geq h \}, \end{array} $$
(5.2)

where the threshold h is chosen to satisfy the average run length (ARL) constraint \({\mathbb {E}_{0}(\tau (h) )=C}\) for some (usually large) fixed C (here \(\mathbb {E}_{0}\) denote the expectation under the null hypothesis). Since l is known, for any μ > 0 the test with the stopping rule Eq. 5.2 is optimal in the sense of the Abstract Neyman-Pearson lemma, see Theorem 2, Grenander (1981, p. 110).

The process \( S_{1}(t)- \mathbb {E}S_{1}(t)=W(t+1)-W(t) \) is stochastically equivalent to the Slepian process S(t) of Eq. 1.1. Under \(\mathbb {H}_{0}\), \(\mathbb {E}S_{1}(t) =0 \) for all t ≥ 0 and under \(\mathbb {H}_{1}\) we have

$$ \mathbb{E}S_{1}(t)= \left\{ \begin{array}{cl} \mu(t-\nu+1) & \text{for} \nu-1 <t \leq \nu \\ \mu(1-t+\nu) & \text{for} \nu < t \leq \nu + 1 \\ 0 & \text{otherwise}. \end{array} \right. $$

5.2 Approximation for \(\mathbb {E}_{0}(\tau (h) )\)

The problem of construction of accurate approximations for \(\mathbb {E}_{0}(\tau (h) )\) was addressed in Noonan and Zhigljavsky (2019). For completeness, we briefly review the approach. Consider the unconditional probability (taken with respect to the standard normal distribution):

$$ \begin{array}{@{}rcl@{}} F_{h,0}(T) := {\int}_{-\infty}^{h} F_{h,0}(T | x)\varphi(x) dx . \end{array} $$

Under \(\mathbb {H}_{0}\), the distribution of τ(h) has the form (1 −Φ (h))δ0(ds) + qh(s)ds,s ≥ 0, where δ0(ds) is the delta-measure concentrated at 0 and

$$ q_{h}(s)=-\frac{d}{ds}F_{h,0}(s ) , 0<s<\infty $$

is the first-passage density. This yields

$$ \begin{array}{@{}rcl@{}} \mathbb{E}_0(\tau(h) ) = {\int}_{0}^{\infty}sq_h(s) ds. \end{array} $$
(5.3)

There is no easy computationally convenient formula for qh(t) as expressions for Fh,0(s) are very complex. One of the simplest (yet very accurate) approximation for Fh,0(s) takes the form:

$$ \begin{array}{@{}rcl@{}} F_{h,0}(T)\simeq F_{h,0}(2 ) \cdot \lambda(h)^{T-2}, \text{for all }T>0, \end{array} $$
(5.4)

with λ(h) = Fh,0(2)/Fh,0(1). Using Eq. 5.4, we approximate the density qh(s) by

$$ \begin{array}{@{}rcl@{}} q_h(s) \simeq - F_{h,0}(2)\log [\lambda({h})] \cdot \lambda({h})^{s -2 }, 0< s <\infty. \end{array} $$

Subsequent evaluation of the integral in Eq. 5.3 yields the approximation

$$ \begin{array}{@{}rcl@{}} \mathbb{E}_0(\tau(h) ) \cong -\frac{F_{h,0}(2 )}{ \lambda({h})^2\log [ \lambda({h})]} . \end{array} $$
(5.5)

Numerical study shows that the approximation Eq. 5.5 is very accurate for all h ≥ 3. Setting h = 3.63 in Eq. 5.5 results in \(C \simeq 500\).

5.3 Approximating the power of the test

In this section we formulate several approximations for the power of the test Eq. 5.2 which can be defined as

$$ {\mathcal{P}}({h,\mu}):= \lim_{\nu \to \infty}\mathrm{P}_{1} \left\{S_{1}(t)\ge h \text{ for at least one } t\in[\nu-1,\nu+1 ] | \tau(h) > \nu-1 \right\} , $$
(5.6)

where P1 denotes the probability measure under the alternative hypothesis. Define the piecewise linear barrier Qν(t;h,μ) as follows

$$ \begin{array}{@{}rcl@{}} Q_{\nu}(t;h,\mu) =h- \mu \max\{0, 1-|t-\nu | \}. \end{array} $$

The barrier Qν(t;h,μ) is visually depicted in Fig. 5. The power of the test with the stopping rule Eq. 5.2 is then

$$ \begin{array}{@{}rcl@{}} {\mathcal{P}}({h,\mu}) = \lim_{\nu \to \infty} \mathrm{P}\left\{S(t)\!\ge\! Q_{\nu}(t;h,\mu) \text{ f{\kern-.2pt}o{\kern-.2pt}r{\kern-.2pt} a{\kern-.2pt}t{\kern-.2pt} l{\kern-.2pt}e{\kern-.2pt}a{\kern-.2pt}s{\kern-.2pt}t{\kern-.2pt} o{\kern-.2pt}n{\kern-.2pt}e } t\!\in\![\nu - 1,\nu + 1] | \tau(h) \!>\! \nu - 1 \right\}. \end{array} $$
Fig. 5
figure 5

Graphical depiction of the boundary Qν(t;h,μ)

Consider the barrier B(t;h,0,−μ,μ) of Section 4 with t ∈ [0,3]. Define the conditional first-passage probability

$$ \begin{array}{@{}rcl@{}} && \gamma_3(x,h,\mu)\!:=\! \mathrm{P}\{S(t) \!\ge\! B(t;h,0,-\mu,\mu) \text{ for some } t\!\in\![1,3] | S(0)\\\!&=&\!x; S(t)<h, \forall {t \!\in\! [0,1]} \} \\ &=&\! 1 - \frac{\mathrm{P}\left\{S(t)< B(t;h,0,-\mu,\mu) \text{ for all } t\in[0,3] | S(0)=x \right\} } { \mathrm{P}\left\{S(t) <h \text{ for all } t\in[0,1] | S(0)=x \right\} } \\\!&=&\! 1- \frac{F_{h,0,-\mu,\mu}(3 | x) } { F_{h,0}(1|x) } . \end{array} $$
(5.7)

The denominator in Eq. 5.7 is very simple to compute, see Eq. 2.6 with b = 0 and a = h. The numerator in Eq. 5.7 can be computed by Eq. 4.4. Computation of γ3(x,h,μ) requires numerical evaluation of a two-dimensional integral, which is not difficult.

Our first approximation to the power \({\mathcal {P}}({h,\mu })\) is γ3(0,h,μ). In view of Eq. 1.1 the process S(t) forgets the past after one unit of time hence quickly reaches the stationary behaviour under the condition S(t) < h for all t < ν − 1. By approximating \({\mathcal {P}}({h,\mu })\) with γ3(0,h,μ), we assume that one unit of time is almost enough for S(t) to reach this stationary state. In Fig. 6, we plot the ratio γ3(x,h,μ)/γ3(0,h,μ) as a function of x for h = 3 and μ = 3. Since the ratio is very close to 1 for all considered x, this verifies that the probability γ3(x,h,μ) changes very little as x varies implying that the values of S(t) at t = ν − 2 have almost no effect on the probability γ3(x,h,μ). This allows us to claim that the accuracy \(|{\mathcal {P}}({h,\mu }) -\gamma _{3}(0,h,\mu )|\) of the approximation \({\mathcal {P}}({h,\mu }) \simeq \gamma _{3}(0,h,\mu )\) is smaller than 10− 4 for all h ≥ 3.

Fig. 6
figure 6

Ratio γ(x,h,μ)/γ(0,h,μ) for h = 3 and μ = 3

Consider the barrier B(t;h,0,0,−μ,μ) of Section 4.3 with t ∈ [0,4]. Define the conditional first-passage probability

$$ \begin{array}{@{}rcl@{}} \gamma_4(x,h,\mu)\!:=\! \mathrm{P}\{S(t) \!\ge\! B(t;h,0,0,-\mu,\mu) \text{ for some } t\!\in\![2,4] | S(0) = x, \!\! S(t)\!<\!h, \forall {t \!\in\! [0,2]} \} \\ =\!1\!- \frac{\mathrm{P}\left\{S(t)< B(t;h,0,0,-\mu,\mu) \text{ for all } t\in[0,4] | S(0)=x \right\} } { \mathrm{P}\left\{S(t) <h \text{ for all } t\in[0,2] | S(0)=x \right\} } = 1 - \frac{F_{h,0,0,-\mu,\mu}(4 | x) } { F_{h,0}(2|x) } . \end{array} $$

The numerator in γ4(x,h,μ) requires numerical evaluation of the three-dimensional integral in Eq. 4.6. The denominator can be computed using Theorem 1 with a = h and b = 0. Our second approximation to the power \({\mathcal {P}}({h,\mu })\) is γ4(0,h,μ). The accuracy of the approximation \({\mathcal {P}}({h,\mu }) \simeq \gamma _{4}(0,h,\mu )\) is smaller than 10− 6 for all h ≥ 3 and μ ≥ 0. In particular, |γ4(1,3,3)/γ4(− 1,3,3) − 1| < 10− 7, compare this with Fig. 6. For h = 3.11 and hence \(C\simeq 100\), we have |γ4(0,h,3)/γ3(0,h,3) − 1| < 3 ⋅ 10− 5 and |γ4(0,h,4)/γ3(0,h,4) − 1| < 6 ⋅ 10− 6. We have chosen γ3(0,h,μ) as our main approximation since it is almost as precise as γ4(0,h,μ) but computationally γ3(0,h,μ) is much cheaper.

As seen from Figs. 2 and 4, the barrier B1,1(t;h,−μ,μ) is the main component of the barrier B(t;h,0,−μ,μ). Instead of using the approximation \({\mathcal {P}}({h,\mu }) \simeq \gamma _{3}(0,h,\mu )\) it is therefore tempting to use a simpler approximation \({\mathcal {P}}({h,\mu }) \simeq \gamma _{2}(0,h,\mu )\), where

$$ \begin{array}{@{}rcl@{}} \gamma_2(x,h,\mu)\!&:=&\! \mathrm{P}\{S(t)\!\ge\! B_{1,1}(t;h,-\mu,\mu) \text{ for some } t\!\in\![0,2] | S(0) = x \}\\ \!&=&\! 1- F_{h,-\mu,\mu}(1,1 | x) . \end{array} $$

To compute values of γ2(0,h,μ) we only need to evaluate the one-dimensional integral in Eq. 3.5 with b = μ.

To assess the impact of the final line-segment in the barrier B(t;h,0,−μ,μ) on the power (the line-segment with gradient μ in Fig 5, t ∈ [ν,ν + 1]), let

$$ \begin{array}{@{}rcl@{}} \gamma_1(x,h,\mu)\!:=\! \mathrm{P}\{S(t)\!\ge\! B_{1,1}(t;h,0,\!-\mu) \text{ for some } t\in[1,2] | S(0)=x,S(t)<h, \forall {t \in [0,1]} \} \\ =1- \frac{\mathrm{P}\left\{S(t)< B_{1,1}(t;h,0,-\mu) \text{ for all } t\in[0,2] | S(0)=x \right\} } { \mathrm{P}\left\{S(t) <h \text{ for all } t\in[0,1] | S(0)=x \right\} } = 1- \frac{F_{h,0,-\mu}(1,1 | x) } { F_{h,0}(1|x) } . \end{array} $$

Then we make the approximation \({\mathcal {P}}({h,\mu }) \simeq \gamma _{1}(0,h,\mu )\), where the quantity Fh,0,−μ(1,1|0) can be computed using Eq. 3.6 with \(b^{\prime }=\mu \). The denominator can be computed using Eq. 2.6 with b = 0 and a = h.

In Table 1, we provide values of \({\mathcal {P}}({h,\mu }), \gamma _{2}(0,h,\mu )\) and γ1(0,h,μ) for different μ, where the values of h have been chosen to satisfy \(\mathbb {E}_{0}(\tau (h) )=C\) for C = 100,500,1000; see Eq. 5.5 regarding computation of the ARL \(\mathbb {E}_{0}(\tau (h) )\). Since the values in Table 1 are given to three decimal places, these values of \({\mathcal {P}}({h,\mu })\) can be obtained from either γ3(0,h,μ) or γ4(0,h,μ); both of these two approximations provide a better accuracy than 3 decimal places. Comparing the entries of Table 1 we can observe that the quality of the approximation \({\mathcal {P}}({h,\mu }) \simeq \gamma _{2}(0,h,\mu )\) is rather good, especially for large μ. By looking at the columns corresponding to γ1(0,h,μ), one can also see the expected diminishing impact which the final line-segment in B(t;h,0,−μ,μ) has on power, as μ increases. However, for small μ the contribution of this part of the barrier to power is significant suggesting it is not be sensible to approximate the power of our test with γ1(0,h,μ).

Table 1 \({\mathcal {P}}({h,\mu }), \gamma _{2}(0,h,\mu )\) and γ1(0,h,μ) for different μ for three choices of ARL

To summarize the results of this section, for approximating the power function \({\mathcal {P}}({h,\mu })\), we propose one the following two approximations: a very accurate approximation γ3(0,h,μ) requiring numerical evaluation of a two-dimensional integral and γ2(0,h,μ), a less accurate but simpler approximation requiring evaluation of a one-dimensional integral only. The approximation \( {\mathcal {P}}({h,\mu }) \simeq \gamma _{4}(0,h,\mu )\) is extremely accurate but too costly whereas the approximation γ1(0,h,μ) is less accurate than γ2(0,h,μ) but slightly cheaper, requiring the numerical evaluation of a two-dimensional integral. The approximation \( {\mathcal {P}}({h,\mu }) \simeq \gamma _{1}(0,h,\mu )\) has been studied mainly for assessing the impact which the final line-segment in B(t;h,0,−μ,μ) has on the power.