Learn R Programming

tseriesEntropy (version 0.5-12)

Srho.test.ts: Entropy Tests Of Serial And Cross Dependence For Time Series

Description

Entropy test of serial and cross dependence for numeric time series (continuous state space) based on Srho.ts. The distribution under the null hypothesis of independence is obtained by means of bootstrap/permutations methods (see ci.type).

Usage

Srho.test.ts(x, y, lag.max = 10, B = 100, plot = TRUE, quant = c(0.95, 0.99), bw = c("reference","mlcv", "lscv"), method =c("integral","summation"), maxpts=0, tol=1e-03, ci.type = c("mbb","perm"))

Arguments

x, y
univariate numeric time series object or numeric vectors (y is missing in the univariate case).
lag.max
maximum lag at which to calculate Srho; default is trunc(N/4) where N is the number of observations.
B
number of bootstrap/permutation replications.
plot
logical. If TRUE(the default) produces a plot of Srho together with confidence bands under the null hypothesis at levels set by quant.
quant
quantiles to be specified for the computation of the significant lags and the plot of confidence bands. Up to 2 quantiles can be specified. Defaults are 95% and 99%.
bw
see Srho.ts.
method
see Srho.ts.
maxpts
see Srho.ts.
tol
see Srho.ts.
ci.type
confidence interval type. determines how the distribution under the null hypothesis is obtained. mbb uses a moving block bootstrap with block length equal to lag.max. The option "perm" uses permutation methods (each resampled series is a random permutation of the original series). The option mbb makes sense only in the bivariate case for which is the default.

Value

.Data
vector containing Srho computed at each lag.
call:
Object of class "call": contains the call to the routine.
call.h:
Object of class "call": contains the call to the routine used for obtaining the surrogates or the bootstrap replicates under the null hypothesis.
quantiles
Object of class "matrix": contains the quantiles of the distribution under the null hypothesis.
test.type
Object of class "character": contains a description of the type of test performed.
significant.lags
Object of class "list": contains the lags at which Srho exceeds the confidence bands at quant% under the null hypothesis.
p.value
Object of class "numeric": contains the bootstrap p-value for each lag.
lags
integer vector that contains the lags at which Srho is computed.
stationary
Object of class "logical": TRUE if the stationary version is computed. Set to FALSE by default as only the non-stationary version is implemented.
data.type
Object of class "character": contains the data type.
notes
Object of class "character": additional notes.

Details

Univariate version: test for serial dependence
Srho.test.ts(x, lag.max = 10,
B = 100, plot = TRUE, quant = c(0.95, 0.99), bw = c("reference","mlcv", "lscv"),
method =c("integral","summation"), maxpts=0, tol=1e-03,
ci.type = c("perm"))

Bivariate version: test for cross dependence
Srho.test.ts(x, y, lag.max = 10,
B = 100, plot = TRUE, quant = c(0.95, 0.99), bw = c("reference","mlcv", "lscv"),
method =c("integral","summation"), maxpts=0, tol=1e-03,
ci.type = c("mbb","perm"))

For each lag from 1 to lag.max (serial dependence) or from -lag.max to lag.max (cross dependence) Srho.test.ts computes a test for serial/cross dependence for time series based on Srho.ts. The distribution under the null hypothesis of independence is obtained through either permutation or bootstrap methods. If the option mbb is chosen (bivariate case only) the resampled series keep the (serial) dependence structure of the original series so that the test will have better size than the permutation version.

References

Granger C. W. J., Maasoumi E., Racine J., (2004) A dependence metric for possibly nonlinear processes. Journal of Time Series Analysis, 25(5), 649--669.

Maasoumi E., (1993) A compendium to information theory in economics and econometrics. Econometric Reviews, 12(2), 137--181.

See Also

See Also Srho.ts. The function Srho.test implements the same test for integer/categorical data. For a test for nonlinear serial dependence see Srho.test.AR, Trho.test.AR, Trho.test.SA

Examples

Run this code
## Not run: 
# set.seed(1345)
# n      <- 120
# w      <- rnorm(n)
# x      <- arima.sim(n, model = list(ar=0.8));
# y      <- arima.sim(n, model = list(ar=0.8));
# z      <- lag(x,-1) + rnorm(n,sd=2) # dependence at lag 1
# # UNIVARIATE VERSION
# res1 <- Srho.test.ts(w, lag.max = 5,  B = 10, bw='reference', method='integral'
#     ,ci.type="perm") # independence
# res2 <- Srho.test.ts(x, lag.max = 5,  B = 10, bw='reference', method='integral'
#     ,ci.type="perm") # dependence
# 
# # BIVARIATE VERSION
# res3 <- Srho.test.ts(x, y, lag.max = 5,  B = 10, bw='reference', method='integral'
# ,ci.type="mbb") # independence
# res4 <- Srho.test.ts(x, z, lag.max = 5,  B = 10, bw='reference', method='integral'
# ,ci.type="mbb") # dependence
# ## End(Not run)

Run the code above in your browser using DataLab