VLTimeCausality Demo"

EXAMPLE#1 Simple Simulation & Granger causality

library(VLTimeCausality)
# Generate simulation data
TS <- VLTimeCausality::SimpleSimulationVLtimeseries()
# Generate simulation data
TS <- VLTimeCausality::SimpleSimulationVLtimeseries()
# Run the function
out<-VLTimeCausality::GrangerFunc(Y=TS$Y,X=TS$X,alpha=0.05)
#result
print(sprintf("F-TEST p-value = %f",out$p.val))
print(sprintf("X causes Y? %d",out$XgCsY_ftest))

EXAMPLE#2 Simple Simulation & VL-Granger causality

library(VLTimeCausality)
# Generate simulation data
TS <- VLTimeCausality::SimpleSimulationVLtimeseries()
# Generate simulation data
TS <- VLTimeCausality::SimpleSimulationVLtimeseries()
# Run the function
out<-VLTimeCausality::VLGrangerFunc(Y=TS$Y,X=TS$X,gamma=0.5)
#result
print(sprintf("BICDiffRatio = %f",out$BICDiffRatio))
print(sprintf("X causes Y? %d",out$XgCsY))

EXAMPLE#3 Simple Simulation & Transfer Entropy

library(VLTimeCausality)
# Generate simulation data
TS <- VLTimeCausality::SimpleSimulationVLtimeseries()
# Generate simulation data
TS <- VLTimeCausality::SimpleSimulationVLtimeseries()
# Run the function
out<-VLTimeCausality::VLTransferEntropy(Y=TS$Y,X=TS$X,VLflag=FALSE)
#result
print(sprintf("TEratio = %f",out$TEratio))
print(sprintf("X causes Y? %d",out$XgCsY_trns) )

EXAMPLE#4 Simple Simulation & VL-Transfer Entropy

library(VLTimeCausality)
# Generate simulation data
TS <- VLTimeCausality::SimpleSimulationVLtimeseries()
# Generate simulation data
TS <- VLTimeCausality::SimpleSimulationVLtimeseries()
# Run the function
out<-VLTimeCausality::VLTransferEntropy(Y=TS$Y,X=TS$X,VLflag=TRUE)
#result
print(sprintf("TEratio = %f",out$TEratio))
print(sprintf("X causes Y? %d",out$XgCsY_trns) )


Try the VLTimeCausality package in your browser

Any scripts or data that you put into this service are public.

VLTimeCausality documentation built on Dec. 28, 2019, 9:06 a.m.