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

bu.test

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 X denote a normal random variate, 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 ε \approx N(0,σ). The null hypothesis Δ = 0 is tested against the alternative δ != 0.

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

S[k] = ∑ (x[i] - xmean) (1, <= i <= n)

The sample standard deviation is

Dx = sqrt(n^(-1) ∑(x - μ))

The test statistic is calculated as:

U = 1 / [n * (n + 1)] * ∑_{k=1}^{n-1} (S[k] - Dx)^2

.

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

Critical values based on m = 19999 Monte Carlo simulations are tabulated for U 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

Examples

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

data(PagesData)
bu.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.