1 Introduction: statement of the problem

Let \(\varepsilon _1,\varepsilon _2,\ldots \) be a sequence of independent identically distributed random variables with finite mean \(\mu \) and variance \(\sigma ^2\) and some c.d.f. F. Define the moving weighted sum as

$$\begin{aligned} \mathcal{S}_{n;L,Q}= \sum _{s=n+1}^{n+L+Q-1} w_{L,Q}(s-n) \varepsilon _s\, \;\; (n=0,1, \ldots ), \end{aligned}$$
(1)

where the weight function \(w_{L,Q}(\cdot )\) is defined by

$$\begin{aligned} w_{L,Q}(t)= \left\{ \begin{array}{ll} t &{}\quad \mathrm{for } \;\; 0 \le t \le \, Q,\\ Q &{}\quad \mathrm{for } \;\; \, Q \le t \le \, L,\\ L\,+\,Q\,-\, t &{} \;\;\,\mathrm{for }\; \; \, L \le t \le \, L\,+\, Q\, -1. \end{array} \right. \end{aligned}$$
(2)

where L and Q are positive integers with \(Q \le L\).

Fig. 1
figure 1

The weight function \(w_{L,Q}(\cdot )\), \( 1 \le Q \le L\)

The weight function \(w_{L,Q}(\cdot )\) is depicted in Fig. 1. In the special case \(Q=1\), the weighted moving sum (1) becomes an ordinary moving sum.

The main aim of this paper is to study precision of different approximations of boundary crossing probabilities for the maximum of the moving weighted sum; that is,

$$\begin{aligned} P\left( \max _{n=0,1,\ldots ,M} \mathcal{S}_{n;L,Q} >H\right) , \end{aligned}$$
(3)

where H is a given threshold, M is reasonably large and LQ are fixed parameters.

This paper is structured as follows. In Sect. 2 we reformulate the problem and provide motivation why a trapezoidal weight function is considered. In Sect. 3, a number of approximations to (3) are introduced based on the classical extreme value theory. Using the classical approximations, which do not perform very well, we also derive another approximation (called ‘combined’) which appears to be more accurate. The performance of these approximations is analyzed by a large simulation study described in Sect. 4.

2 Boundary crossing probabilities: discrete and continuous time

2.1 Reformulation of the problem

For convenience of dealing with the probability (3), we standardise the moving weighted sum \(\mathcal{S}_{n;L,Q}\). Derivation of the following lemma is straightforward.

Lemma 1

The first two moments of \(\mathcal{S}_{n;L,Q}\) are

$$\begin{aligned} E\mathcal{S}_{n;L,Q}= \mu LQ, \;\; \mathrm{var}(\mathcal{S}_{n;L,Q})=\displaystyle \frac{\sigma ^2Q}{3} (3LQ - Q^2+1). \end{aligned}$$
(4)

We now define the standardized random variables (r.v.)

$$\begin{aligned} \zeta _n:= \frac{\mathcal{S}_{n;L,Q}- E \mathcal{S}_{n;L,Q}}{\sqrt{\mathrm{var}(\mathcal{S}_{n;L,Q})}}= \frac{\sqrt{3}\, (\mathcal{S}_{n;L,Q}- \mu LQ)}{ \sigma \sqrt{Q (3LQ - Q^2+1) }} , \end{aligned}$$
(5)

\(n=0,1,\ldots .\) If the r.v. \(\varepsilon _1, \varepsilon _2, \ldots \) are normal then the r.v. \(\zeta _1, \zeta _2, \ldots \) are also normal. Otherwise, using the Central Limit Theorem, we obtain that \( \zeta _{n} \sim N(0,1)\, \) holds asymptotically, as \(L\rightarrow \infty \).

Using the notation \(\zeta _n\), our problem (3) is equivalent to studying approximations for the boundary crossing probability (abbreviated BCP)

$$\begin{aligned} P_{M, h} (\zeta _n):=P\left( \max _{n=0,1,\ldots ,M} \zeta _n >h \right) , \end{aligned}$$
(6)

where

$$\begin{aligned} H= \mu LQ + \sigma h\sqrt{ \frac{ Q(3LQ-Q^2+1)}{3}}. \end{aligned}$$

A number of approaches could be used to approximate (6). We could have ignored the dependence structure of the sequence of moving weighted sums and used either asymptotic normality alone or the limiting extreme value distribution to choose h. Instead, in what follows we study several approximations of (6) which are based on approximating the sequence \(\zeta _n\) by a continuous time random process. Before we proceed, let us consider a special case of \(\varepsilon _j\), which has important practical significance.

2.2 Motivation for the problem

If we let \(\varepsilon _j=\xi _j^2\), where \(\xi _1,\xi _2,\ldots \) are i.i.d random variables with zero mean, variance \(\delta ^2\) and finite fourth moment \(\mu _4=E\xi _i^4\), then \(\mathcal{S}_{n;L,Q}\) can be seen as a moving weighted sum of squares. In this case, the mean \(\mu =E\varepsilon _j=\delta ^2\) and \(\sigma ^2=\mathrm{var }(\varepsilon _j) = \mu _4- \delta ^4\). By approximating (3) we are considering a particularly interesting case linked to the SSA change-point detection algorithm proposed in Moskvina and Zhigljavsky (2003). A good approximation for the BCP for the maximum of the moving weighted sums of squares is needed in the theory of sequential change-point detection because the BCP defines the significance levels for the SSA change-point detection statistic. For an extensive introduction to SSA, see Golyandina et al. (2001) and Golyandina and Zhigljavsky (2013).

2.3 Continuous time approximation

By the definition, the probability \( P_{M, h} (\zeta _n)\) is an \((M+1)\)-dimensional integral which is difficult to compute. We assume that \(L\rightarrow \infty \) and consider a transformation described below in Sect. 3 from the time series \(\zeta _n\), \(n=0,1,\ldots , M\), to a continuous-time process \(\zeta _t, t\in [0,{ T}],\) where \(T=M/\sqrt{LQ}\) for large Q, see (10), and \(T=M/{L}\) in the case of small Q, see beginning of Sect. 3.2. Like the time series \(\zeta _n\), the process \(\zeta _t\) is standardized so that \(E\zeta _t=0\) and \(E\zeta _t^2=1\) for all t. Also, the process \(\zeta _t\) is Gaussian and stationary with some autocorrelation function \(R(s)= E\zeta _0\zeta _{s}\).

By such a transformation, the probability \( P_{M, h} (\zeta _n)\) is approximated by \(P({ T},h, \zeta _t)\), which is the probability of reaching the threshold h by the process \(\zeta _t\) on the interval [0, T]; that is,

$$\begin{aligned} P_{M, h} (\zeta _n)\cong & {} P({ T},h, \zeta _t)=\mathrm{Pr}\left\{ \max _{0\le t\le { T}}\zeta _t \ge h\right\} \nonumber \\= & {} \mathrm{Pr}\Big \{\zeta _t \ge h\;\mathrm{for\;at\;least\;one\;} t\in [0,{ T}]\Big \}.\; \end{aligned}$$
(7)

For the continuous process \(\zeta _t\), two main useful characteristics are the probability density function of reaching the threshold h for the first time

$$\begin{aligned} q(t,h,\zeta _t)=\frac{d}{dt}P(t,h,\zeta _t),\;\;\;0<t<\infty , \end{aligned}$$
(8)

and the average time \({\varrho }({h,\zeta _t})\) until the process \(\zeta _t\) reaches the threshold h

$$\begin{aligned} E({\varrho }({h,\zeta _t}))=\int _0^{\infty }{tq(t,h,\zeta _t)dt}= \int _0^{\infty }{tdP(t,h,\zeta _t)}\, . \end{aligned}$$

From the practical point of view, we are interested in finding good approximations of (6) for small and moderate M. But the mathematical theory guarantees accurate approximations just for large M.

To proceed further, we need to discuss results concerning the autocorrelation function of the continuous process \(\zeta _t\). This can be done through computing the correlations between \(\mathcal{S}_{n;L,Q}\) and \(\mathcal{S}_{n+\nu ,L,Q}\) for \(\nu >0\).

2.4 Correlation between \(\mathcal{S}_{n;L,Q}\) and \(\mathcal{S}_{n+1;L,Q}\)

For fixed L and Q, the moving weighted sum \(\mathcal{S}_{n;L,Q}\) is a function of n. The index n can be treated as time and thus the sequence \(\mathcal{S}_{0;L,Q}\), \(\mathcal{S}_{1;L,Q}, \ldots \) defined in (1) can be considered as a time series. In order to derive our approximations, we need explicit expressions for the correlation Corr(\(\mathcal{S}_{n;L,Q},\mathcal{S}_{n+1;L,Q})\). The general case Corr(\(\mathcal{S}_{n;L,Q},\mathcal{S}_{n+\nu ;L,Q})\), \(\nu > 1\) need not be considered for these approximations.

Without loss of generality, we can assume that \(n=0\) and we denote \( \mathcal{S}_{\nu }:=\mathcal{S}_{\nu ;L,Q} \) where \(\nu =0,1\).

Lemma 2

The correlation \(\mathrm{Corr}(\mathcal{S}_0,\mathcal{S}_1)=\mathrm{Corr}(\mathcal{S}_{n;L,Q},\mathcal{S}_{n+1;L,Q})\), where \(\mathcal{S}_{n;L,Q}\) is defined in (1), is

$$\begin{aligned} \mathrm{Corr}(\mathcal{S}_0,\mathcal{S}_1)= \frac{ E(\mathcal{S}_0\mathcal{S}_1)-(E\mathcal{S}_0)^2}{\mathrm{var}(\mathcal{S}_0)}= 1-\frac{3}{3LQ-Q^2+1}\, . \end{aligned}$$

Proof

From the definition (1), the quadratic forms \(\mathcal{S}_{0}\) and \(\mathcal{S}_{1}\) can be represented as

$$\begin{aligned}\mathcal{S}_0= \sum _{i=1}^{Q-1}{i\varepsilon _i}+Q\sum _{i=Q}^{L}{\varepsilon _i}+ \sum _{i=L\,+\,1}^{Q\,+\,L\,-\,1}{(Q\,+\,L\, -\,i)\varepsilon _i} \end{aligned}$$

and

$$\begin{aligned} \mathcal{S}_1\,=\, \mathcal{S}_0\,-\, \sum _{i=1}^{Q}\varepsilon _i+\, \sum _{i=1}^{Q}{\varepsilon _{L\, +i}}. \end{aligned}$$

Using these representations, we can easily obtain \( E(\mathcal{S}_0\mathcal{S}_1)=E\mathcal{S}_0^2-Q\sigma ^2\, . \) Then by substituting the explicit expressions (4) for \(E\mathcal{S}_0\) and \(\mathrm{var}(\mathcal{S}_0)=E\mathcal{S}_0^2\), we obtain the desired result.\(\square \)

Note that the correlation does not depend on the distribution of errors \(\varepsilon _j\) (unlike the covariance which depends on the mean \(\mu \) and variance \(\sigma ^2\) of \(\varepsilon _j\)). This also can be seen in relation to the fact (see, for example, Priestley 1981) that the spectral density of the moving average process depends only on the weight function, which is \(w_{L,Q}(t)\) in our case.

3 Approximations of the boundary crossing probabilities

In this section we formulate four different approximations for the BCP \(P_{M, h} (\zeta _n)\) defined in (7). These approximations depend on the behaviour of the autocorrelation function \(R(s)= E\zeta _0\zeta _{s}\) at 0 which in its turn depends on parameters Q and L of the weight function in (2). We consider the following two cases: (i) large Q and large L, (ii) small Q and large L.

3.1 Case of large Q and large L

Consider the sequence of random variables \(\zeta _0, \zeta _1,\ldots ,\zeta _{M}\) defined in (5). In view of Lemma 2, the correlation between \(\zeta _n\) and \(\zeta _{n\, +\, 1}\) is

$$\begin{aligned} \mathrm{Corr}(\zeta _n,\zeta _{n\, +\, 1})=1-\frac{3}{3LQ-Q^2+1}\, . \end{aligned}$$
(9)

Assume that both L and Q are large. Moreover, assume that L and Q tend to infinity in such a way that the limit \(\lambda =\lim Q/L \) exists and \(0<\lambda \le 1\). Set \(\varDelta ={1}/{\sqrt{LQ}}\) and

$$\begin{aligned} t_n=n \varDelta , \;\;\; n=0,1,\ldots ,{M}, \;\;\;\text{ so } \text{ that } \; t_n \in [0, { T}]\, \;\;\mathrm{with}\;\; T= {M}\varDelta \, . \end{aligned}$$
(10)

Define a piece-wise linear continuous-time process \({\zeta _t^{(L)}}, t \in [0,T],\) as follows

$$\begin{aligned} {\zeta _t^{(L)}}\, =\, \frac{1}{\varDelta } \big [ (t_{n}-t )\zeta _{n-1}\, +\, (t-t_{n-1}) \zeta _n \big ] \;\;\;\mathrm{for} \;\;t \in [t_{n-1},t_n],\; n=1,\dots ,{M}.\; \end{aligned}$$
(11)

By construction, the process \({\zeta _t^{(L)}}\) is such that \({\zeta _{t_n}^{(L)}}=\zeta _{n} \; \mathrm{for } \; n=0,\ldots ,{M}\). Also we have that \({\zeta _t^{(L)}}\) is a second-order stationary process in the sense that \(E\zeta _t^{(L)},\, \mathrm{var}(\zeta _t^{(L)})\) and the autocorrelation function \(R_\zeta ^{(L)}(t,t+k\varDelta )=\mathrm{Corr}( \zeta _t^{(L)}, \zeta _{t+k\varDelta }^{(L)})\) do not depend on t.

Lemma 3

Let \(\lambda =\lim _{L,Q\rightarrow \infty } Q/L\) and assume that \(0 < \lambda \le 1\). Consider the process \(\zeta _t^{(L)}\) defined in (11). The limiting process \(\zeta _t=\lim _{L,Q\rightarrow \infty } {\zeta _t^{(L)}}\) is stationary Gaussian with some autocorrelation function \(R_\zeta (t,t+s)=R(s)\). Moreover, \(R'(0)=0\) and \(R''(0)=-6/(3\, -\, \lambda )\).

Proof

For the autocorrelation function \(R(\cdot )\) we have \(R'(0)=0\) since

$$\begin{aligned} R'(0-)=R'(0+)=\lim _{L,Q\rightarrow \infty }\frac{R(\varDelta )-1}{\varDelta }= \lim _{L,Q\rightarrow \infty } \frac{-3\sqrt{LQ}}{3LQ-Q^2+1}=0, \end{aligned}$$

where we used the relations \(\varDelta \, =\, {1}/{\sqrt{LQ}}\), \(R(\varDelta )\, =\, 1-{3}\, /\, (3LQ-Q^2\, +\, 1)\) and \(R(0)\,=\, 1\). We similarly obtain

$$\begin{aligned} R''(0)= & {} \lim _{L,Q\rightarrow \infty }\,\, \frac{R(\varDelta )\,+\,R(-\varDelta )\,-\,2R(0)}{\varDelta ^2}= \lim _{L,Q\rightarrow \infty } \frac{-6LQ}{3LQ\,-\,Q^2\,+\,1}\\= & {} -\frac{6}{3\,-\, \lambda }<0. \square \end{aligned}$$

For a Gaussian stationary process \(\zeta _t\) with \(E\zeta _t=0\) and \(E\zeta _t^2=1\) and autocorrelation function \(R(\cdot )\) such that \(R'(0)=0\) and \(R''(0)<0\) we can use the following two well-known approximations.

Approximation 1

(App 1) From Theorem 8.2.7 in Leadbetter et al. (1983) we have

$$\begin{aligned} \lim _{{ T}\rightarrow \infty } P\left\{ \max _{0\le t\le { T}}\zeta _t\le \underbrace{\frac{u+\log \frac{\sqrt{-R''(0)}}{2\pi }}{\sqrt{2\log { T}}}+\sqrt{2\log { T}}}_{h} \right\} =\exp (-e^{-u})\, . \end{aligned}$$

Expressing u in terms of h, we obtain the Approximation 1

$$\begin{aligned} P({ T}, h,\zeta _t) \cong 1\,-\, \exp (-e^{-u}) \end{aligned}$$
(12)

with \( {u=\gamma (h-\gamma )+c}, \) where

$$\begin{aligned} \begin{array}{rcl} \gamma =\sqrt{2\log { T}}\, \;\;\mathrm{and } \;\; c=-\log \frac{\sqrt{-R''(0)}}{2\pi }= -\log \frac{1}{2\pi }\sqrt{\frac{6}{3-\lambda }}. \end{array} \end{aligned}$$
(13)

Approximation 2

(App 2) From Cramér (1965), we have

$$\begin{aligned} \lim _{{ T}\rightarrow \infty } P\left\{ \max _{0\le t\le { T}}\zeta _t\le \underbrace{\sqrt{2\log \mu }+\frac{v}{\sqrt{2\log \mu }}}_{h} \right\} =\exp (-e^{-v}), \end{aligned}$$

where

$$\begin{aligned} \mu =\frac{{ T}\sqrt{-R''(0)}}{2\pi }= \frac{{ T}}{2\pi }\sqrt{\frac{6}{3-\lambda }}\, . \end{aligned}$$

Expressing v in terms of h, we obtain Approximation 2

$$\begin{aligned} P({ T}, h,\zeta _t) \cong 1\,-\, \exp (-e^{-v}) \end{aligned}$$
(14)

with

$$\begin{aligned} v=\sqrt{2\log \mu }\,( h-\sqrt{2\log \mu }). \end{aligned}$$

Note that \({2\log \mu }\, =\, {\gamma ^2\, \, -\,2c}\) and

$$\begin{aligned} \sqrt{2\log \mu }\,=\, \sqrt{\gamma ^2\, \,- \, 2c}= \gamma -\frac{c}{\gamma }+ O\left( \frac{1}{\gamma ^3}\right) ,\;\; \end{aligned}$$

as \(\gamma \rightarrow \infty \), where \(\gamma \) and c are defined in (13). Therefore, for large T (and, therefore, large \(\gamma \)) we have

$$\begin{aligned} v \cong \left( \gamma -\frac{c}{\gamma }\right) \left( h-\gamma +\frac{c}{\gamma }\right) =\underbrace{(h-\gamma )\gamma +c}_{u} -\frac{(h-\gamma )c}{\gamma }-\frac{c^2}{\gamma ^2}\, . \end{aligned}$$

Let us construct another approximation by combining the Approximations 1 and 2.

Approximation 3

(Combined) Consider the approximation

$$\begin{aligned} P({ T}, h,\zeta _t) \cong 1\, -\, \exp (-e^{-z}) \end{aligned}$$
(15)

where

$$\begin{aligned} z= \left\{ \begin{array}{ll} u - \frac{(h-\gamma )c}{\gamma }-\frac{c^2}{\gamma ^2} &{}\mathrm{for\;\;\;} h\le \gamma -\frac{c}{\gamma },\\ u &{} \mathrm{for\;\;\;} h \ge \gamma -\frac{c}{\gamma } . \end{array} \right. \end{aligned}$$

Formally, \(\lambda =\lim _{L,Q\rightarrow \infty } Q/L=0\) still satisfies Lemma 3 in the sense that \(R'(0)=0\) and \(R''(0)=-2<0\); however, the above approximations are poor when Q is small; this shall be demonstrated in Sect. 4. The case of small Q should be treated differently and is considered in the following subsection.

3.2 Case of small Q and large L

Consider again the sequence of random variables \(\zeta _n\) defined by (5). Unlike in Sect. 3.1, now we look at the asymptotic transformation when \(L\rightarrow \infty \) but Q is fixed. Set \(\varDelta = 1/L\) and \(T= {M} \varDelta \). Define \(t_n\), \(n=0,1,\ldots ,{M},\) as in (10) and consider the piece-wise linear continuous-time process \(\zeta _t^{(L)}\) defined by (11).

Lemma 4

Let Q be fixed. The limiting process \(\zeta _t\) as \(L \rightarrow \infty \) is a Gaussian second-order stationary process with autocorrelation function \(R_\zeta (t,t+s)=R(s)\). Moreover, \(R'(0+)=-\frac{1}{Q} \ne 0\).

Proof

We first note that

$$\begin{aligned} \left. \frac{\partial R_\zeta (t,s)}{\partial s}\right| _{s=t+}=R(0+). \end{aligned}$$

Using (9) and the fact that \(\varDelta ={1}/{L}\), we have

$$\begin{aligned} R'(0+)=\lim _{L\rightarrow \infty }\frac{R(\varDelta )-R(0)}{\varDelta }= -\lim _{L\rightarrow \infty }\frac{3L}{3LQ-Q^2+1}=-\frac{1}{Q}. \end{aligned}$$

\(\square \)

Let us now formulate the tangent approximation suggested in Durbin (1985); it is one of the most known approximations for the density function \(q(t,h,\zeta _t)\) of the first passage time defined in (8). Using this, we can approximate the first passage probability \(P({ T}, h,\zeta _t)\) defined in (7) in the case of a Gaussian process \(\zeta (t)\) on [0, T] with \(E\zeta (t)=0\), some autocorrelation function \(R_{\zeta }(t,s)\) and the possibly non-constant threshold \(h=h(t)\).

The Durbin approximation for \(q(t,h,\zeta _t)\) can be written as

$$\begin{aligned} q(t,h,\zeta _t) \cong b_0(t,h)f(t,h), \end{aligned}$$

where

$$\begin{aligned} f(t,h)\, =\, \frac{1}{\sqrt{2\pi R_{\zeta }(t,t)}}\,e^{-\frac{h^2(t)}{2R_{\zeta }(t,t)}}\,\;\; b_0(t,h)\, =\, \left. -\frac{h(t)}{R_{\zeta }(t,t)} \frac{\partial R_{\zeta }(s,t)}{\partial s}\right| _{s=t+}\,-\frac{dh(t)}{dt}\, . \end{aligned}$$

In view of (8) the related approximation for the first passage probability \(P({ T}, h,\zeta _t)\) is

$$\begin{aligned} P({ T},h,\zeta _t) \cong \int _{0}^{ T}{b_0(t,h)f(t,h)dt}\, . \end{aligned}$$

In the case when the threshold \(h(t)=h\) is constant, using Lemma 4 we obtain

$$\begin{aligned} b_0(t,h)=-hR'(0+)=\frac{h}{Q},\;\;\;\; q(t,h,\zeta _t) \cong \frac{h}{\sqrt{2\pi }Q}\,e^{-h^2/2} \end{aligned}$$

and therefore we obtain the following approximation.

Approximation 4

(App 4) The Durbin approximation for the BCP (7) is

$$\begin{aligned} P({ T}, h,\zeta _t) \cong \frac{h{ T}}{\sqrt{2\pi }Q}e^{-h^2/2}. \end{aligned}$$
(16)

4 Simulation study

In this section we study quality of approximations for the BCP \(P_{M, h} (\zeta _n)\) defined in (6), where \(\varepsilon _t\) are normal r.v.’s with mean 0 and variance 1. Asymptotically (for large L and M), the approximations we study can also be used for the BCP connected to the weighted sum of squares discussed in Sect. 2.2 and therefore for setting significance levels for the SSA change-point statistic defined in Moskvina and Zhigljavsky (2003).

In Figs. 2, 3, 4, 5, and 6, the ’Sum of normal’ line corresponds to the empirical value of (6) computed from 100,000 simulations with different values of L, Q and M. In simulations leading to Figs. 2, 3, and 4 the value of Q can be considered as large and hence we compare Approximations 13. In Fig. 5 we present analysis demonstrating the lack of accuracy of Approximations 13 when Q is small. We then analyse the performance of the Durbin approximation in Fig. 6, which is constructed specifically under the assumption that Q is small; in this case we set \(Q=1\). We observe that for large L and Q Approximation 3 is typically superior to the Approximations 1 and 2 for all h (note that Approximations 1 and 3 coincide for large values of h). Listed in Tables 1, 2, 3, and 4 are the approximated threshold values h (for Approximations 1 and 2 only) for a specified true BCP, when this BCP is small enough. In these tables, R.E. denotes the relative error.

Fig. 2
figure 2

The BCP for the weighted sum of normal r.v. and its approximations: \(L=150, Q=50, M=1000\). (Color figure online)

Fig. 3
figure 3

The BCP for the weighted sum of normal r.v. and approximations: \(L=100, Q=50, M=1000\). (Color figure online)

Fig. 4
figure 4

The BCP for the weighted sum of normal r.v. and its approximations: \(L=100, Q=100, M=2000\). (Color figure online)

Fig. 5
figure 5

The BCP for the weighted sum of normal r.v. and its approximations: \(L=100, Q=5, M=2000\). (Color figure online)

Fig. 6
figure 6

The BCP for the weighted sum of normal random variables and the Durbin approximation: \(L=300, Q=1, T=10\) (top) and \(L=300, Q=1, T=1\) (bottom). (Color figure online)

As seen in Fig. 2 and Table 1, for the chosen parameters Approximation 2 is generally poor; for small BCP we see particularly high relative errors in Table 1. On the other hand, Approximation 1 performs well for small BCP and, although discrepancies can be seen for small h, we see that Approximation 3 performs quite well across all values of h.

Table 1 Threshold for a given BCP for the weighted sum of normal r.v. and approximations: \(L=150, Q=50, {M}=1000\)

As shown in Fig. 3 and Table 2, Approximation 2, whilst still being considerably worse than Approximations 1 and 3, shows signs of improvement with this choice of L and Q. At the BCP of 0.05, Approximation 1 produces the lowest relative error with the parameter choices considered so far.

Table 2 Threshold for a given BCP for the weighted sum of normal r.v. and its approximations: \(L=100, Q=50, {M}=1000\)

As shown in Fig. 4 and Table 3, we see a considerable improvement in Approximation 2 with the increase in M from 1000 to 2000, however Approximation 3 still remains far superior. For this larger M, Approximation 1 shows the smallest relative error at a BCP of 0.05 which is arguably the most important case.

Table 3 Threshold for a given BCP for the weighted sum of normal r.v. and approximations: \(L=100, Q=100, {M}=2000\)

We shall now consider the performance of Approximations 13 for small Q. We conclude that all three approximations perform poorly when Q is not large enough (of order L).

As can be seen from Fig. 5 and Table 4, all three approximations are poor for \(Q=5\). Relative errors are high and thus the use of these approximations for the case of small Q and large L cannot be justified.

Table 4 Threshold for a given BCP for the weighted sum of normal r.v. and approximations: \(L=100, Q=5, {M}=2000\)

For checking the quality of the Durbin approximation we used the same settings as for the Approximations 1, 2 and 3. In Fig. 6, we show results for the Durbin approximation for a few particular values of L and Q.

We can conclude that the quality of the Durbin approximation (16) is poor unless the threshold h is very large. This is seen graphically in Fig. 6 as well as numerically in Table 5, where there is a sharp increase in the relative error as the BCP increases. For the BCP of 0.05 the relative error for the Durbin approximation is higher than all relative errors of Approximation 1 considered in this paper.

Table 5 Threshold for a given BCP for the weighted sum of normal r.v. and Durbin approximation: \(L=300, Q=1, T=1\)

5 Conclusion

A number of approximations of boundary crossing probabilities for the maximum of moving weighted sums of i.i.d. random variables have been considered. The particular weights are obtained from a trapezoidal weight function that has important links to the SSA change-point detection algorithm described in Moskvina and Zhigljavsky (2003). We have seen that Approximations 13 perform rather well for large Q and L, and Approximation 3 consistently outperforming Approximations 1 and 2 across all values of the threshold h. The case of small Q must be considered separately since Approximations 13 perform poorly. The Durbin approximation, developed for small Q, is not satisfactory, unless threshold h is very large.