Learn R Programming

trend (version 1.1.6)

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"))

Value

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

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 = \left\{ \begin{array}{lcl} \theta + \epsilon_i, & \qquad & i = 1, \ldots, m \\ \theta + \Delta + \epsilon_i & \qquad & i = m + 1, \ldots, n \\ \end{array} \right.$$

with \(\theta(\epsilon) = 0\). The null hypothesis, H:\(\Delta = 0\) is tested against the alternative A:\(\Delta \ne 0\).

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

$$U_k = 2 \sum_{i=1}^k r_i - k \left(n + 1\right) \qquad k = 1, \ldots, n$$

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

$$m = k(\max |U_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.

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

pettitt.test

Examples

Run this code
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)

Run the code above in your browser using DataLab