if (FALSE) {
## ************************************************************
## 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
}Run the code above in your browser using DataLab