Performs the nonparametric Turning Point test of randomness.
turning.point.test(x, alternative)
a numeric vector containing the data
a character string specifying the alternative hypothesis. Must be one of "two.sided
" (default), "left.sided
" or "right.sided
".
A list with class "htest" containing the components:
the (normalized) value of the statistic test.
the size of the data, after the remotion of consecutive duplicate values.
the p-value for the test.
a character string describing the alternative hypothesis.
a character string indicating the test performed.
a character string giving the name of the data.
the value of the TP statistic (not shown on screen).
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.
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.
# NOT RUN {
##
## Example 1
##
data(sweetpotato)
turning.point.test(sweetpotato$yield)
# }
Run the code above in your browser using DataLab