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

View source: R/Srho.ts.par_files.R

Srho.test.ts.pR Documentation

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). The parallel version requires parallel.

Usage

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

## Parallel version  
Srho.test.ts.p(x, y, lag.max = 10,  B = 100, plot = TRUE, quant = c(0.95, 0.99),
 bw = c("reference","mlcv", "lscv", "scv", "pi"), bdiag=TRUE,
 method =c("integral","summation"), tol=1e-03, ci.type = c("mbb","perm"), 
 nwork=detectCores(),...)

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; the default is 10.

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.

bdiag

see Srho.ts.

method

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 blag, which is equal to lag.max by default. 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.

nwork

number of workers/processes to be used in parallel environments.

...

further arguments, typically, the MBB block length blag or the arguments passed to hcubature.

Details

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

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 use a moving block bootstrap to acccount for the serial dependence of the original series so that the test will have better size than the permutation version.

Value

An object of class "Srho.test", which is a list with the following elements:

.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.

Author(s)

Simone Giannerini<simone.giannerini@unibo.it>

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.test.ts and 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, together with their parallel versions: Srho.test.AR.p, Trho.test.AR, Trho.test.SA.

Examples

## Not run: 
## ************************************************************
## WARNING: computationally intensive, increase B with caution
## ************************************************************
set.seed(13)
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.p(w, lag.max = 5,  B = 40, ci.type="perm") # independence
res2 <- Srho.test.ts.p(x, lag.max = 5,  B = 40, ci.type="perm") # dependence

# BIVARIATE VERSION
res3 <- Srho.test.ts.p(x, y, lag.max = 5,  B = 40, ci.type="mbb") # independence
res4 <- Srho.test.ts.p(x, z, lag.max = 5,  B = 40, ci.type="mbb") # dependence

## End(Not run)

tseriesEntropy documentation built on Aug. 10, 2023, 1:06 a.m.