1 Introduction

Climate change is at the order of the day, leading to a growing concern about the occurrence of phenomena such as extreme drought, floods, and large-scale forest fires. The pandemic situation caused by COVID-19 and the outbreak of armed conflicts as happened recently also have a strong impact on the global society and economy in which we live. Perhaps we have never seen an occurrence of extreme phenomena like today and a consequent demand for the use of appropriate tools to assess their impact, such as those provided by the extreme values theory (EVT). The clustering effect of high values has a strong impact on the assessment of the risk associated with extreme phenomena and its main actor is the extremal index, denoted by \(\theta\). Indeed, \(\theta\) describes and quantifies the clustering amount of the extreme values in many stationary time series. In Fig. 1 we can see the daily maximum temperatures collected at the climatologic station Abrantes in center of Portugal (in Celsius degrees). Clustering of extreme values is visible and thus the presence of extremal local dependence. Recently, other areas such as Dynamical Systems have also been applying the concept of extremal index (Moloney et al. 2019; Freitas et al. 2021, among others).

Let \(\pmb {X}=\{X_n\}_{n\ge 1}\) be a stationary sequence of random variables (r.v.) with common marginal distribution function (d.f.) F. We say that \(\pmb {X}\) has extremal index \(\theta \in [0,1]\) if for each \(\tau >0\) there exists a sequence of normalized levels \(u_n\), i.e., \(n(1-F(u_n))\rightarrow \tau\), as \(n\rightarrow \infty\), such that \(P(M_{n}\le u_n)\rightarrow \exp (-\theta \tau )\), where \(M_{n}=\max (X_1,...,X_n)\). If \(\theta =1\) then the tail behavior of \(\pmb {X}\) resembles an iid sequence, whenever \(\theta <1\) leads to the occurrence of clusters of extreme values.

One extremal local dependence condition that is usually considered is the \(D(u_n)\), which is basically a standard mixing condition that limits the long-range dependence at large values. It implies that any two exceedances of large \(u_n\), \(X_i>u_n\) and \(X_j>u_n\), for sufficiently separated time points i and j are asymptotically independent (see, Leadbetter 1974).

If \(\pmb {X}\) satisfies \(D(u_n)\), we have \(P(M_{n}\le u_n)\approx F^{n\theta }(u_n)\), for large n and \(u_n\). Moreover, if there exist normalizing real constants \(a_n>0\) and \(b_n\) such that \(F^n(a_nx+b_n)\rightarrow G(x)\), then G is the d.f. of a generalized extreme value distribution (GEV) and \(P(M_{n}\le a_nx+b_n)\rightarrow H(x)\equiv G^\theta (x)\). If we consider \(\{X_n^*\}_{n\ge 1}\) an iid sequence with the same marginal d.f. F of \(\pmb {X}\), the limiting GEV distribution of the corresponding result for \(M_{n}^*=\max (X_1^*,...,X_n^*)\) is \(G(x)=H^{1/\theta }(x)\). In this context, \(\theta\) plays a key role on the sample maxima distribution. The location and scale parameters of the GEV d.f. H and G are respectively related as follows: \(\mu _H=\mu _G+\sigma _G(\theta ^\xi -1)/\xi\) and \(\sigma _H=\sigma _G\theta ^\xi\), where the shape parameter \(\xi\) is the same in both G and H. Thus ignoring \(\theta\) may lead to misspecified tail inferences: underestimation of quantiles of F if inference is based on H from sample block maxima or overestimation of H quantiles if inferences are based on marginal F from sample observations (see Beirlant et al. 2004). The extremal index also corresponds to the reciprocal of the mean cluster size in the point process of exceedance times of a large threshold \(u_n\), under a suitable mixing condition slightly stronger than \(D(u_n)\) (Hsing et al. 1988). Another interpretation of \(\theta\) due to O’Brien (1987) is based on a conditional probability that quantifies to what extent extremes cluster together.

Many contributions on the extremal index estimation are addressed in the literature, based on different interpretations of \(\theta\). The major discussion focuses on strategies for the best choice of one or more auxiliary parameters involved in each method and respective stability of the estimates. Typically, the estimation of \(\theta\) involves two sources of uncertainty: a threshold and some clustering parameter. Classical methods proposed in, e.g., Hsing (1991), Hsing (1993), Smith and Weissman (1994) and Weissman and Novak (1998) require both the choice of a threshold and a parameter associated with the clusters identification (runs parameter). More recently, threshold-dependent estimators have been proposed which are defined from the interexceedance times of a high threshold. This approach is based on the compound Poisson character of the point process of exceedances, namely, with an appropriate normalization and under a suitable and not restrictive mixing condition, the interexceedance times follow approximately an exponential mixture distribution with a point mass at zero and involving a parameter corresponding to \(\theta\). These include the intervals estimator of Ferro and Segers (2003), the K-gaps estimator of Süveges (2010), the censored and the truncated estimators of (respectively, Holěsovský and Fusek 2020; Holesovsky and Fusek 2022). The cycles estimator of Ferreira and Ferreira (2018) also requires the choice of a threshold and the validity of a local dependence condition describing the cluster behavior. The maxima estimators of Gomes (Gomes 1993; Ancona-Navarrete and Tawn 2000; Northrop 2015) are based on the comparison between the block maxima distribution obtained from the stationary sequence and the corresponding sequence of independent variables. We also include in this group the more recent estimator of Ferreira and Ferreira (2022) which is obtained from the bivariate block maxima distribution generated from the stationary sequence and an iid sequence of independent standard Fréchet variables. These estimators require the choice of a block size. In this paper we introduce a new version of the block maxima estimator in Ferreira and Ferreira (2022) and propose a bootstrap method to compute confidence intervals. In Sect. 2 we present a survey on the inferential methods that will be used. We are going to analyze their performance trough simulation in Sect. 3. Besides the pointwise estimation we also address interval estimation mainly based on bootstrap. In Sect. 4 we will illustrate the methods on a climatological dataset. We end with a discussion in Sect. 5.

