SPI.calc: Calculate Standardized Precipitation Index, SPI

Description Usage Arguments Value Examples

View source: R/SPI_calc.R

Description

Calculate Standardized Precipitation Index, SPI

Usage

1
SPI.calc(prec.zoo, sc = 24, method = "mle")

Arguments

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'.

Value

A matrix of time sereis.

Examples

1
2
3
4
5
6
7
8
data(rain.mon)
data(SPI.12)
##compute SPI
SPI <- SPI.calc(window(rain.mon, start=c(1949,1), end=c(2009,12)),sc=12)

##compare with sample data set SPI.12
par(mfrow=c(3,5))
for(i in 1:ncol(SPI)) plot(SPI[,i],SPI.12[,i])

zejiang-unsw/WASP_1.0.0 documentation built on May 6, 2020, 7:49 p.m.