I am using the package SPEI to estimate SPI (using spi function) for different
locations. My data have many zeroes for the months of May, June and July. How
does spi function handle the zeroes especially for the gamma distributio?
The reason I am asking I am getting the follwing error.
Error in if (para$type != "gam") { : argument is of length zero
In addition: Warning message:
In pargam(lmom.ub(month)) : L-moments are invalid
Also my first year does not start with January; it start with May. How can
modify the following command to to take this into account.
SPI <- as.data.frame(spi(data, 3, kernel=list(type ='rectangular',
shift=0),
distribution='Gamma', fit='max-lik', na.rm=FALSE))
Peter Maclean
Department of Economics
UDSM
[[alternative HTML version deleted]]