Mathematically, the SPI (McKee et al., 1993) calculation for any location is based on a long-term precipitation record for a desired period. Daily NCEP/NCAR precipitation rate (kg m-2 s-1) reanalysis, which are available online from 1948 up to now over the entire terrestrial globe, is suitable to provide adequate time series. Downloaded data are archived at
ISPRA, and updated monthly with newly-available reanalyses. In order to calculate SPI at different timescales, series of 3-monthly, 6-monthly, 12-monthly and 24-monthly averaged precipitation are built for any gridpoint in the considered domains.
For each grid point, the long-term record is fitted to a probability distribution. Thom (1966) found that the gamma distribution fits well this climatological precipitation time series.
Given X the precipitation time series, for each x > 0 the gamma distribution is defined as:

where α (>0) is a shape parameter, β (>0) is a scale parameter and Γ(α) is the gamma function. The fitting is performed by optimally estimating the alpha and beta parameters by means of the maximum likelihood method:

where:
and n is the total number of precipitation observations. Thus, the longer the period used to calculate the distribution parameters, the more likely you are to get better results. For this reason the NCEP/NCAR precipitation reanalysis data, which is available since 1948 (about 60 years), seem to be an optimal choice to perform the drought monitoring at European scale. Therefore, this long time period (1948-2007) is useful to calculate the parameters of the gamma distribution. The cumulative probability is then given by:
.
However, since the gamma distribution is not defined for x equal to zero and the precipitation distribution may contain zeros, the cumulative distribution is redefined as follows:

where q is the probability of a zero precipitation that can be estimated as the ratio between the number of zeros in the precipitation time series (m) and the total number of precipitation observations: m/n.
The cumulative distribution H(x) is then transformed into a normal distribution (Panofsky and Brier, 1958) so that the mean SPI for the location and desired period is zero (Edwards and McKee, 1997). The transformation allows maintaining the probability of being less than a given value of the variate from the gamma distribution the same of the probability of being less than the corresponding value of the transformed normally distributed variate.
Conceptually, SPI represents the number of standard deviations above or below that an event is from the mean. Thus, the unit of the SPI can be considered to be “standard deviations”. Standard deviation is often described as the value along a standard normal distribution at which the cumulative probability of an event occurring is 0.1587. In a like manner, the cumulative probability of any SPI value can be found, and this will be equal to the cumulative probability of the corresponding rainfall event.
It is now clear how SPI can effectively represent the precipitation amount over a given time scale, with the advantage that it provides not only information on the amount of rainfall, but that it also gives an indication of what this amount is in relation to the normal, thus leading to the definition of whether a monitored grid point is experiencing drought or not.
Further details on SPI, in particular on the mathematics used in the calculation, may be found, for instance, in the chapter 3 of Dan Edwards’ Master Thesis available online at the Colorado Climatic Center website (http://ccc.atmos.colostate.edu/pub/spi.pdf).
Bibliography
Edwards, D. C., and T. B. McKee, 1997: Characteristics of 20th century drought in the United States at multiple time scales. Climatology Rep. 97–2, Department of Atmospheric Science, Colorado State University, Fort Collins, Colorado, 155 pp.
McKee, T. B., N. J. Doesken, and J. Kleist, 1993: The relationship of drought frequency and duration of time scales. Eighth Conference on Applied Climatology, American Meteorological Society, Jan 17-23, 1993, Anaheim CA, pp. 179-186.
Panofsky, H. A., and G. W. Brier, 1958: Some applications of statistics to meteorology. Pennsylvania State University, University Park, 224 pp.
Thom, H. C. S., 1966: Some methods of climatological analysis. WMO N. 199. Technical Note N. 81., Ginevra, 53 pp.