Learn R Programming

randtests (version 1.0.1)

turning.point.test: Turning Point Test

Description

Performs the nonparametric Turning Point test of randomness.

Usage

turning.point.test(x, alternative)

Arguments

x

a numeric vector containing the data

alternative

a character string specifying the alternative hypothesis. Must be one of "two.sided" (default), "left.sided" or "right.sided".

Value

A list with class "htest" containing the components:

statistic

the (normalized) value of the statistic test.

parameter

the size of the data, after the remotion of consecutive duplicate values.

p.value

the p-value for the test.

alternative

a character string describing the alternative hypothesis.

method

a character string indicating the test performed.

data.name

a character string giving the name of the data.

tp

the value of the TP statistic (not shown on screen).

Details

Repeated consecutive observations are removed from data.

The possible values "two.sided", "left.sided" and "right.sided" define the alternative hypothesis. By using the alternative "two.sided" the null hypothesis of randomness is tested against either a positive or negative serial correlation between neighbouring observations.

References

Brockwell, P.J. and Davis, R.A. (2002). Introduction to Time Series and Forecasting, 2nd edition, Springer (p. 36).

Mateus, A. and Caeiro, F. (2013). Comparing several tests of randomness based on the difference of observations. In T. Simos, G. Psihoyios and Ch. Tsitouras (eds.), AIP Conf. Proc. 1558, 809--812.

Moore, G.H. and Wallis, W.A. (1943). Time Series Significance Tests Based on Signs of Differences. Journal of the American Statistical Association, 38, 153--154.

Examples

Run this code
# NOT RUN {
##
## Example 1
##
data(sweetpotato)
turning.point.test(sweetpotato$yield)

# }

Run the code above in your browser using DataLab