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

pettitt.test

Pettitt's Test for Change-Point Detection


Description

Performes a non-parametric test after Pettitt in order to test for a shift in the central tendency of a time series. The H0-hypothesis, no change, is tested against the HA-Hypothesis, change.

Usage

pettitt.test(x)

Arguments

x

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

Details

In this function, the test is implemented as given by Verstraeten et. al. (2006), where the ranks r[1], ..., r[n] of the X[i], ..., X[n] are used for the statistic:

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

The test statistic is the maximum of the absolute value of the vector:

U* = max |P[k]|

.

The probable change-point K is located where U* has its maximum. The approximate probability for a two-sided test is calculated according to

p =2 exp[-6K^2 / (T^3 + T^2)].

Value

A list with class "htest" and "cptest"

Note

The current function is for complete observations only. The approximate probability is good for p ≤ 0.5.

References

CHR (ed., 2010), Das Abflussregime des Rheins und seiner Nebenfluesse im 20. Jahrhundert, Report no I-22 of the CHR, p. 172.

Pettitt, A. N. (1979), A non-parametric approach to the change point problem. Journal of the Royal Statistical Society Series C, Applied Statistics 28, 126-135.

G. Verstraeten, J. Poesen, G. Demaree, C. Salles (2006), Long-term (105 years) variability in rain erosivity as derived from 10-min rainfall depth data for Ukkel (Brussels, Belgium): Implications for assessing soil erosion rates. Journal of Geophysical Research 111, D22109.

See Also

Examples

data(maxau) ; plot(maxau[,"s"])
s.res <- pettitt.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) ; pettitt.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.