computenspi: computenspi

View source: R/computenspi.R

computenspiR Documentation

computenspi

Description

Computes the stationary and non-stationary version of the Standardized Precipitation Index. The non-stationary version uses GAMLSS and models the parameters of a Gamma distribution by incorporating the trend of accumulated precipitation.

Usage

computenspi(x, stationaryspi, spiScale, dist = "gamma")

Arguments

x

data.table

stationaryspi

logical used in array method (TRUE when stationary and FALSE when otherwise)

spiScale

A positive integer value, typically ranging from 1 to 24

dist

A character that can be either, "normal" when Normal distribution is used, "gamma" for Gamma, "zigamma" for zero adjusted Gamma and "weibull" for Weibull.

Value

data.table

Examples

computenspi(x = dummyrainfall(1950, 2000),
            stationaryspi = TRUE,
            spiScale = 12,
            dist = 'gamma'
            )

mammask/droughtr documentation built on Feb. 25, 2024, 2:27 p.m.