| ck_spi | R Documentation |
Compute the SPI by fitting a parametric distribution to rolling monthly precipitation accumulations and transforming to standard normal deviates. Two distributions are supported: the two-parameter gamma (default; WMO-1090 standard) and the three-parameter Pearson III. The Pearson III tail is heavier and is preferred in arid regions where the wet-day distribution is highly skewed (Stagge et al. 2015).
ck_spi(precip, dates, scale = 3, distribution = c("gamma", "pearsonIII"))
precip |
Numeric vector of daily precipitation (mm). |
dates |
Date vector of the same length as |
scale |
Integer. Accumulation period in months (default 3). |
distribution |
Character. Either |
A data frame with columns period, value, index, and unit.
McKee, T. B., Doesken, N. J., & Kleist, J. (1993). The relationship of drought frequency and duration to time scales.
Stagge, J. H., Tallaksen, L. M., Gudmundsson, L., Van Loon, A. F., & Stahl, K. (2015). Candidate distributions for climatological drought indices (SPI and SPEI). International Journal of Climatology, 35(13), 4027-4040. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/joc.4267")}.
dates <- seq(as.Date("2020-01-01"), as.Date("2023-12-31"), by = "day")
set.seed(42)
precip <- rgamma(length(dates), shape = 0.5, rate = 0.1)
ck_spi(precip, dates, scale = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.