mbsi: Compute the model-based standardized index (MBSI)

Description Usage Arguments Details Value Author(s) Examples

View source: R/spi-mbsi.R

Description

mbsi computes the model-based standardized index using gamlss models. The difference with the classical spi index is that it consider the association between continuous times using cycle P-splines pbc. It can also with work with precipitation series containing NA, 0 or only non-zero values.

Usage

1
mbsi(y, time, tscale = 1, period = 365/7)

Arguments

y

Precipitation level or other variable under study.

time

Time associated with the variable y. This variable can be in weeks, months, etc.

tscale

Time-scale to compute the MBSI in time units. This argument is used to return the standardized values at this scale. Usually defined to identify different types of droughts of floods.

period

Numeric value representing the period to define seasonality. For example, 53 weeks, 12 months, 365 days. As it can be seen, it depends of the units of the argument time.

Details

details.

Value

A dataframe consisting of y, time, season, mu, sigma, pzero, ecdf and spi.

Author(s)

Erick A. Chacon-Montalvan

Examples

1
2
3
4
5
6
7
8
9
data(simrain)
spi_rain <- mbsi(simrain$rain, simrain$time)

# Visualize model fitting
plot(spi_rain)
# Visualize distribution of empirical cumulative density function
plot(spi_rain, which = "ecdf", binwidth = 0.05)
# Visualize extreme events
plot_extremes(spi_rain, threshold = 2)

ErickChacon/mbsi documentation built on Aug. 1, 2019, 4:47 p.m.