1 Introduction

Biological diversity, also known as biodiversity, is the variation among living organisms within a given habitat or ecosystem. Biodiversity boosts ecosystem productivity and all the species play an important role to this purpose. Thus, it is important to monitor the health and diversity of species over time, such as changes in size and distribution of population of species, habitats, and interactions among communities.

Measures of biodiversity are statistical summaries of the abundance vector, that is the vector of proportions of each species in the community, which helps to understand the condition of biodiversity and the variables affecting it. Two main factors are taken into account when measuring biodiversity: richness and evenness. Richness is a proxy of the number of different kinds of organisms living in the study area. The number of species, s, is a measure of richness and it is the easiest way to estimate biodiversity. Species richness does not take into account the number of individuals for each species. However, biodiversity does not only depend on richness, but also on evenness. Evenness compares the similarity of the population size of each of the species belonging to the same environment; it is a measure of the relative abundance of the different species constituting the richness of an area. Therefore a well-established diversity index must take into consideration both of these factors.

In the current practice, biodiversity measures are generally provided by Environmental Agencies as descriptive indices. However, along with the magnitude, it is also important to evaluate the degree of uncertainty underpinning a certain measure. In the paper we consider this problem. Firstly, we estimate biodiversity using the Gini index, the entropy and their effective number of species. Secondly, we propose to calculate confidence intervals for these measures using percentile, -t and accelerated bias-corrected percentile methods.

In Sect. 2 we describe the data that we will use throughout the paper as a motivating example. In Sect. 3 we provide a brief overview on biodiversity measures, focusing in particular on the Gini–Simpson and the Shannon–Wiener diversity indices. In Sect. 4 we put forward a brief snapshot on the methods to calculate bootstrap confidence intervals that we will employ in the application. In Sect. 5 we present the results of our work and in Sect. 6 we provide a simulation study to support our conclusions, which are presented in Sect. 7.

2 Motivating example

We present biodiversity measures for Northern Ireland seabirds, which are a useful and important indicator to assess the state of the marine environment; in fact, they essentially represent the top of the food chain. They react to a range of factors such as modification in food availability, climate change, predation and pollution. For this reason, they have been studied by the Joint Nature Conservation Committee (JNCC) Seabird Monitoring Program, launched in 1986 in the UK and Ireland. This Program has provided high-quality datasets of population counts and demographic parameters.

