Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

lanzante.test

Lanzante's Test for Change Point Detection


Description

Performes a non-parametric test after Lanzante in order to test for a shift in the central tendency of a time series. The null hypothesis, no shift, is tested against the alternative, shift.

Usage

lanzante.test(x, method = c("wilcox.test", "rrod.test"))

Arguments

x

a vector of class "numeric" or a time series object of class "ts"

method

the test method. Defaults to "wilcox.test".

Details

Let X denote a continuous random variable, then the following model with a single shift (change-point) can be proposed:

x[i] = θ + ε[i] for i = 1, ..., m and x[i] = θ + Δ + ε_i for i = m + 1, ..., n

with θ(ε) = 0. The null hypothesis, H:Δ = 0 is tested against the alternative A:δ != 0.

First, the data are transformed into increasing ranks and for each time-step the adjusted rank sum is computed:

U[k] = 2 * ∑ r_i - k (n + 1) k = 1, ..., n

The probable change point is located at the absolute maximum of the statistic:

m = k(max |P[k]|)

.

For method = "wilcox.test" the Wilcoxon-Mann-Whitney two-sample test is performed, using m to split the series. Otherwise, the robust rank-order distributional test (rrod.test is performed.

Value

A list with class "htest" and "cptest".

References

Lanzante, J. R. (1996), Resistant, robust and non-parametric techniques for the analysis of climate data: Theory and examples, including applications to historical radiosonde station data, Int. J. Clim., 16, 1197–1226.

See Also

Examples

data(maxau) ; plot(maxau[,"s"])
s.res <- lanzante.test(maxau[,"s"])
n <- s.res$nobs
i <- s.res$estimate
s.1 <- mean(maxau[1:i,"s"])
s.2 <- mean(maxau[(i+1):n,"s"])
s <- ts(c(rep(s.1,i), rep(s.2,(n-i))))
tsp(s) <- tsp(maxau[,"s"])
lines(s, lty=2)
print(s.res)


data(PagesData) ; lanzante.test(PagesData)

trend

Non-Parametric Trend Tests and Change-Point Detection

v1.1.4
GPL-3
Authors
Thorsten Pohlert [aut, cre] (<https://orcid.org/0000-0003-3855-3025>)
Initial release
2020-09-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.