# NOT RUN {
# Remember to increase the number of bootstrap samplesin preactical
# implementations.
# }
# NOT RUN {
# Test for independence between two vectors, iid data.
x1 <- cbind(rnorm(100), rnorm(100))
lg_object1 <- lg_main(x1)
test_result1 = ind_test(lg_object1,
bootstrap_type = "plain",
n_rep = 20)
# Test for serial dependence in time series, lag 1
data(EuStockMarkets)
logreturns <- apply(EuStockMarkets, 2, function(x) diff(log(x)))
x2 <- cbind(logreturns[1:100,1], logreturns[2:101, 1])
lg_object2 <- lg_main(x2)
test_result2 = ind_test(lg_object2,
bootstrap_type = "plain",
n_rep = 20)
# Test for cross-dependence, lag 1
x3 <- cbind(logreturns[1:100,1], logreturns[2:101, 2])
lg_object3 <- lg_main(x3)
test_result3 = ind_test(lg_object3,
bootstrap_type = "block",
n_rep = 20)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab