followingRelation {mFLICA} | R Documentation |
followingRelation
Description
03/24/2021: Chai's code rewritten by Namrata to replicate Matlab version The changes are in the DTW function, which is implemented here as DTW2 instead of the one in the R package DTW
followingRelation is a function that infers whether Y
follows X
.
Usage
followingRelation(Y, X, timeLagWindow, lagWindow = 0.1)
Arguments
Y |
is a T-by-D matrix of numerical time series of a follower |
X |
is a T-by-D matrix 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 |
Value
This function returns a list of following relation variables below.
follVal |
is a following-relation value s.t. if |
dtwIndexVec |
is a numeric vector of index-warping difference: dtwIndexVec[k] = dtwOut$index1[k] - dtwOut$index2[k] where dtwOut is the output from dtw::dtw(x=Y,y=X) function. |
Examples
# Load example data ???
leader<- mFLICA::TS[1,1:200,]
follower<- mFLICA::TS[2,1:200,]
# Run the function
out<-followingRelation(Y=follower,X=leader)