Srho.test {tseriesEntropy} | R Documentation |
Entropy Test For Serial And Cross Dependence For Categorical Sequences
Description
Bootstrap/permutation tests of serial and cross dependence for integer or categorical sequences.
Usage
Srho.test(x, y, lag.max=10, B = 1000, stationary = TRUE, plot = TRUE,
quant = c(0.95, 0.99), nor = FALSE)
Arguments
x , y |
integer or factor time series objects or vectors. ( |
lag.max |
maximum lag at which to calculate Srho; the default is 10. |
B |
number of bootstrap/permutation replications. |
stationary |
logical. If |
plot |
logical. If |
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%. |
nor |
logical. If |
Details
- Univariate version: test for serial dependence
Srho.test(x, lag.max, B = 1000, stationary = TRUE, plot = TRUE, quant = c(0.95, 0.99), nor = FALSE)
- Bivariate version: test for cross dependence
Srho.test(x, y, lag.max, B = 1000, stationary = TRUE, plot = TRUE, quant = c(0.95, 0.99), nor = FALSE)
Value
An object of class "Srho.test", which is a list with the following elements:
.Data |
vector of |
quantiles |
Object of class |
test.type |
Object of class |
significant.lags |
Object of class |
p.value |
Object of class |
lags |
integer vector that contains the lags at which Srho is computed. |
stationary |
Object of class |
data.type |
Object of class |
notes |
Object of class |
Warning
Unlike ccf
the lag k value returned
by Srho.test(x,y)
estimates Srho between x[t]
and
y[t+k]
. The result is returned invisibly if plot is
TRUE.
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
, Srho.ts
. The function Srho.test.ts
implements the same test for numeric data.
Examples
set.seed(12)
x <- as.integer(rbinom(n=30,size=4,prob=0.5))
y <- as.integer(rbinom(n=30,size=4,prob=0.5))
z <- as.integer(c(4,abs(x[-30]*2-2))-rbinom(n=30,size=1,prob=1/2))
# no dependence
Srho.test(x,lag.max=4) # univariate
Srho.test(x,y,lag.max=4) # bivariate
# lag 1 dependence
Srho.test(x,z,lag.max=4) # bivariate