Learn R Programming

drought (version 1.2)

SDI: Compute the standardized drought index

Description

Based on the vector of monthly variables, the standardized drought index is computed. Note here the standardized precipitation index (SPI) is used as the example of the drought index in the univariate case. It also represents other drought indices computed in the similar way as SPI.

Usage

SDI(X, ts = 6, dist = "EmpGrin")

Value

The (univariate) standardized drought index of different time scales from both the empirical and parametric distribution

Arguments

X

The vector of a monthly hydro-climatic variable of n years.

ts

is the accumulated time scale.

dist

is a distribution function.The inputs can be "EmpGrin","EmpWeib","Gamma","Lognormal".

Details

Apart from the standardized drought index, the percentile (probability) is also provided,

Examples

Run this code
X=runif(120, min = 0, max = 100) # 10-year monthly data
fit<-SDI(X,ts=3) # Compute the 3 month drought index
fit$SDI # Get the empirical drought index 
z=matrix(t(fit$SDI),ncol=1)
plot(z, type="l", col=1, lwd=2, lty=1, xlim=c(0,120),xlab="Time",ylab="SDI")

Run the code above in your browser using DataLab