bu.test {trend}R Documentation

Buishand U Test for Change-Point Detection

Description

Performes the Buishand U test for change-point detection of a normal variate.

Usage

bu.test(x, m = 20000)

Arguments

x

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

m

numeric, number of Monte-Carlo replicates, defaults to 20000

Details

Let XX denote a normal random variate, then the following model with a single shift (change-point) can be proposed:

xi={μ+ϵi,i=1,,mμ+Δ+ϵii=m+1,,n x_i = \left\{ \begin{array}{lcl} \mu + \epsilon_i, & \qquad & i = 1, \ldots, m \\ \mu + \Delta + \epsilon_i & \qquad & i = m + 1, \ldots, n \\ \end{array} \right.

with ϵN(0,σ)\epsilon \approx N(0,\sigma). The null hypothesis Δ=0\Delta = 0 is tested against the alternative Δ0\Delta \ne 0.

In the Buishand U test, the rescaled adjusted partial sums are calculated as

Sk=i=1k(xixˉ)(1in)S_k = \sum_{i=1}^k \left(x_i - \bar{x}\right) \qquad (1 \le i \le n)

The sample standard deviation is

Dx=n1i=1n(xixˉ) D_x = \sqrt{n^{-1} \sum_{i=1}^n \left(x_i - \bar{x}\right)}

The test statistic is calculated as:

U=[n(n+1)]1k=1n1(Sk/Dx)2U = \left[n \left(n + 1 \right) \right]^{-1} \sum_{k=1}^{n-1} \left(S_k / D_x \right)^2

.

The p.value is estimated with a Monte Carlo simulation using m replicates.

Critical values based on m=19999m = 19999 Monte Carlo simulations are tabulated for UU by Buishand (1982, 1984).

Value

A list with class "htest" and "cptest"

data.name

character string that denotes the input data

p.value

the p-value

statistic

the test statistic

null.value

the null hypothesis

estimates

the time of the probable change point

alternative

the alternative hypothesis

method

character string that denotes the test

data

numeric vector of Sk for plotting

Note

The current function is for complete observations only.

References

T. A. Buishand (1982), Some Methods for Testing the Homogeneity of Rainfall Records, Journal of Hydrology 58, 11–27.

T. A. Buishand (1984), Tests for Detecting a Shift in the Mean of Hydrological Time Series, Journal of Hydrology 73, 51–69.

See Also

efp sctest.efp

Examples

data(Nile)
(out <- bu.test(Nile))
plot(out)

data(PagesData)
bu.test(PagesData)
 

[Package trend version 1.1.6 Index]