#Load the multivariate simulated
#dataset `simTransComms`
data(simTransComms)
#Embed the spp_4 and spp_3 of the third community
embedX <- embed_ts(X = simTransComms$community3[,c("time","spp_4")],
E = 5, tau = 1)
embedY <- embed_ts(X = simTransComms$community3[,c("time","spp_3")],
E = 5, tau = 1)
alphas <- seq(from = 0, to = 1, by = 0.1)
#Estimate the forward information imbalance
#between spp_4 and spp_3
egII_for <- tuneII(target = embedX[,-1], columns = embedY[,-1],
tau = 1, alphas = alphas, k = 5)
#Estimate the reverse information imbalance
#between spp_4 and spp_3
egII_rev <- tuneII(target = embedY[,-1], columns = embedX[,-1],
tau = 1, alphas = alphas, k = 5)
#Calculate the information gain
igain_for <- imbalance_gain(egII_for)
igain_rev <- imbalance_gain(egII_rev)
Run the code above in your browser using DataLab