seaRoll: Rolling Seasonal Kendall trend test

View source: R/seaRoll.R

seaRollR Documentation

Rolling Seasonal Kendall trend test

Description

Calculates the Seasonal Kendall test of significance, including an estimate of the Sen slope, for rolling windows over a time series.

Usage

seaRoll(
  x,
  w = 10,
  plot = FALSE,
  pval = 0.05,
  mval = 0.5,
  pchs = c(19, 21),
  xlab = NULL,
  ylab = NULL,
  ...
)

Arguments

x

A seasonal time series vector.

w

The window width for “rolling” estimates of slope.

plot

Indicates if a plot should be drawn

pval

p-value for significance

mval

Minimum fraction of seasons needed with non-missing slope estimates

pchs

Plot symbols for significant and not significant trend estimates, respectively

xlab

Optional label for x-axis

ylab

Optional label for y-axis

...

Other arguments to pass to plotting function

Details

The function seaRoll applies seaKen to rolling time windows of width w. A minimum w of five years is required. For any window, a season is considered missing if half or more of the possible comparisons between the first and last 20% of the years is missing. If mval or more of the seasons are missing, then that windowed trend is considered to be missing.

If plot = TRUE, a point plot will be drawn with the Sen slope plotted at the leading year of the trend window. The plot symbols indicate, respectively, that the trend is significant or not significant. The plot can be customized by passing any arguments used by plot.default, as well as graphical parameters described in par.

Value

seaRoll returns a matrix with one row per time window containing the Sen slope, the relative Sen slope, and the p-value. Rows are labelled with the leading year of the window.

Author(s)

Alan Jassby, James Cloern

See Also

seaKen

Examples


chl27 <- sfbayChla[, 's27']
seaRoll(chl27)
seaRoll(chl27, plot = TRUE)


wql documentation built on Aug. 10, 2022, 5:06 p.m.