According to http://sac.csic.es/spei/home.html
to calculate SPEI we use precipitation and potential evapotranspiration (PET):
"the difference between the precipitation (P) and PET for the month i is calculated:
D_{i} = P_{i} - PET_{i}
which provides a simple measure of the water surplus or deficit for the analyzed month.
The calculated Di values are aggregated at different time scales"
and after this aggregation for N number of months and additional computations, SPEI for N months is calculated.
My questions are:
http://sac.csic.es/spei/home.html