SPI.calc | R Documentation |
Calculate Standardized Precipitation Index, SPI
SPI.calc(prec.zoo, sc = 24, method = "mle")
prec.zoo |
A zoo series contain date and rainfall vector/matrix. |
sc |
The accumulation period in months. Commonly 6, 12, 24, 36, and 48 months. |
method |
A character string coding for the fitting method: "mle" for 'maximum likelihood estimation', "mme" for 'moment matching estimation', "qme" for 'quantile matching estimation' and "mge" for 'maximum goodness-of-fit estimation'. |
A matrix of time series.
data(rain.mon)
## compute SPI
SPI <- SPI.calc(window(rain.mon, start = c(1949, 1), end = c(2009, 12)), sc = 12)
## plot
par(mfrow = c(3, 5))
for (i in seq_len(ncol(SPI))) plot(SPI[, i])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.