Fig. 1
figure 1

Daily maximum temperature in the months of July and August 2001 at the station Abrantes in the center of Portugal

2 Some characterization and estimation of \(\theta\)

In this section we describe some probabilistic characteristics of the extremal index that inspired the methodology and the mathematical expression of the estimators to be presented. These will be analyzed on the next section through simulation and their performances will also be compared.

We start with classical runs estimator that is related to the O’Brien (1987) characterization,

$$\begin{aligned} \theta =\lim _{n\rightarrow \infty }P(M_{1,r_n}\le u_n|X_1>u_n), \end{aligned}$$
(1)

where \(r_n=o(n)\) and \(M_{i,j}=\max (X_{i+1},..,X_{j})\), \(i\le j-1\), with \(M_{i,j}=-\infty\) if \(i>j-1\) and \(M_{0,j}\equiv M_{j}\). The empirical counterpart of (1) leads to the runs estimator

$$\begin{aligned} {\tilde{\theta }}^{(R)}=\frac{\sum _{i=1}^{n-r+1}\mathbbm {1}_{\{X_i>u,X_{i+1}\le u,...,X_{i+r-1}\le u\}}}{N_u} \end{aligned}$$
(2)

where \(N_u\) denotes the number of exceedances of threshold u in stationary sequence \(\pmb {X}\) and \(\mathbbm {1}_{\{\cdot \}}\) denotes an indicator function (Hsing 1993). In practice, clusters are identified by considering two different groups of exceedances of a threshold u as independent clusters if there are at least \(r-1\) consecutive observations below the threshold between them. We shall denote r the runs parameter.

