View source: R/followingRelation.R
followingRelation | R Documentation |
followingRelation is a function that infers whether Y
follows X
.
followingRelation(Y, X, timeLagWindow, lagWindow = 0.2)
Y |
is a numerical time series of a follower |
X |
is a numerical time series of a leader |
timeLagWindow |
is a maximum possible time delay in the term of time steps. |
lagWindow |
is a maximum possible time delay in the term of percentage of length(X).
If |
This function returns a list of following relation variables below.
follVal |
is a following-relation value s.t. if |
nX |
is a time series that is rearranged from |
optDelay |
is the optimal time delay inferred by cross-correlation of |
optCor |
is the optimal correlation of |
optIndexVec |
is a time series of optimal warping-path from DTW that is corrected by cross correlation.
It is approximately that |
VLval |
is a percentage of elements in |
ccfout |
is an output object of |
# Generate simulation data
TS <- SimpleSimulationVLtimeseries()
# Run the function
out<-followingRelation(Y=TS$Y,X=TS$X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.