*2.2. The Standardized Precipitation Index (SPI)*

The SPI is an index by which we can evaluate wet and the dry spells for any region in the world. According to McKee et al. [7], drought has a beginning date, an end date, a drought intensity and a drought magnitude. The SPI quantifies the intensity of a drought or wet spell and is mathematically based on the cumulative probability of the precipitation amount recorded at each station.

A period of observation at one meteorological station was used to determine the parameters of scaling and the forms of precipitation probability density function:

$$\log(\mathbf{x}) = \frac{1}{\beta^a \Gamma(a)} \mathbf{x}^{a-1} e^{-\mathbf{x}/\beta} \text{ for } \mathbf{x} > 0 \tag{1}$$

where α and β are the shape and scale parameters respectively, *x* is the precipitation amount and Γ(α) is the gamma function. The gamma function is defined as follows:

$$
\Gamma(\mathfrak{a}) = \int\_0^\infty y^{\mathfrak{a}-1} e^{-y} \mathrm{d}y. \tag{2}
$$

The shape and scale parameters can be estimated using the approximation of Thom [30]:

$$\alpha = \frac{1}{4A} \left( 1 + \sqrt{1 + \frac{4A}{3}} \right),\tag{3}$$

and

$$
\beta = \frac{\overline{\overline{\mathbf{x}}}}{a'} \tag{4}
$$

with

$$A = \ln(\overline{x}) - \frac{\sum \ln(x)}{n},\tag{5}$$

where *x* is the mean value of the precipitation quantity; *n* is the precipitation measurement number; *x* is the quantity of the precipitation in a sequence of data.

The acquired parameters were further applied to determine the cumulative probability of a certain precipitation for a specific time period in a time scale of all the recorded precipitation. The cumulative probability can be presented as:

$$G(\mathbf{x}) = \int\_0^\mathbf{x} \mathbf{g}(\mathbf{x}) d\mathbf{x} = \frac{1}{\beta^a \Gamma(a)} \int\_0^\mathbf{x} \mathbf{x}^{a-1} e^{-\mathbf{x}/\beta} d\mathbf{x},\tag{6}$$

Since the gamma distribution is undefined for a rainfall amount *x* = 0, in order to take into account the zero values that occur in a sample set, a modified cumulative distribution function (CDF) must be considered.

$$H(\mathbf{x}) = q + (1 - q)G(\mathbf{x}),\tag{7}$$

with *G(x)* the CDF and *q* the probability of zero precipitation, given by the ratio between the number of zeros in the rainfall series (*m*) and the number of observations (*n*).

The calculation of the SPI is presented on the basis of the following equation [31,32]

$$\text{SPI} = \begin{cases} -\left(t - \frac{c\_0 + c\_1t + c\_2t^2}{1 + d\_1t + d\_2t^2 + d\_3t^3}\right)0 < \text{H}(\mathbf{x}) \le 0.5\\ + \left(t - \frac{c\_0 + c\_1t + c\_2t^2}{1 + d\_1t + d\_2t^2 + d\_3t^3}\right)0.5 < \text{H}(\mathbf{x}) \le 1.0 \end{cases} \tag{8}$$

where *t* is determined as:

$$t = \begin{cases} \sqrt{\ln\left(\frac{1}{\left(H(x)\right)^2}\right)} 0 < H(x) \le 0.5\\ \sqrt{\ln\left(\frac{1}{\left(1 - H(x)\right)^2}\right)} 0.5 < H(x) \le 1.0 \end{cases} \tag{9}$$

and *c*0, *c*1, *c*2, *d*1, *d*<sup>2</sup> and *d*<sup>3</sup> are coefficients whose values are: *c*<sup>0</sup> = 2.515517, *c*<sup>1</sup> = 0.802853, *c*<sup>2</sup> = 0.010328
