Lanzante's Test for Change Point Detection
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.
lanzante.test(x, method = c("wilcox.test", "rrod.test"))
x |
a vector of class "numeric" or a time series object of class "ts" |
method |
the test method. Defaults to |
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.
A list with class "htest" and "cptest".
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.
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.