This paper presents a tool for calculating the Palmer Drought Severity Index (PDSI) and associated drought indices. The PDSI is a widely used drought index, yet the complexity and lack of transparency associated with the calculation of the PDSI makes it difficult for a researcher to independently calculate the index. Researchers are often forced to use PDSI values supplied by the National Climatic Data Center (NCDC) of the National Oceanic and Atmospheric Administration (NOAA) or some other third party. The MATLAB tool presented here is easy to use, thoroughly documented, and transparent. The tool was developed by checking an independently developed code against NCDC's FORTRAN code. Discrepancies between the MATLAB tool and the NCDC code are documented. Researchers using the tool will be able to easily calculate the Palmer drought indices for data inputs of any length and at any spatial scale.
 Drought affects every region and every climate—from tropical rice paddies in Asia, to the historic cities of continental Europe, to the Great Plains of the United States. Yet, what drought means to a Sri Lankan rice farmer may be completely different than a Nebraskan corn farmer's idea of drought. A means of quantifying drought in a spatially comparable manner is needed for a variety of uses, including emergency management, policy decisions, and academic research.
 Originally developed in the 1960s by Wayne Palmer [Palmer, 1965], the Palmer Drought Severity Index (PDSI) provides a method for quantifying, and comparing, drought across different regions. Four inputs are needed for the calculation of the PDSI: temperature, precipitation, latitude of the location of interest, and the available water capacity (AWC) of the soil, which is a constant also known as the field capacity. The four inputs are used to compute a water balance for the area of interest, which then serves as the basis for the calculation of the PDSI. For a detailed explanation of the calculation of the PDSI, see Alley .
 In addition to the PDSI, other Palmer drought indices include the Z-Index, the Palmer Hydrological Drought Index (PHDI), and the Palmer Modified Drought Index (PMDI) [Palmer, 1965; Karl, 1986; Heddinghaus and Sabol, 1991]. The PMDI is the operational version of the PDSI. When forecasting off historic values, care should be taken to differentiate between the PDSI and PMDI. The Z-Index and PHDI are computed during the calculation of the PDSI.
 All three Palmer indices are widely reported and used, both in the United States and internationally [Karl and Heim, 1990; Dai et al., 2004; Dai, 2011; D'Arrigo and Wilson. 2008]. The National Oceanic and Atmospheric Administration (NOAA) reports weekly values for the three indices on a climatological division scale. Historic monthly values on the division scale are available through NOAAs National Climatic Data Center (NCDC) climate monitoring website (http://www1.ncdc.noaa.gov/pub/data/cirs/).
 While the PDSI is widely used, a number of problems have been noted. Alley , Karl [1983, 1986], Guttman  and Guttman et al.  have all noted issues with the sensitivity of the PDSI to the potential evapotranspiration (PET) equations and calibration periods, as well as the lack of true spatial comparability.
 In addition to the more technical objections to use of the PDSI, there are also two general problems that seriously impede its use: computational complexity and a lack of transparency. As outlined in Alley , there are a multitude of computations required, many of which follow somewhat ambiguous procedures. Most of the studies that make use of the PDSI do not provide the methods of calculation, so it is difficult to compute the PDSI independently when doing research. Various computer codes for the calculation of the PDSI are available online, but they lack transparency and can often be difficult to use.
 Researchers are thus forced to use PDSI values supplied by NOAA, NCDC, or some other party. Since the supplied values are only available for the continental U.S., and usually at the climatological division scale, a researcher is out of luck if her area of interest is abroad or at a smaller scale. By using the tool presented here to calculate the PDSI for individual climate stations, Duncan et al. (manuscript in preparation) have demonstrated differences between the supplied climatological division PDSI value and calculated station values within the same division.
 In order to make the PDSI more accessible to those who wish to make us of it, we present an easy to use, well documented, and transparent MATLAB tool for calculating the monthly PDSI, PHDI, and Z-Index at any spatial scale and any location.
 An initial version of the tool was created after consulting the available literature that gave details about the calculation processes [Palmer, 1965; Alley, 1984; Steinemann, 2003; Karl, 1986; Heddinghaus and Sabol, 1991]. This version of the code was able to replicate the example table (Table 12) given in Palmer . To test the robustness of the tool, the NCDC FORTAN code (available at ftp://ftp.ncdc.noaa.gov/pub/software/palmer/pdi.f) for computing the PDSI was run using data from a number of climate divisions in climatically diverse regions of the country. The same climate division data was then run through our MATLAB tool, and the two sets of PDSI values were compared.
 Discrepancies between the two sets of PDSI values were addressed in a methodical manner. Working up from the water balance, through the Z-Index, and finally to the PDSI calculation, two discrepancies were found that resulted in a difference between the MATLAB tool values and NCDC values. One discrepancy is that the NCDC code makes use of a transformed Thornthwaite PET equation [Hobbins et al., 2008]. Justification for the use of this transformed equation could not be found in the literature. Our MATLAB code uses PET equations found in Thornthwaite  and Hamon .
 The other discrepancy is in the water balance calculation (Note: The NCDC code was changed in April 2013 to use equation (1) instead of equation (2)). Calculation of the PDSI relies on a water balance based on a two-bucket system, where there is a surface layer with a storage capacity of 1 in. and an underlying layer with a storage capacity of AWC—1 in. During months where PET exceeds precipitation and where the difference between PET and precipitation exceeds the 1 in. stored in the surface layer, evaporative losses in the underlying layer are expected to occur. These losses are given by
where LU is the loss from the underlying layer, PE is potential evapotranspiration, P is precipitation, LS is the loss from the surface layer, SU is the amount of water stored in the underlying layer at the start of the month, and AWC is the combined moisture capacity of both layers [Alley, 1984]. NCDC adds an additional inch to the AWC, making the equation
 A justification for this change could not be found, but there appears to be little physical reasoning behind it. While adding an inch to the denominator of one equation seems to be a minor change, doing so has an effect on the PDSI values generated later. Our MATLAB code uses equation (1) when computing the water balance. For researchers interested in replicating the NCDC results, our tool can easily be modified, following directions in the user manual, to run in exactly the same manner as the NCDC program.
 The effect of the two deviations from the NCDC code was evaluated by calculating the monthly PDSI for 117 years (1895–2011) for five climatically different climatological divisions (AL-1, AZ-5, KS-5, WA-1, and NY-2) and comparing them against the published PDSI values from the NCDC archives.
 The tool executes a series of events loading the required inputs, calculating the water balance, calculating the Z-Index, and finally calculating the PDSI and PHDI (Figure 1). PDSI_Central, the main function within the PDSI code, launches five subfunctions when appropriate (Figure 2). Due to the sensitivity of the PDSI to its calibration coefficients outlined by Karl , the tool includes the option to use either the NCDC calibration period or the full record as a calibration period. Since the PET calculation method can perform differently in different climates [van der Schrier et al., 2011; Lu et al., 2005], multiple PET calculation methods are also provided.
 Differences between our results and the NCDC values were analyzed by calculating the root-mean-square error (RMSE) between them, computing the percentage of observations where the sign of the PDSI values were opposite, and finding the percentage of observations where the absolute value of the difference between the values was greater than one (Table 1). A runs test was also performed on the differences between our results and the NCDC values to determine any persistence in the differences. The null hypothesis of a random order of positive and negative differences was rejected at the p = 0.05 level for all five climate divisions. Differences for AL-1, AZ-5, and WA-1 were biased negatively, while differences for KS-5 and NY-2 were biased positively.
Table 1. Differences Between Results From the MATLAB Tool and NCDC Values
Opposite sign (%)
Difference more than one (%)
 Based on a graphical user interface, our MATLAB tool for calculating the Palmer drought indices requires minimal computer skill, and the code is well commented and documented to improve understanding of the underlying processes. Although there are minimal differences between the code in our tool and the NCDC code, our code accurately reflects the literature, which results in increased transparency and ease of use. Despite the differences between our tool and the NCDC values, the differences in results are small enough that the two can still be compared if one wishes to do so. With an easy to use method of calculating the PDSI and its associated indices, scientists and policy makers can easily quantify drought and use those numbers in research or policy decisions. The increased transparency this tool provides also allows users to better understand the processes involved in the calculation of the PDSI.
 We would like to thank Bill Alley for the material and support he provided in this effort. The work was partially supported by an EPA STAR Fellowship (DP), EPA FP917358, a Department of Energy grant (LLD), DE-FC01–06EW07053, and by a grant from the National Science Foundation (GH, JJ), NSF-EAR 1204685.