## Intitialize two vectors of length 10001
X <- rep(0,10000+1)
Y <- rep(0,10000+1)
## Create two linked random processes. Y is independent of X,
## while X is determined in part by the previous values of Y.
for(i in 1:10000){
Y[i+1] <- 0.6*Y[i] + rnorm(1)
X[i+1] <- 0.4*X[i] + 0.6*Y[i] + rnorm(1)
}
X <- X[101:10000]
Y <- Y[101:10000]
## Compute the TE from Y to X
computeTE(X,Y,3,1,"MI_diff") ## should be circa 0.16
## and from X to Y
computeTE(Y,X,3,1,"MI_diff") ## should be circa zero
computeTE(X,Y,3,1,"Correlation",0.4)
computeTE(Y,X,3,1,"Correlation",0.4)
Run the code above in your browser using DataLab