Hsing and McCormick (1991) establishes a similar result to that of O’Brien, under a local mixing condition denoted \(D^{(s)}(u_n)\) which states that within a cluster, an exceedance of a high threshold \(u_n\) is most likely to be followed by another exceedance within \(s-1\) consecutive observations. Condition \(D^{(s)}(u_n)\) requires the validity of mixing condition \(D(u_n)\) that limits the long-range dependence at extreme levels by implying that any two exceedances of \(u_n\) that are sufficiently separated in time are asymptotically independent. More precisely, \(\pmb {X}\) satisfies condition \(D(u_n)\) if for any integers \(1\le i_1<...< i_q< j_1<... <j_{q'}\le n\) for which \(j_1-i_q\ge l\), we have

$$\begin{aligned} \left| P\left( M_{i_1,i_q}\le u_n,M_{j_1,j_{q'}}\le u_n\right) -P\left( M_{i_1,i_q}\le u_n\right) P\left( M_{j_1,j_{q'}}\le u_n\right) \right| \le \alpha _{n,l}, \end{aligned}$$

with \(\alpha _{n,l_n}\rightarrow 0\), as \(n\rightarrow \infty\), for some sequence \(l_n=o(n)\) and \(l_n\rightarrow \infty\).

Condition \(D^{(s)}(u_n)\) will hold for \(\pmb {X}\) if \(D(u_n)\) also holds and there exists \(s>0\) integer, sequences \(r_n\) and \(l_n\) of integers such that \(r_n\rightarrow \infty\), \(n\alpha _{n,l_n}/r_n\rightarrow 0\), \(l_n/r_n\rightarrow 0\) and

$$\begin{aligned} \lim _{n\rightarrow \infty }nP\left( X_1>u_n\ge M_{1,s},M_{s,r_n}> u_n\right) =0. \end{aligned}$$

It is easily seen that once condition \(D^{(s)}(u_n)\) holds, then \(D^{(s^*)}(u_n)\) also holds for all \(s^* \ge\)s.

Consider \(u_n(\tau )\) such that, for \(\tau >0\),

$$\begin{aligned} \lim _{n\rightarrow \infty }nP\left( X_1>u_n(\tau )\right) =\tau . \end{aligned}$$

If \(D^{(s)}(u_n)\) holds for the stationary sequence \(\pmb {X}\), for some \(s>0\) and \(u_n=u_n(\tau )\) for all \(\tau >0\), the extremal index \(\theta\) of \(\pmb {X}\) exists if and only if

$$\begin{aligned} \lim _{n\rightarrow \infty } P\left( M_{1,s}\le u_n|X_1>u_n\right) =\theta , \end{aligned}$$
(3)

for all \(\tau >0\) (Hsing and T., McCormick, W.P. 1991, Corollary 1.3).

Observe that the runs estimator (2) also corresponds to the empirical counterpart of (3) by considering the runs parameter \(r=s\). When \(r=2\) we derive the Nandagopalan (1990) estimator which requires condition \(D^{(2)}(u_n)\) to hold. Its formula is very easy to compute since it is simply the ratio between the number of upcrossings (or downcrossings) and the number of exceedances of \(u_n\). The approach in Ferreira and Ferreira (2018) is based on the Nadagopalan’s estimator through an estimation procedure of the extremal index of an auxiliary stationary sequence satisfying \(D^{(2)}(u_n)\). More precisely, if \(\pmb {X}\) satisfies \(D^{(s)}(u_n)\), we take the so called cycles process \(\{Z_n=M_{(n-1)(s-1),n(s-1)}\}_{n\ge 1}\) for which \(D^{(2)}(u_n)\) holds and estimate \(\theta\) as the ratio between the number of upcrossings of threshold u within \(\{Z_1,...,Z_{[n/(s-1)]}\}\), denoted \(U_u^{Z}\) and the number of exceedances \(N_u\) of \(\pmb {X}\) (Ferreira and Ferreira 2018, Proposition 2.3), i.e.,

$$\begin{aligned} {\tilde{\theta }}^{(C)}=\frac{U_u^{Z}}{N_u}, \end{aligned}$$
(4)

here denoted cycles estimator.

Consider the interexceedance times r.v. \(T(u_n)=\min \{j\ge 1:\, X_{j+1}>u_n|X_1>u_n\}\). Under a suitable mixing condition, we have that \(P(X_1>u_n)T(u_n)\) converges in distribution to a mixture distribution which is degenerated at zero with weight \(1-\theta\) and has exponential law with mean value \(1/\theta\) with weight \(\theta\). Therefore, the extremal index \(\theta\) expresses both the proportion of intra-cluster (within a cluster) times and inter-cluster (between clusters) times, and the expected value of the inter-cluster times under a convenient normalization. The intervals estimator of Ferro and Segers (2003) corresponds to a moment-based estimator derived from the limiting mixture distribution. It only requires the choice of a high threshold exempting the choice of a runs parameter. It will be denoted \({\tilde{\theta }}^{(I)}\).

Although interexceedance times, \(T_i=j_{i+1}-j_i\), \(i=1,...,N_u\), are not independent and a likelihood procedure assumes independence, this assumption may be disregarded under the validity of condition \(D^{(s)}(u_n)\) for some s (Süveges 2007; Süveges 2010). On the other hand, the normalized intra-cluster times are theoretically zero in the limit but they are observed as positive values and thus will be assigned to the exponential part of the limiting mixture law.

By considering the new r.v. K-gap \(S^{(K)}(u_n) = \max (T(u_n)-K, 0)\), the smallest times \(T_i\) are set to zero, which improves the identification of intra-cluster times. Süveges (2010) shows that the maximum likelihood (ML) method can be applied to the limit mixture model in order to estimate \(\theta\), replacing interexceedance times by K-gaps \(S^{(K)}\) and under condition \(D^{(s)}(u_n)\) for \(s=K+1\). In Süveges (2007), it was only addressed the case \(K = 1\). This method corresponds to the so called K-gaps estimator, here denoted \({\tilde{\theta }}^{(K)}\). Choosing K involves some care, since if too large leads to more null times and consequent assignment to the degenerate part of the limiting mixture law, while too small K means fewer null times and hence an assignment tendency to the exponential component of the mixture law.

The censored estimator introduced in Holěsovský and Fusek (2020) is similar to the K-gaps estimator but the smallest interexceedance times (less than some integer c) are censored. The choice of c is not so sensitive as the choice of K, however, the likelihood expression underlying the censored estimator does not allow an explicit formula for it, which makes its analysis and improvements difficult. A new approach is considered in Holesovsky and Fusek (2022), where the extremal index estimation is based on truncation. The small interexceeding times are truncated by a given parameter t, corresponding to K in the K-gaps estimator or c in the censored estimator. If condition \(D^{(s)}(u_n)\) holds for \(\pmb {X}\) with \(s=t+1\), under the same mixing condition considered to derive the limiting mixture law of \(P(X_1>u_n)T(u_n)\), Holesovsky and Fusek (2022) prove that \(P(X_1>u_n)(T(u_n)-t)|T(u_n)>t\) converges in distribution to an exponential law with expected value \(1/\theta\). Let \(T_{(1)}\le ...\le T_{(N_u-1)}\) be the order statistics of \(T_1,...,T_{N_u-1}\), assume that \(T_{(N-N_t-1)} \le t < T_{(N-N_t)}\), with \(N_t\) the number of times that are greater than some fixed positive t, and \(\{S_1,..., S_{N_t}\} = \{T_{(N-N_t)}-t,...,T_{(N-1)}-t\}\) the set of exceedance times above the truncation value t. The ML method can be applied since truncated times are not affected by the sequence dependence (inter-cluster times are asymptotically independent (Ferro and Segers 2003) and intra-cluster times have not propensity to exceed t under local dependence condition \(D^{(t+1)}(u_n)\)). A simple ML estimator for \(\theta\) corresponds to the arithmetic inverse of sample mean

$$\begin{aligned} {\tilde{\theta }}=\frac{nN_t}{N_u\sum _{i=1}^{N_t}S_i} \end{aligned}$$
(5)

The derivation of the bias of (5) and of a penultimate approximation of the limiting distribution leads to an improved and bias corrected estimator, yielding the so-called truncated estimator

$$\begin{aligned} {\tilde{\theta }}^{(T)}={\tilde{\theta }}^{BC}-\frac{N_u}{2n(N_u-1)}\left[ 1+ {\tilde{\theta }}^{BC}(N_u-4)-\left( {\tilde{\theta }}^{BC}\right) ^2(N_u-1)\right] , \end{aligned}$$
(6)

with

$$\begin{aligned} {\tilde{\theta }}^{BC}= \frac{(N_u-1){\tilde{\theta }}-1}{N_u-1+(N_u/n)t}, \end{aligned}$$

where \({\tilde{\theta }}\) is given in (5).

In applications, it can be difficult to check the validity of \(D^{(s)}(u_n)\) condition. Various proposals have been presented, such as diagnostic plots of anti-\(D^{(s)}(u_n)\) (Süveges 2007; Ferreira and Ferreira 2018), the information matrix test (Süveges 2010; Fukutome and Süveges 2014; Fukutome et al. 2019), or based on a stability check of the runs estimator (Cai 2019). However, the study of this issue is not closed and still awaits developments. The automation procedure in Fukutome and Süveges (2014); Fukutome et al. (2019) allows to select both s and \(u_n\). More precisely, considering the K-gaps estimator, it is based on misspecification tests through the information matrix test (IMT) presented in ( Süveges 2010). All combinations of pairs of thresholds and run parameters in plausible ranges are tested for misspecification of the model, and the pair (uK) that generates the largest number of observations after declustering, within a list of pairs of small misspecification (IMT < 0.05) is selected, provided the number of exceedances is larger than 80. We will apply this automation procedure to select both threshold and runs parameter involved in each of the estimators: runs \({\tilde{\theta }}^{(R)}\), cycles \({\tilde{\theta }}^{(C)}\), intervals \({\tilde{\theta }}^{(I)}\), K-gaps \({\tilde{\theta }}^{(K)}\) and truncated \({\tilde{\theta }}^{(T)}\), in order to compare their performances through simulation and further on the analysis of real data. For a given selected pair (uK), we will assume the validity of condition \(D^{(K+1)}(u)\). In the case of the intervals estimator, only the IMT threshold selection will be used since it solely depends on the threshold choice.

There are other estimation methods of \(\theta\) entailing the choice of a single tuning parameter. Maxima methods as described in Gomes (Gomes 1993; Ancona-Navarrete and Tawn 2000; Northrop 2015) and more recently in Ferreira and Ferreira (2022) require the choice of a block length in order to generate a block maxima sequence from the original one. The two first references present methods that need to resample the original data to produce a sample of block maxima with approximate d.f. G. Northrop proposal in Northrop (2015) avoids this drawback by comparing the limiting GEV H of the maxima \(M_n\) of \(\pmb {X}\) directly to the marginal d.f. F. More precisely, for large enough n, we have \(H\approx F^{n\theta }\), thus \(Y=-n\log F(M_n)\) has exponential law with mean value \(1/\theta\). The Northrop estimator is based on the ML approach, considering the sample of block maxima \(\{M_{(i-1)b,ib},\,i=1,...,[n/b]\}\) of b consecutive values of \(\{X_1,...,X_n\}\) and estimating the unknown d.f. F by the respective empirical d.f.. This corresponds to the disjoint blocks estimator. The sliding blocks version of Northrop estimator is based on a sample of overlapping block maxima \(\{M_{i-1,i+b-1},\,i=1,...,n-b+1\}\), leading to

$$\begin{aligned} {\tilde{\theta }}^{(N)}=\left( \frac{1}{n-b+1}\sum _{i=1}^{n-b+1}Y_i\right) ^{-1}, \end{aligned}$$
(7)

with \(Y_i=-b\log {\hat{F}}(M_{i-1,i+b-1})\), \(i=1,...,n-b+1\). We will use the sliding blocks \({\tilde{\theta }}^{(N)}\) which compares favorably with the disjoint blocks (Northrop 2015). This will be denoted the Northrop estimator.

In Ferreira and Ferreira (2022) a new block maxima method was introduced to estimate the extremal index. It is based on a bivariate sequence \(\{(Y_{n,1}={X}^{*}_n,Y_{n,2}=(1/2){X}^{*}_n\vee (1/2)X_n)\}_{n}\,\) generated from the original \(\pmb {X}\) which is assumed to have standard Fréchet marginals and by an i.i.d. sequence \(\{{X}^{*}_n\}_{n}\) also having standard Fréchet marginals. Operator \(\vee\) stands for “maximum". It is proved that the component-wise maxima of sequence \(\{(Y_{n,1},Y_{n,2})\}_{n}.\) has a limiting bivariate extreme value copula \(C(u,v)=\min (uv^{\frac{\theta }{1+\theta }},v)\) with tail dependence coefficient

$$\begin{aligned} \lambda =\displaystyle \lim _{v\rightarrow 1^{-}}2-\frac{1-C(v,v)}{1-v} =\frac{1}{1+\theta }. \end{aligned}$$
(8)

leading to estimator

$$\begin{aligned} {\widetilde{\theta }}=\frac{1}{{\widetilde{\lambda }}\vee 1/2}-1. \end{aligned}$$
(9)

Algorithm: The estimation procedure follows the steps below:

  1. Step 1.

    Take the marginal transformation \(-\frac{1}{\log {\widetilde{F}}_{X}(X_i)}\), where \({\widetilde{F}}_{X}\) is an empirical d.f. of sample \(X_1,...,X_n\) with dimension n, in order to have approximately standard Fréchet marginals.

  2. Step 2.

    Generate an i.i.d. sequence with standard Fréchet d.f., \({X}^*_1,...,{X}^*_n\), and take \(({X}^*_i,(1/2){X}^*_i\vee (1/2)X_i)\), \(i=1,...,n\).

  3. Step 3.

    Choose the blocks length b to generate a bivariate sample of component-wise maxima, and estimate \(\lambda\) (see Ferreira and Ferreira 2022 and references therein for details). Here we consider sliding blocks \({\left( Z_{j,1},Z_{j,2}\right) =}\left( \bigvee _{i=j}^{j+b-1}{X}^*_i,\bigvee _{i=j}^{j+b-1}(1/2){X}^*_i\vee (1/2)X_i\right) ,\,1\le j\le n-b+1\).

  4. Step 4.

    Calculate \({\widetilde{\theta }}\) in (9).

  5. Step 5.

    Repeat steps 2–4 a large number R of times, obtain estimates \({\widetilde{\theta }}_{1},...,{\widetilde{\theta }}_{R}\) and estimate

    $$\begin{aligned} {\tilde{\theta }}^{(F)}=\frac{1}{R}\sum _{j=1}^{R}{\widetilde{\theta }}_{j} \end{aligned}$$
    (10)

    in order to achieve robustness given the existence of arbitrariness in the generation of a random sample (Step 2) in each estimate.

Step 4 is based on estimator (9 which requires an estimate of the tail dependence coefficient \(\lambda\). We follow the proposal of Ferreira and Ferreira (2022) with

$$\begin{aligned} {\widetilde{\lambda }}=3-\frac{1}{1-\frac{1}{n}\sum _{i=1}^{n}\left( {\widetilde{G}}_1(Z_{i,1})\vee {\widetilde{G}}_2(Z_{i,2})\right) }, \end{aligned}$$

where \({\widetilde{G}}_j\), \(j=1,2\), is an empirical distribution function of the GEV marginal \(G_j\) of \(Z_{1,j}\). For more details, see Ferreira and Ferreira 2022. In Ferreira and Ferreira (2022) it was considered \(R=10000\) and block maxima taken on disjoint blocks. Here we consider the sliding blocks approach as in the Northrop estimator. Some prior simulations lead us to the proposal that \(R=100\) is reasonable for a robustness of the method. This approach will be denoted Ferreira estimator.

In the following we provide a catalog of some distributions and their associated extremal indices. Additional lists of models and respective extremal indices are also exposed in Gomes and Neves (2015, 2020).

  • A first order auto-regressive with maximum operator (MAR), \(X_i=\max (\phi X_{i-1},\epsilon _i)\), \(i\ge 1\), \(X_0=\epsilon _1/(1-\phi )\), \(\{\epsilon _i\}\) i.i.d. with standard Fréchet marginals (Davis and Resnick 1989), for which \(\theta =1-\phi\). See, e.g., ( Leadbetter (1983)) and references therein;

  • A moving maxima \(X_i=\max _{j=0,...,d} a_jZ_{d-j}\) with \(\{Z_i\}\) i.i.d. standard Fréchet (MMFrec), where parameters \(a_j\ge 0\) and \(\sum _{j=0}^{d} a_j=1\) (Deheuvels 1983), for which \(\theta =\max _{j=0,...,d} a_j\) (see, e.g., Beirlant et al. (2004));

  • A Markov chain with standard Gumbel marginals and 1-lag bivariate logistic dependence (MCBEV), \(P(X_i\le x,X_{i+1}\le y)=\exp (-(x^{-1/\alpha }+y^{-1/\alpha })^{\alpha })\). Calculations of \(\theta\) for particular cases are found in Smith (1992);

  • An ARCH(1) process, \(X_i=(\beta + \lambda X_{i-1}^2)^{1/2}\epsilon _i\), with i.i.d. standard Gaussian innovations \(\{\epsilon _i\}\). (Embrechts et al. 1997) addresses the (not straightforward) extremal index computation of ARCH models;

  • A first order auto-regressive with Cauchy standard marginals (ARCau), \(X_i=\rho X_{i-1}+\epsilon _i\), \(\{\epsilon _i\}\) i.i.d. having Cauchy d.f. with mean 0 and scale \(1-|\rho |\). According to (Hsing and McCormick 1991), \(\theta =1-\rho\) if \(\rho \ge 0\) and \(\theta =1-\rho ^2\) if \(\rho <0\);

  • A first order auto-regressive negatively correlated uniform (ARUnif), \(X_i=-(1/r) X_{i-1}+\epsilon _i\), \(i\ge 1\), \(\{\epsilon _i\}\) i.i.d. where \(P(\epsilon _1=k/r)=1/r\) for \(k=1,...,r\), with \(X_0\sim U(0,1)\) independent of \(\epsilon _i\), having \(\theta =1-1/r^2\)

  • An AR(1) process, \(X_i=\phi X_{i-1}+\epsilon _i\), \(i\ge 1\), \(\{\epsilon _i\}\) i.i.d. N(0, 1), \(X_0\frown N(0,1/(1-\phi ^2))\), with \(\theta =1\);

These models will be used in the simulation study, in the next section.

3 Simulation study

In this section we analyze the estimation of the extremal index through simulation. We compare the performances of the runs (R) estimator in (2), the cycles (C) estimator in (4), the truncated (T) estimator in (6), the intervals (I) estimator of Ferro and Segers (2003), the K-gaps (K) estimator of Süveges (2010), along with the block maxima estimators of Northrop (N) in (7) and Ferreira (F) in (10). The first five estimators require the selection of a runs parameter and a threshold, except the intervals estimator only needing the choice of a threshold. To this end we apply the IMT method ( Süveges 2010; Fukutome and M.A. Süveges M. 2014; Fukutome et al. 2019) described in Sect. 2. The block maxima estimators require the settlement of a block length and no automation procedure is considered. In the study we take block lengths \(b=10,20,...,70\). The software( R Core Team 2020) was used and the R codes of estimators can be seen in https://github.com/msferreirauminho/msrf.

The simulation study is based on the following models: a first order max auto-regressive (MAR) process with standard Fréchet marginals and autoregressive parameter \(\phi =0.5\) ( Davis and Resnick 1989) satisfying condition \(D^{(2)}(u_n)\) (see, e.g.,Cai (2019)); a moving maxima (MMFrec) process with coefficients \(a_j=1/5\), \(j\in \{1,2,3,7,8\}\) ( Deheuvels 1983) for which \(D^{(5)}(u_n)\) holds (Ferreira and Ferreira 2018); a Markov chain (MCBEV) with standard Gumbel marginals and logistic joint distribution with dependence parameter \(\alpha =0.5\) (Smith 1992); an ARCH(1) process with Gaussian innovations, autoregressive parameter \(\lambda =0.5\) and variance parameter \(\beta =1.9\cdot 10^{-5}\) (Embrechts et al. 1997); an AR(1) process with Cauchy marginals and auto-regressive parameter \(\rho =-0.6\) ( Chernick 1978) and a negatively correlated uniform AR(1) process with \(r=2\) ( Hsing and McCormick 1991), respectively denoted ARCau and ARUnif and both satisfying condition \(D^{(3)}(u_n)\). The extremal index values of the processes MAR, MMFrec, MCBEV, ARCH, ARCau and ARUnif are 0.5, 0.2, 0.328, 0.835, 0.64 and 0.75, respectively. We also consider a classical first order AR(1) process with Gaussian marginals and auto-regressive parameter 0.5, here denoted AR, which is almost independent and satisfies condition \(D^{(1)}(u_n)\) having \(\theta =1\). As far as we know, there is no theoretical analysis on condition \(D^{(s)}(u_n)\) for MCBEV model and we mention an empirical evaluation conducted in Ferreira and Ferreira (2018). Cai (2019) proved that \(D^{(s)}(u_n)\) doesn’t hold for a particular ARCH model.

We consider 1000 replicas of each model and compute the mean, the absolute bias (abias), the root mean squared error (rmse) and the standard deviation (sd). Bootstrap confidence intervals were obtained through percentile method technique on time series. Confidence intervals were obtained through bootstrap percentile method technique on time series with fixed block length 20 ( Kunsch 1989; Politis and Romano 1994), except in the case of the intervals estimator where the bootstrap proposal in Ferro and Segers (2003) was used. In the case of the likelihood estimators (K-gaps and Northrop block maxima), the confidence intervals are based on the asymptotic Normality. In Ferreira sliding blocks estimator we considered percentiles 2.5 and 97.5 applied on the auxiliary estimates \({\widetilde{\theta }}_{j}\), \(j=1,...,R\), produced by the method in Step 5 of the Algorithm in Sect. 2. We present the the proportion of intervals in the simulations that included the true value of \(\theta\) (cov), the mean range width (rw) and the rate cov/rw corresponding to the proportion of coverage (cov) divided by the mean range width (rw). Some of the confidence intervals associated to Northrop sliding blocks failed to be computed because of the invalid standard error estimates which were accounted in column “NAs” of Table 2. The results for the runs, cycles, intervals, truncated and K-gaps estimators are presented in Table 1 and the estimates of Ferreira sliding blocks derived in (10) can be seen in Table 3. The rate cov/rw is plotted in Fig. 2 obtained for the runs, the cycles, the intervals, the truncated and the K-gaps estimators (left-top), for the Ferreira and Northrop sliding blocks estimators with block lengths \(b=10,20,...,70\) (right-top) and the third bottom plot includes all estimators where for each of the sliding blocks estimators we address the best scenario (corresponding to the block length with the estimated largest rate, denoted by B) and the worst scenario (where the block length choice led to the smallest estimated rate, denoted by W). Analogous plots are represented in Figs. 3 and 4 relating to abias and rmse, respectively.

Cases closer to the border values of the extremal index domain were also considered, namely, MAR(\(\phi =0.9\)) with \(\theta =0.1\) and MAR(\(\phi =0.1\)) with \(\theta =0.9\). In the almost independence Gaussian AR model with \(\theta =1\), besides parameter \(\phi =0.5\) which induces strong dependence, we also analyze the AR weaker dependence models AR(\(\phi =0.1\)) and AR(\(\phi =-0.1\)) where \(\theta\) is still unit but they are even more close of independence. See Tables 45 and 6.

The cycles (C), the runs (R) and K-gaps (K) estimators present a somewhat homogeneous performance across the various models, with the K-gaps estimator slightly better behaved. We recall that we are applying the IMT method in all estimators, except in the sliding blocks, which was developed under the K-gaps estimator. On the other hand, the intervals (I) and the truncated (T) estimators show some sensitivity to the different models: they perform very well in the MMFrec, MAR, MCBEV and ARCH, but their biases and rmse are high in the ARUnif model.

We can also see that the choice of the block-maxima size to be used in sliding blocks estimators is important as their behavior improve in the best block choices. Indeed, both Ferreira and Northrop sliding blocks estimators present the best overall performances along the different models under the best block choices. Both Northrop and Ferreira sliding blocks have to deal with a trade-off between bias (larger for small block-maxima lengths) and variance (increases with the block-maxima length). This can be observed in Tables 2 and 3. In practice one can plot estimates for several block-maxima sizes b and choose the smallest b above which estimates are approximately constant (Northrop 2015).

In the coverage rate (Fig. 2), it is observed that the K-gaps estimator presents an overall better performance. Yet, the coverage percentages (“cov") in Table 1 are not as large as would be desirable. This is particularly notorious in cases where estimates present larger rmse like AR model. In order to analyze the effect of bootstrap block-size choice on CI coverage, we have also applied the automatic block-size choice method developed in Politis and White (2004) and (Patton et al. 2009), available in R package blocklength Stashevsky 2022. We recall that the bootstrap CI requiring block-size selection was considered for the runs, cycles and truncated estimators. The results of the automatic block-size choice method are in Table 7 where we observe improvements for the truncated estimator, except in the ARCH model. On the other hand, the ARCH model benefits from the automatic method within the runs and cycles estimators. The MAR model with \(\theta =0.1\) also gains with the automated method. The Ferreira sliding blocks estimator presents both the highest coverage proportions (cov) and range widths (rw), leading to low coverage rates (“cov/rw"), as can be seen in Table 3 and Fig. 2. The compromise between both high coverage (“cov") and coverage rate (“cov/rw") points out the Northrop sliding blocks estimator as the best choice, particularly for larger block-maxima sizes.

The AR model with stronger dependence (i.e., dependence parameter \(\phi =0.5\)) presents the worst performance in all estimators (see, e.g., Figs. 23 and 4). Both sliding blocks estimators seem to be the most promising in this model, which has an extremal index equal to one and, therefore, a boundary value in the support of \(\theta\). However, the same is not true with weaker dependent AR models (i.e., with dependence parameter \(\phi =\pm 0.1\)), where the absolute bias and rmse are lower, particularly within intervals (I), truncated (T) and Northrop (N) estimators (Tables 45 and 6). The bootstrap confidence intervals of runs (R) and cycles (C) exhibit very small coverage percentages as well as the ones of K-gaps estimator based on ML, for all considered AR models. In the challenging cases of \(\theta\) with values close to the domain boundaries 0 and 1 through model MAR with autoregressive parameters \(\phi =0.1\) and \(\phi =0.9\), corresponding to \(\theta =0.9\) and \(\theta =0.1\), respectively, we observe that estimators of runs (R), cycles (C), K-gaps and Ferreira sliding blocks (F) tend to behave better for \(\theta =0.1\) than \(\theta =0.9\) while in the truncated (T) estimator the conclusion is opposite. The intervals (I) and Northrop sliding blocks (N) present an overall better performance in both situations.

Table 1 Simulation results obtained for the runs (R), cycles (C), intervals (I), truncated (T) and K-gaps (K): mean, absolute bias (abias), root mean squared error (rmse), standard deviation (sd), the coverage proportion of the true extremal index value within the estimated confidence intervals (cov), the intervals range width (rw) and the ratio between “cov" and “rw"
Table 2 Simulation results obtained for the Northrop (2015) sliding blocks estimator: mean, absolute bias (abias), root mean squared error (rmse), standard deviation (sd), the coverage proportion of the true extremal index value within the estimated confidence intervals (cov), the intervals range width (rw), the ratio between “cov" and “rw" and the number of replicates where the confidence intervals couldn’t be calculated (NAs)
Table 3 Simulation results obtained for the ( Ferreira and Ferreira 2022) sliding blocks estimator: mean, absolute bias (abias), root mean squared error (rmse), standard deviation (sd), the coverage proportion of the true extremal index value within the estimated confidence intervals (cov), the intervals range width (rw), the ratio between “cov" and “rw" and the number of replicates where the confidence intervals couldn’t be calculated (NAs)
Table 4 Simulation results of models MAR with \(\theta =0.1\) and \(\theta =0.9\), AR(\(\phi =0.1\)) and AR(\(\phi =-0.1\)), obtained for the runs (R), cycles (C), intervals (I), truncated (T) and K-gaps (K): mean, absolute bias (abias), root mean squared error (rmse), standard deviation (sd), the coverage proportion of the true extremal index value within the estimated confidence intervals (cov), the intervals range width (rw) and the ratio between “cov" and “rw"
Table 5 Simulation results of models MAR with \(\theta =0.1\) and \(\theta =0.9\), AR(\(\phi =0.1\)) and AR(\(\phi =-0.1\)), obtained for the ( Northrop 2015) sliding blocks estimator: mean, absolute bias (abias), root mean squared error (rmse), standard deviation (sd), the coverage proportion of the true extremal index value within the estimated confidence intervals (cov), the intervals range width (rw), the ratio between “cov" and “rw" and the number of replicates where the confidence intervals couldn’t be calculated (NAs)
Table 6 Simulation results of models MAR with \(\theta =0.1\) and \(\theta =0.9\), AR(\(\phi =0.1\)) and AR(\(\phi =-0.1\)), obtained for the Ferreira and Ferreira (2022) sliding blocks estimator: mean, absolute bias (abias), root mean squared error (rmse), standard deviation (sd), the coverage proportion of the true extremal index value within the estimated confidence intervals (cov), the intervals range width (rw), the ratio between “cov" and “rw" and the number of replicates where the confidence intervals couldn’t be calculated (NAs)
Table 7 Coverage proportion of the true extremal index value within the estimated bootstrap confidence intervals (cov), the intervals range width (rw) and the ratio between “cov" and “rw", considering automated choice of block length in Politis and White (2004) and Patton et al. (2009), within runs (R), cycles (C) and truncated (T) estimators
Fig. 2
figure 2

The ratio between the coverage proportion of the true extremal index value within the estimated intervals and the respective range width (“cover/range") obtained for: (left-top) the runs (R), the cycles (C), the intervals (I), the truncated (T) and the K-gaps (K); (right-top) the sliding blocks of ( Ferreira and Ferreira (2022)) (black) and of ( Northrop (2015), ) (grey), for block lengths \(b=10,20,...,70\); (bottom) the runs (R), the cycles (C), the intervals (I), the truncated (T) and the K-gaps (K), the sliding blocks of ( Ferreira and Ferreira (2022)) (black) and of ( Northrop (2015)) (grey), for block lengths corresponding to the largest “cover/range", denoted by B (from best) and with the smallest “cover/range", denoted by W (from worst)

Fig. 3
figure 3

The absolute bias (abias) obtained for: (left-top) the runs (R), the cycles (C), the intervals (I), the truncated (T) and the K-gaps (K); (right-top) the sliding blocks of (Ferreira and Ferreira (2022)) (black) and of Northrop (2015) (grey), for block lengths \(b=10,20,...,70\); (bottom) the runs (R), the cycles (C), the intervals (I), the truncated (T) and the K-gaps (K), the sliding blocks of Ferreira and Ferreira (2022) (black) and of Northrop (2015) (grey), for block lengths corresponding to the smallest “abias", denoted by B (from best) and with the largest “abias", denoted by W (from worst)

Fig. 4
figure 4

The root mean squared error (rmse) obtained for: (left-top) the runs (R), the cycles (C), the intervals (I), the truncated (T) and the K-gaps (K); (right-top) the sliding blocks of Ferreira and Ferreira (2022) (black) and of Northrop (2015) (grey), for block lengths \(b=10,20,...,70\); (bottom) the runs (R), the cycles (C), the intervals (I), the truncated (T) and the K-gaps (K), the sliding blocks of Ferreira and Ferreira (2022) (black) and of Northrop (2015) (grey), for block lengths corresponding to the smallest “rmse", denoted by B (from best) and with the largest “rmse", denoted by W (from worst)

4 Application

We consider the daily maximum temperatures in the months of July and August, from 2001 to 2021, collected at the climatologic station Abrantes in center of Portugal (in Celsius degrees) available at “SNIRH: Sistema Nacional de Informação dos Recursos Hídricos".Footnote 1 The data is plotted in Fig. 5, in which successive high temperatures are seen, which are typical in this inland city. The results in Table 8 are obtained through the application of IMT procedure, leading to threshold 37.7 and \(K=2\). Thus we assume \(D^{(3)}(u_n)\) dependence condition. Figure 6 represents the estimates of \({\tilde{\theta }}^{(R)}\), \({\tilde{\theta }}^{(I)}\), \({\tilde{\theta }}^{(C)}\). \({\tilde{\theta }}^{(T)}\) and \({\tilde{\theta }}^{(K)}\), for thresholds corresponding to quantiles from 0.8 to 0.99. The estimators give quite close results to each other, except the sliding blocks \({\tilde{\theta }}^{(F)}\) with larger values (Fig. 6, left). However, most of \({\tilde{\theta }}^{(F)}\) estimates are within the Northrop sliding blocks confidence bands (Fig. 6, right), which we use as reference according to the simulation study findings in Sect. 3. Our guess is that possible values for \(\theta\) range between 0.4 and 0.55.

Fig. 5
figure 5

Daily maximum temperature (in Celsius degrees) in the months of July and August, from 2001 to 2021, at the climatologic station Abrantes in the center of Portugal

Table 8 Estimation results obtained for daily maximum temperatures when applying the runs (R), cycles (C), intervals (I), truncated (T) and K-gaps (K) estimators based on IMT method which leads to the validity of \(D^{(3)}\) condition and the choice of threshold 37.7
Fig. 6
figure 6

Left: Estimates of \(\theta\) for daily maximum temperatures obtained with the runs (R), cycles (C), intervals (I), truncated (T) and K-gaps (K) estimators using thresholds corresponding to quantiles 0.8, 0.875, 0.9, 0.95, 0.975, 0.99, under the validity of \(D^{(3)}\) condition derived from IMT method, and estimates of \(\theta\) obtained from sliding blocks \({\tilde{\theta }}^{(F)}_{sl}\) and \({\tilde{\theta }}^{(N)}_{sl}\), for block sizes \(b=10,20,...,70\); Right: Sliding blocks estimates from \({\tilde{\theta }}^{(F)}_{sl}\) and \({\tilde{\theta }}^{(N)}_{sl}\), for block sizes \(b=10,20,...,70\), and \({\tilde{\theta }}^{(N)}_{sl}\) lower and upper 95% confidence bands

5 Discussion

The extremal index is a very important measure in inferring extreme values of time series. In addition to affecting the limiting law behavior of the maximum, it is also associated with a clustering effect of exceedances of high values that can have harmful consequences. The estimation of the extremal index is a long-standing subject in extreme value theory, and it still attracts the attention of researchers. Here we present a study that covers several estimators, from the classic runs estimator to the most recent methodologies in block maxima, such as ( Ferreira and Ferreira (2022)) work resorting the theory of bivariate extremes. This new approach is still at an early stage, and there is room to improve both the estimation methodology that requires the generation of auxiliary samples and the analysis of the asymptotic behavior of the estimator and obtaining confidence intervals. Finding the asymptotic variance of the extremal index estimators is a great challenge given the context of serial dependence. Thus the resampling methodologies appear as good alternatives. However the choice of bootstrap block length is a critical point of estimation. A careful analysis is still needed to ameliorate in practice the coverage probabilities which proved to be poor in some cases. The great advanced in computing capabilities that we are currently witnessing opens up good prospects for the implementation and development of techniques such as bootstrap or jackknife. The area of machine learning is also a whole new horizon waiting to be explored.