| ck_spei | R Documentation |
Compute the SPEI by fitting a log-logistic distribution to the monthly climatic water balance (precipitation minus potential evapotranspiration) accumulated over a rolling window.
ck_spei(precip, pet, dates, scale = 3, distribution = c("log-logistic", "gev"))
precip |
Numeric vector of daily precipitation (mm). |
pet |
Numeric vector of daily potential evapotranspiration (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.
Vicente-Serrano, S. M., Begueria, S., & Lopez-Moreno, J. I. (2010). A multiscalar drought index sensitive to global warming: the Standardized Precipitation Evapotranspiration Index. Journal of Climate, 23(7), 1696-1718.
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)
pet <- rep(3, length(dates))
ck_spei(precip, pet, dates, scale = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.