Description Usage Arguments Details Value Note Author(s) References Examples
A collection and description of functions
for testing various aspects of univariate
time series, including independence, and neglected
nonlinearities.
The family of time series tests includes the following hypothesis tests:
1 2 3 4 5 
1 2 3 4 
description 
optional description string, or a vector of character strings. 
eps 
[bdsTest]  
lag 
[tnnTest][wnnTest]  
m 
[bdsTest]  
q 
[wnnTest]  
qstar 
[wnnTest]  
range 
[wnnTest]  
title 
an optional title string, if not specified the inputs data name is deparsed. 
x 
a numeric vector or an object of class 
Brock–Dechert–Sheinkman Test:
The bdsTest
test examines the spatial dependence of the
observed series. To do this, the series is embedded in m
space
and the dependence of x
is examined by counting near
points. Points for which the distance is less than eps
are
called near. The BDS test statistic is asymptotically standard Normal.
Note, that missing values are not allowed.
There is a special print method for objects of class "bdsTest"
which by default uses 4 digits to format real numbers.
[tseries:bds.test]
Teraesvirta Neural Network Test:
The null is the hypotheses of linearity in mean
. This test
uses a Taylor series expansion of the activation function to
arrive at a suitable test statistic. If type
equals "F"
,
then the Fstatistic instead of the ChiSquared statistic
is used in analogy to the classical linear regression.
Missing values are not allowed.
[tseries:teraesvirta.test]
White Neural Network Test:
The null is the hypotheses of linearity in “mean”. This
type of test is consistent against arbitrary nonlinearity
in mean. If type
equals "F"
, then the Fstatistic
instead of the ChiSquared statistic is used in analogy to the
classical linear regression.
[tseries:white.test]
Runs Test:
The runs test can be used to decide if a data set is from a random
process. A run is defined as a series of increasing values or a
series of decreasing values. The number of increasing, or decreasing,
values is the length of the run. In a random data set, the probability
that the (i+1)th value is larger or smaller than the ith
value follows a binomial distribution, which forms the basis of the
runs test.
[tseries:runs.test]
In contrast to R's output report from S3 objects of class "htest"
a different output report is produced. The tests here return an S4
object of class "fHTEST"
. The object contains the following slots:
@call 
the function call. 
@data 
the data as specified by the input argument(s). 
@test 
a list whose elements contail the results from the statistical
test. The information provided is similar to a list object of

@title 
a character string with the name of the test. This can be overwritten specifying a user defined input argument. 
@description 
a character string with an optional user defined description. By default just the current date when the test was applied will be returned. 
The slot @test
returns an object of class "list"
containing the following (otionally empty) elements:
statistic 
the value(s) of the test statistic. 
p.value 
the pvalue(s) of the test. 
parameters 
a numeric value or vector of parameters. 
estimate 
a numeric value or vector of sample estimates. 
conf.int 
a numeric two row vector or matrix of 95 
method 
a character string indicating what type of test was performed. 
data.name 
a character string giving the name(s) of the data. 
The output of the various hypothesis tests is an object of class
htest
. The associated print
method gives an unique
report about the test results.
Adrian Trapletti for the tests from R's tseries package,
Blake LeBaron for the bds
C program,
Diethelm Wuertz for the Rmetrics Rport.
Brock, W.A., Dechert W.D., Sheinkman J.A. (1987); A Test of Independence Based on the Correlation Dimension, SSRI no. 8702, Department of Economics, University of Wisconsin, Madison.
Conover, W.J. (1980); Practical Nonparametric Statistics, New York, Wiley.
Cromwell J.B., Labys W.C., Terraza M. (1994); Univariate Tests for Time Series Models, Sage, Thousand Oaks, CA, pages 32–36.
Lee T.H., White H., Granger C.W.J. (1993); Testing for neglected nonlinearity in time series models, Journal of Econometrics 56, 269–290.
Teraesvirta T., Lin C.F., Granger C.W.J. (1993); Power of the Neural Network Linearity Test, Journal of Time Series Analysis 14, 209–220.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41  ## bdsTest 
# iid Time Series:
par(mfrow = c(3, 1))
x = rnorm(100)
plot(x, type = "l", main = "iid Time Series")
bdsTest(x, m = 3)
# Non Identically Distributed Time Series:
x = c(rnorm(50), runif(50))
plot(x, type = "l", main = "Noniid Time Series")
bdsTest(x, m = 3)
# Non Independent Innovations from Quadratic Map:
x = rep(0.2, 100)
for (i in 2:100) x[i] = 4*(1x[i1])*x[i1]
plot(x, type = "l", main = "Quadratic Map")
bdsTest(x, m = 3)
## tnnTest 
# Time Series Nonlinear in "mean" regression
par(mfrow = c(2, 1))
n = 1000
x = runif(1000, 1, 1)
tnnTest(x)
# Generate time series which is nonlinear in "mean"
x[1] = 0.0
for (i in (2:n)) {
x[i] = 0.4*x[i1] + tanh(x[i1]) + rnorm (1, sd = 0.5) }
plot(x, main = "Teraesvirta Test", type = "l")
tnnTest(x)
## wnnTest 
# Time Series NonLinear in "mean" Regression
par(mfrow = c(2, 1))
n = 1000
x = runif(1000, 1, 1)
wnnTest(x)
# Generate time series which is nonlinear in "mean"
x[1] = 0.0
for (i in (2:n)) {
x[i] = 0.4*x[i1] + tanh(x[i1]) + rnorm (1, sd = 0.5) }
plot(x, main = "White Test", type = "l")
wnnTest(x)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.