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".
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.
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).
Author(s)
Ayana Mateus and Frederico Caeiro
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
##
## Example 1
##
data(sweetpotato)
turning.point.test(sweetpotato$yield)