The species composition may change over the years depending on the quality and quantity of data for each species. The database includes counts from the 1980s to the present and updates are provided annually. Data are available online at (http://jncc.defra.gov.uk/page-4460).

3 Biodiversity measures

3.1 Properties of a biodiversity index

In order to study the biodiversity of a system, let’s suppose to have collected a sample of n individuals of s different species. Let \((n_{1} ,n_{2} , \ldots ,n_{s} )\) be the frequencies abundance vector, where n i is the number of individuals belonging to the species \(i \,(i = 1, \ldots ,s)\), with

$$\mathop \sum \limits_{i = 1}^{s} n_{i} = n$$

and \(p = (p_{1} ,p_{2} , \ldots ,p_{s} )\) be the proportions abundance vector, with p i representing the probability that an individual selected randomly from a population belongs to the species i, defined as

$$p_{i} = n_{i} /n$$

so that

$$\mathop \sum \limits_{i = 1}^{s} p_{i} = 1 .$$

A biodiversity index I is a statistical measure that summarizes the relative abundance vector p, \(I(p) = I(p_{1} ,p_{2} , \ldots ,p_{s} )\), with the following essential properties (see for instance Frosini 2006):

  1. 1.

    \(I(p)\) is non-negative and zero-indifferent function. We recall that a generic function \(I_{s} (p)\) of the vector p of size s, is zero-indifferent if

    $$I_{s} \left( {p_{1} , \ldots ,p_{s} } \right) = I_{s + t} \left( {p_{1} , \ldots ,p_{s} ,0, \ldots ,0} \right)$$

    for \(t > 0\).

  2. 2.

    The index \(I(p)\) is minimum when all the individuals belong to a single species i, that is to say

    $$\exists i \le s\quad p_{i} = 1\quad {\text{and}}\quad p_{j} = 0 \quad\forall j \ne i.$$
  3. 3.

    The index \(I(p)\) is maximum when the species are equally common:

    $$p_{i} = \frac{1}{s}\quad \forall i$$
  4. 4.

    The maximum value

    $$f\left( s \right) = \hbox{max} \left[ {I_{s} \left( p \right)} \right]$$

    represents a strictly increasing function \(f(s)\) of the number of species s: the higher the value of s, the higher the maximum value, emphasizing the key role played by s in any measure of biodiversity.

3.2 Biodiversity indices

All the indices satisfying the above properties are called biodiversity indices. In the statistical literature different diversity indices have been proposed, satisfying different assumptions. The simplest diversity index is the species richness, namely s, which expresses the number of species present in an environment:

$$s = s(p) = \# (p_{i} > 0).$$

This is a straightforward and intuitive index, but it lacks of information with respect to the evenness of the distribution. The most widely used measures of biodiversity that take into account both abundance and evenness of species present in the community are the Gini–Simpson and the Shannon–Wiener indices.

3.3 Gini–Simpson diversity index

The Gini–Simpson index was introduced by Gini (1912) as a concentration index and it was proposed as a measure of biodiversity by Simpson (1949). Let’s first introduce the probability that two individuals randomly selected from a sample belong to the same species:

$$D(p) = \mathop \sum \limits_{i = 1}^{s} p_{i}^{2}$$

The value of \(D(p)\) ranges between 0 and 1: 0 represents maximum diversity and 1 indicates absence of diversity. So, the higher the value of \(D(p)\), the lower the diversity. The Gini–Simpson diversity index is obtained as:

$$E(p) = 1 - D(p) = 1 - \mathop \sum \limits_{i = 1}^{s} p_{i}^{2}$$
(1)

and represents the probability that two individuals, randomly selected from a sample, belong to different species. Now, the higher the value of this index, the higher the diversity. The index varies between 0 and 1 and reaches its maximum value when all individuals belong to a single species, i.e.:

$$\exists i\,\le\,s \quad p_{i} = 1.$$

Moreover, under the constraints:

$$\mathop \sum \limits_{i = 1}^{s} p_{i} = 1;\quad0\,\le\,p_{i}\,\le\,1$$
(2)

its maximum value is:

$$\hbox{max} \left[ {E(p)} \right] = \frac{s - 1}{s}$$

corresponding to the case in which all species are equally distributed. In the ecological context, the Gini–Simpson diversity index is viewed as a dominance index because it attributes more weight to common or dominant species. In particular, the weight that the Gini index gives to each species is \(1 - p_{i}\). Hence for a rare species, the value of p i is very low (close to zero), and the associated weight will be closed to one. So, the presence of rare species causes only small changes in the value of the index.

3.4 Shannon–Wiener diversity index

The Shannon–Wiener diversity index (Shannon 1948; Shannon and Weaver 1949; Wiener 1949), also known as entropy, is a popular diversity index in the ecological literature and it is given by:

$$H(p) = - \mathop \sum \limits_{i = 1}^{s} p_{i} { \log }(p_{i} )$$
(3)

where log denotes the natural logarithm.

The entropy quantifies the uncertainty in predicting the species identity of an individual selected at random from the dataset. This uncertainty increases as the number of species increases and as the individuals are distributed more evenly among the species. A high value of \(H(p)\) would be representative of a diverse and equally distributed community and lower values show a less diversity community. A value of 0 would represent a community with just one species (where conventionally \(0{ \log }0 = 0\)). Moreover, under the constraint (2), the maximum value of \(H(p)\) occurs when each species in the community has the same frequency \(p_{i} = 1/s\):

$${ \hbox{max} }(H(p)) = { \log }(s).$$

In contrast with the Gini–Simpson index, the Shannon–Wiener diversity index is particularly sensitive to the number of rare species in a community, i.e., those species characterized by extremely low relative frequency. In this case, the weight that the entropy gives to each species is \({ \log }(p_{i} )\).

3.5 Normalization of diversity indices

It is worth observing that normalization should not be used in the context of biodiversity measures because it removes the effect of the number of species, which is instead of interest in this framework. More precisely, a normalized diversity index does not satisfy property 4 of Sect. 3.1.

3.6 Effective number of species

Diversity indices have a wide variety of range and behaviors. If we apply them to an equally distributed community of s species, each index would return a different value (e.g., s, \(1 - 1/s\), \({ \log }(s)\)). One might expect that the diversity of an equally distributed population of 10 species is twice the diversity of an equally distributed population of 5 species. However, this does not happen using diversity indices. That is the reason of the introduction of the effective number of species.

Given a system with s species with biodiversity measured by the index I s , the effective number of species, r, is obtained by solving the equation:

$${ \hbox{max} }(I_{r} ) = I_{s}$$

with solution

$${\text{r}} = f^{ - 1} (I_{s} )$$

satisfying properties 1–4 of Sect. 3.1, because of the strict monotonicity of the function f.

To derive the effective number of species for the Gini–Simpson index, we need to solve with respect to r the equation:

$$\hbox{max} (E_{r} (p)) = 1 - \frac{1}{r} = E_{s} (p)$$

The solution is the Laakso–Taagepera index (Laakso and Taagepera 1979):

$${\text{F}}({\text{p}}) = \frac{1}{{1 - E_{s} (p)}} = \frac{1}{{\mathop \sum \nolimits_{i\,=\,1}^{s} p_{i}^{2} }}$$

Similarly, solving the equation:

$$\log ({\text{r}}) = \hbox{max} \left[ {H_{r} ({\text{p}})} \right] = H_{s} (p)$$

The effective number of species for the Shannon–Wiener index is given by:

$${\text{L(}}p )= \exp \left[ {H_{s} (p)} \right] = \mathop \prod \limits_{i = 1}^{s} p_{i}^{{ - p_{i} }}$$

and it is called Leti diversity index (Leti 1983).

4 A snapshot on bootstrap confidence intervals

In this article we use three different methods to calculate bootstrap confidence intervals (CI): the percentile, the -t and the accelerated bias-corrected percentile. For a comprehensive description of these methods, we refer the reader to Carpenter and Bithell (2000) and to Tu and Shao (1995). In particular, we have drawn \(B = 1000\) samples with replacement of size n from our vector of data \((x_{1} , \ldots , x_{n} )\) with \(x_{i} = k\) if the individual i belongs to the species k (for \(i = 1, \ldots ,n\) and \(k = 1, \ldots ,s\)), that is to say, we have considered B bootstrap samples from a Multinomial distribution with parameters n and \(p = (p_{1} ,p_{2} , \ldots ,p_{s} )\).

4.1 Bootstrap percentile CI

The bootstrap percentile CI represents the simplest way to calculate accurate bootstrap CI. Let \(\hat{\vartheta }_{n}\) be an estimator for the parameter \(\vartheta\) and \(\hat{\vartheta }_{n}^{*}\) the bootstrap estimator based on a bootstrap sample \((x_{1}^{*} , \ldots , x_{n}^{*} )\), so that \(\hat{\vartheta }_{n}^{*} = \hat{\vartheta }(x_{1}^{*} , \ldots , x_{n}^{*} )\). If we define the distribution function of \(\hat{\vartheta }_{n}^{*}\) as

$${\text{G}}^{*} ({\text{t}}) = {\text{P}}(\hat{\vartheta }_{n}^{*} \le {\text{t}})$$

then the bootstrap percentile method returns the CI

$$[\vartheta_{\alpha }^{*} ,\vartheta_{1 - \alpha }^{*} ]$$

where \(\vartheta_{\alpha }^{*}\) is the \(\alpha -\) quantile of the bootstrap version of \(\hat{\vartheta }_{n}^{*}\):

$$\vartheta_{\alpha }^{*} = G^{* - 1} \left( \alpha \right) = inf\left\{ {t \in {\mathbb{R}}:G^{*} (t)\,\ge\,\alpha } \right\}.$$

Hence, we can approximate the distribution function \(G^{*}\) with the empirical distribution function \(G_{B}\) of the B bootstrap replications.

4.2 Bootstrap-t CI

With this method we need to calculate a bootstrap version of the estimator \(\hat{\vartheta }_{n}\), i.e., \(\hat{\vartheta }_{n}^{*} = \hat{\vartheta }(x_{1}^{*} , \ldots , x_{n}^{*} )\), as well as a bootstrap version of the standard deviation of the estimator \(\hat{\vartheta }_{n}\)

$$\hat{\sigma }_{\alpha }^{*} = \hat{\sigma }(x_{1}^{*} , \ldots ,x_{n}^{*} ).$$

So, if the “studentized” statistic

$$T_{n}^{*} = \frac{{\hat{\vartheta }_{n}^{*} - \hat{\vartheta }_{n} }}{{\hat{\sigma }_{n}^{*} }}$$

is pivotal, then the bootstrap-t CI for \(\vartheta\) with nominal level \((1 - 2\alpha )\) is given by

$$[\hat{\vartheta }_{n} - t_{1 - \alpha }^{*} \hat{\sigma }_{n} ,\hat{\vartheta }_{n} - t_{\alpha }^{*} \hat{\sigma }_{n} ]$$

where \(t_{\alpha }^{*}\) is the \(\alpha -\) quantile of the bootstrap version of the “studentized” statistic.

Differently from the percentile method, the bootstrap-t involves a deviance estimate, \(\hat{\sigma }_{n}\). However, it is possible to obtain such an estimate, using a second-level bootstrap: for each bootstrap sample \((x_{1}^{*} , \ldots , x_{n}^{*} )\), we generate \(M = 100\) additional bootstrap samples to calculate the usual sample variance. Consequently, such a double bootstrap method is computationally more intensive than the percentile bootstrap.

4.3 Bootstrap accelerated bias-corrected percentile CI

The bias-corrected accelerated (BCa) bootstrap is a generalization of the percentile method introducing the two constants \(z_{0}\) (bias correction) and a (acceleration) in order to adjust for bias and skewness of the bootstrap distribution. Consider an increasing function h, and the transformation \(\hat{\eta }_{n} = h(\hat{\vartheta }_{n} )\) with standard deviation \(\sigma = 1 + a\eta\), such that

$$P\left( {\frac{{\hat{\eta }_{n} - \eta }}{\sigma }\,+\,z_{0}\,\le\,z} \right) = H(z)$$

where H is a continuous, strictly increasing and symmetrical transformation (e.g. the standard normal distribution function). Thus, a CI for the parameter \(\vartheta\) with nominal level \((1 - 2\alpha )\) is given by

$$[\vartheta_{\alpha } ,\vartheta_{1 - \alpha } ]$$

where

$$\vartheta_{\alpha } = h^{ - 1} \left( {\hat{\eta }_{n} + \frac{{z_{0} + z_{\alpha } }}{{1 - a\left( {z_{0} + z_{\alpha } } \right)}}\hat{\sigma }_{n} } \right)$$
$$z_{\alpha } = H^{ - 1} (\alpha )$$
$$\hat{\sigma }_{n} = 1 + a\hat{\eta }_{n}$$

Under these assumptions it is possible to derive the equalities:

$$G^{*} \left( {\vartheta_{\alpha } } \right) = \left( {z_{0} + \frac{{z_{0} + z_{\alpha } }}{{1 - a\left( {z_{0} + z_{\alpha } } \right)}}} \right)$$
$$z_{0} = H^{ - 1} (G^{*} (\hat{\vartheta }_{n} ))$$

where

$${\text{G}}^{*} \left( t \right) = P(\hat{\vartheta }_{n}^{*}\,\le\,t)$$

is the distribution function of the bootstrap version of \(\hat{\vartheta }_{n}\). So, the quantiles:

$$\begin{aligned} \vartheta_{\alpha }^{*} &= G^{* - 1} \left( {H\left( {z_{0} + \frac{{z_{0} + z_{\alpha } }}{{1 - a\left( {z_{0} + z_{\alpha } } \right)}}} \right)} \right) \hfill \\ &= inf\left\{ {t \in {\mathbb{R}}:G^{*} (t)\,\ge\,H\left( {z_{0} + \frac{{z_{0} + z_{\alpha } }}{{1 - a\left( {z_{0} + z_{\alpha } } \right)}}} \right)} \right\} \hfill \\ \end{aligned}$$

lead to the \((1 - 2\alpha )\) BCa CI for the parameter \(\vartheta\):

$$\left[ {\vartheta_{\alpha }^{*} ,\vartheta_{1 - \alpha }^{*} } \right].$$

According to Efron (1987), we have estimated the bias correction and the acceleration by using the suitable function implemented in R.

5 Results

5.1 Descriptive analysis

Data from the JNCC are available for five countries (England, Scotland, Wales, Ireland, Northern Ireland). To the purposes of this application, we will focus only on Northern Ireland data. The practice of considering separately ecological data from different GB countries is particularly recommendable, being the territory very large and characterized by geographic areas being climatically and morphologically very different.

We remark that JNCC data are described through different labels, which indicate, in particular, the adjustment and the accuracy of the counting method. For these details, we refer the reader to the explanation available online. In this paper, we consider seven species of seabird (excluding three species with very low and not reliable counts) and we only take into account entries labeled as “accurate”.

We show results for the period 2006–2009, calculating the Gini–Simpson index (\(E(p)\)), the Shannon–Wiener index (\(H(p)\)) and the corresponding effective number of species, given by the Laakso–Taagepera index (\(F(p)\)) and the Leti diversity index (\(L(p)\)). Table 1 shows the total observations per year, and Table 2 shows the diversity indexes per year.

Table 1 Total counts of seabirds in Northern Ireland, period 2006–2009
Table 2 Diversity indices values, period 2006–2009

From Table 2 it does emerge a very similar trend between the two indices \(E(p)\) and \(H(p)\), as well as between the effective number of species \(F(p)\) and \(L(p)\), with a slightly decline over 2006–2008 and a recovery in 2009. We recall that the indices \(F(p)\) and \(L(p)\) represent the number of equally common species which would produce the value of the index that it has been really observed. For the Gini–Simpson index this value is between three and six species, while for entropy is between six and nine species. This happens as the entropy attributes larger weight to rare species than the Gini–Simpson index.

5.2 Comparison of confidence intervals

In Fig. 1 we show CI for the E(p) index across years, as obtained by means of the three bootstrap methods. The same analysis has been done with index H(p) (Fig. 2), index F(p) (Fig. 3) and index L(p) (Fig. 4).

Fig. 1
figure 1

Confidence intervals in the period 2006–2009 for the three bootstrap methods -t, percentile and BCa associated with the E(p) index

Fig. 2
figure 2

Confidence intervals in the period 2006–2009 for the three bootstrap methods -t, percentile and BCa associated with the H(p) index

Fig. 3
figure 3

Confidence intervals in the period 2006–2009 for the three bootstrap methods -t, percentile and BCa associated with the F(p) index

Fig. 4
figure 4

Confidence intervals in the period 2006–2009 for the three bootstrap methods -t, percentile and BCa associated with the L(p) index

Three main results pop out from our analysis. First, the width of the bootstrap CI obtained for the four measures of diversity considered is very small, and the confidence bounds calculated adopting different bootstrap methods is very similar. Second, we can notice that results obtained with the percentile method and with BCa are very close. This might indicate that, in this context, the BCa procedure does not provide a compelling advantage. Third, occasional differences do emerge by comparing the bootstrap-t method with the other two methods. This is reasonable, as the -t method is indeed conceptually different as compared to the percentile procedures. We may observe that, in terms of length of the CI, the bootstrap-t provides results sometimes better (e.g., for the index \(E(p)\)—year 2007, or for the index \(H(p)\) for year 2009), and sometimes worse (e.g., \(E(p)\) index, for the year 2008, or \(H(p)\) for the year 2006) than those obtained with the other methods.

6 A simulation study

In order to support our conclusions, a simulation study was performed. A new population \((n_{1} ,n_{2} , \ldots ,n_{s} )\), of \(s = 25\) groups, was generated from a uniform distribution in the interval [0, 1000], where \(n_{i}\) is the number of elements belonging to the group \(i (i = 1, \ldots ,s)\). The relative abundance vector \(p = (p_{1} ,p_{2} , \ldots ,p_{s} )\) was obtained from the population, with \(p_{i} = n_{i} /n\) and the population size \(n = \mathop \sum \limits_{i = 1}^{s} n_{i}\).

We applied the three bootstrap techniques, percentile, -t and BCa to the new population, resampling from a multinomial distribution with parameters n, the population size and p, the relative abundance vector. For each method, Gini and Entropy indices were calculated and \(B = 1000\) bootstrap replications were generated, and for the deviance estimation in the bootstrap-t, \(M = 100\) second level bootstrap samples were used. Table 3 shows the results, which are very similar to those obtained with JNCC data. In particular, the widths of the bootstrap CI are very small for the three methods and very close together for both of the indices.

Table 3 Simulation study: Gini and Entropy index values and CI widths for each bootstrap method

7 Conclusions

In this paper, we have considered two indices of biodiversity commonly used in the context of ecological applications, such as the Gini–Simpson index and the Shannon–Wiener index. In addition, we have considered the effective number of species corresponding to these indices and given by the Laasko–Taagepera and the Leti diversity indices, respectively. Even though these indices are frequently adopted in ecological reports, it is not still in use the practice of showing the indices along with a measure of uncertainty, such as that provided by a CI.

Bootstrap methods represent a useful tool to estimate CI in case of complex indices, such as those previously described. In this paper we have considered three different techniques: percentile, bootstrap-t and BCa. Our simulations have shown that all three methods lead to quite convergent and consistent results, with the only exception, in some cases, of the -t method. Following these results we might recommend practitioners to adopt, in this context, the percentile method, as it is not computationally demanding and it is as well less demanding in terms of theoretical assumptions. More generally, these findings are in agreement with some simulation studies provided by Carpenter and Bithell (2000) and Tu and Shao (1995).