Extracted main text — title through conclusion, appendix excluded. This is what our citation measures are computed over, published so the extraction can be checked by eye.
26,055 characters · 14 sections · 26 citation commands
mFLICA: an R package for inferring leadership of coordination from time series
Leadership is defined as a process that leaders influence a group to achieve collective goals hogg2001social,glowacki2015leadership. One of leadership definitions is pattern initiation. Leaders are initiators who initiate collective patterns (e.g. movement initiation, trends of stock closing prices) that everyone follows Amornbunchornvej:2018:CED:3234931.3201406. Collective patterns or coordination events are emerging events of collective actions that aim to reach collective goals malone1994interdisciplinary. In time series context, coordination events occur when there exists some intervals such that some similar pattern occurs in all time series with possibly different time delay for each time series Amornbunchornvej:2018:CED:3234931.3201406. A leader of coordination event is a time series that initiates the pattern before others having this similar pattern with arbitrary time delays.
The related concepts of leadership inference on time series are Granger causality granger1969investigating (e.g. Imtest package GrangerR) and Transfer Entropy schreiber-prl00,BEHRENDT2019100265 (e.g. RTransferEntropy package BEHRENDT2019100265). Both techniques can be used to infer whether time series $A$ is a predictor of time series $B$, which is similar to the following relation concept in leadership inference. Nevertheless, leadership inference aims to identity patterns {(e.g. moving to the same trajectory)} that distributes among time series and their initiators (leaders) rather than finding predictors. {There are many leadership methods in the literature (see Table} (ref){). However, there is no leadership-inference R software package in the literature that can detecting multiple group leaders and members of coordination yet. For more details regarding the literature review of leadership methodologies, please see} Amornbunchornvej:2018:CED:3234931.3201406,mFLICASDM18.
To fill the gap in the literature, in this paper, I developed an R package for leadership inference in R Rprog on The Comprehensive R Archive Network (CRAN) RmFLICA: mFLICA. {The methodology of this framework is based on} Amornbunchornvej:2018:CED:3234931.3201406,mFLICASDM18{, which has been peer-reviewed and tested on both noisy simulation datasets and real-world datasets.} mFLICA is a framework that is capable of:
The mFLICA package provides scientists opportunities to analyze and generate scientific hypotheses on coordinated activities that can be tested statistically and in the field. {Note that for the details of algorithms in functions and definitions related to this work, see the supplementary document and} mFLICASDM18,Amornbunchornvej:2018:CED:3234931.3201406 {for more details regarding the performance of methodology and its theoretical properties. }
{The} mFLICA {package has been built based on Dynamic Time Warping (DTW)} sakoe1978dynamic. {Hence, it is an optimization framework that can be used to detect leadership patterns. However, even though the package cannot provide any statistics as outputs, instead, users can derive statistics from the framework outputs. For instance, a confidence interval of a specific individual being leaders can be derived by bootstrapping time series of leaders. }
{Another assumption is that the framework assumes that no external influences that cannot be found in the datasets. This implies that if the datasets contains partial information without including external influence, leaders found by the framework might not be the true leaders. Hence, users should carefully interpret their results with this assumption. }
I provide details of mFLICA system architecture in Section (ref), then I describe software functionality in Section (ref).
Given a set of time series and related parameters as inputs, mFLICA infers following networks, faction leaders and members, degrees of coordination over time, as well as related visualization.
Figure (ref) provides an overview of the package architecture. The main function is {mFLICA()} that calls two functions: {getDynamicFollNet()} and {getFactions()}. The {getDynamicFollNet()} is used to infer a dynamic following network from a set of time series, while {getFactions()} is used to infer faction leaders and faction members for each time step in a dynamic following network. In {getDynamicFollNet()}, it calls {followingNetwork()} for inferring a following network for each time intervals to create a dynamic following network. The {followingNetwork()} function uses {followingRelation()} as a main engine to infer a following relation between a pair of time series to build a following network. Lastly, {getFactions()} calls {getReachableNodes()} to find faction members, which are nodes that have directed path(s) to the faction leader.
The main tasks of mFLICA are 1) inferring a dynamic following network, and 2) inferring faction leaders and members as well as leadership dynamics.
In this paper, I use a simulated dataset $TS$ that contains 30 time series of movement from mFLICASDM18 to demonstrate in examples of using mFLICA in leadership inference tasks. The dataset consists of two-dimensional time series of 30 individuals moving along the x-axis. The time series length is 800 time steps. There are three coordination events during the time interval [1,200] leading by individual ID1, the time interval [201,400] leading by ID2, and the time interval [400,600] leading by ID3. The dataset is included in this package.
To infer a following relation between two time series, I deploy dynamic time warping (DTW) package Rdtw to analyze an optimal warping path between two time series. Figure (ref) shows simulated time series of movement from mFLICASDM18. In this event, a leader was moving toward x-axis while the follower followed its leader after some time delay. A degree of following relation can be defined below.
Where $P_{L,F}$ is the optimal warping path of leader $L$, and follower $F$ inferred by DTW and $s(P_{L,F}) \in [-1,1]$. Given a threshold $\sigma \in [0,1]$, if $s(P_{L,F}) \in [-1,-\sigma]$, then $L$ follows $F$. If $s(P_{L,F}) \in [\sigma,1]$, then $F$ follows $L$. Otherwise, there is no following relation for $s(P_{L,F}) \in (-\sigma,\sigma)$.
In the next example, I also deploy two time series in $TS$. In this dataset, $TS[1,1:100,]$ is a time series of leader while $TS[2,1:100,]$ is a time series of follower. I use only the first 100 steps of time interval in this example. I run the code below for computing the optimal warping path between leader and follower.
I called $dtw()$ function and recorded the result in $obj$ where $obj\$index1$ contains optimal warping path of a follower, and $obj\$index2$ contains optimal warping path of a leader. This means the follower at time $obj\$index1[i]$ is matched (most similar w.r.t. DTW matching) with the leader at time $obj\$index2[i]$. Then, I compute the average number of time steps until the follower reached the leader's previous positions.
On average, the follower required eight time steps to reach its leader. Next, I calculate $s(P_{L,F})$ in Eq. (ref).
This implies that there is a high degree of following relation between leader and follower ($s(P_{L,F})\approx 0.98$). The $followingRelation()$ function in the package is for computing $s(P_{L,F})$. I deploy Sakoe-Chiba Banding sakoe1978dynamic for speeding up DTW computation. The limitation of band can be set via $lagWindow$ parameter. In this case, I set the band parameter at 10% of the time series length ($lagWindow=0.1$).
I have $s(P_{L,F}) = 0.99$ in this example.
The $followingNetwork()$ function is used to infer an adjacency matrix of a following network. The code below is used to infer adjacency matrices by using a set of simulated time series $TS$, which contains 30 time series. The low-coordination interval $[1,60]$ and high-coordination interval $[61,120]$ are chosen in the example. I set $\sigma = 0,5$ for this example.
Figure (ref) illustrates the adjacency matrices from both intervals. The weighted adjacency matrix {mat1} at Figure (ref) (a) is computed from the time interval $[1,60]$ when the group initiated movement. In Figure (ref) (b), the weighted adjacency matrix {mat2} is computed from the time interval $[61,120]$ when everyone followed its leader ID1, which implies it is a high-coordination event. {mFLICA} provides {getADJNetDen()} for computing a network density from an adjacency matrix. Based on the result, {mat1} has a lower network density than {mat2}'s network density. The network densities can be computed below.
In Figure (ref) (b), in the row of ID1, all individuals have high degrees of following ID1, which implies that ID1 is a leader in this interval. In contrast, there are no individuals followed by the majority in Figure (ref) (a), which implies that this interval has low degrees of coordination.
In this part, I use the set of simulated time series TS, which has the time length at 800 time steps. In this dataset, there are three coordination events: [1,200], [201,400], and [401,600]. I set the time window $\omega=60$, the time shift $\delta=6$, and the threshold $\sigma=0.5$. The next commands are used to infer a dynamic following network of TS.
Suppose I want to know the following degree for ID19 follows ID1 at time step 150, I can use the command below.
I can query the network density at time step 150 with the command below.
The time series of network densities can be plotted using the plotMultipleTimeSeries function below.
Figure (ref) shows the result of the plot. The plot shows that there are three coordination events that have high network densities (high degrees of coordination): [1,200], [201,400], and [401,600], which are consistent with our ground truth.
I use the interval [25,45] in the simulation dataset to demonstrate the time when there are more than one factions occur simultaneously. After having a following network, getFactions() takes a binary version of adjacency matrix as its input.
The code above shows that there are two faction leaders in the interval [25,45]: ID1 and ID11. This implies that there are two factions. The next step is to query faction members of ID1's faction as well as its faction size ratio.
Note that a leader is also a faction member itself. Since there are 30 individuals, almost everyone is a member of ID1's faction. However, the faction size ratio at 0.5 indicates that faction members are not coordinated following the same pattern yet. The next one is the code for querying details about a faction leading by ID11.
We can see that there are a fewer number of members in this faction. Note that one individual can belong to more than one faction since the individual might follow some pattern that seems partially similar to several leaders' patterns.
Next, I show how to use mFLICA to infer dynamics of factions. In other words, I would like to find changes of faction members and faction leaders over time. Given a set of time series TS as an input along with related parameters: time window $\omega=60$, time shift $\delta=6$, and the threshold $\sigma=0.5$, we run mFLICA() below.
All results of faction inference are in obj1. Here, we focus on a set of time series of faction size ratios obj1\$factionSizeRatioTimeSeries where obj1\$factionSizeRatioTimeSeries[i,t] is a faction size ratio of a faction leading by IDi at time t. We can plot the time series of faction size ratios using plotMultipleTimeSeries below.
The result of the plot is in Figure (ref). According to the ground truth, there are three coordination events. First, during the time interval [1,200], ID1 is a sole leader who leads its faction of 30 individuals. Then, ID2 leads the faction for the time interval [201,400]. Afterward, ID3 leads the faction during the interval [401,600]. Finally, the group slows down and stop moving. The result in Figure (ref) reflexes this ground truth. ID1 has its high faction size ratios during [1,200], ID2's faction continues to have high faction size ratios during [201,400]. Lastly, ID3's faction has high faction size ratios during [401,600]. No factions have high faction size ratios during [601,800].
In the past, many social science questions including leadership were unable to be answers with quantitative approaches due to the lack of resource and data. Currently, because of innovation and technology developments, data from both online social network and real-world sensors of behaviors of human, animal, or even man-made systems are available. These datasets open opportunities for researchers to ask questions and gain insight about collective behaviors quantitatively. In leadership inference, mFLICA package enables computer scientists, social scientists, and researchers to quantitatively test hypotheses regarding leadership of coordination.
In the commercial realm, mFLICA is able to support companies to measure influence of their products among customers from customers' records. Understanding effects of products is a crucial part for companies to gain or loss profits.
In the research realm, there are currently some examples of new research regarding the potential of utilizing mFLICA in the literature. In online social behavior analysis, there is a recent work in santagiustina2021unfolding that used mFLICA to analyze time series of records from Twitter's online users for obtaining the structure of arguments in online debates about "no-deal" Brexit. In the animal behaviors, the work in amornbunchornvej2020framework utilized mFLICA to gain the results from GPS trajectories of 26 baboons and found that baboons do not follow any particular dictator but they follow the group, which is consistent with the biological result in strandburg2015shared. Additionally, in social science, the work in COOK2020101296 stated that a leadership-inference framework (e.g. mFLICA) has a potential to be used for obtaining causal relationships and influence between people.
In this paper, the details of mFLICA package for inferring leadership of coordination from time series are provides. Leaders are defined as individuals who initiate some patterns and others follow the same patterns with some time delays. A following relation between time series can be detected by analyzing an optimal warping path of Dynamic Time Warping (DTW), which is the main component that mFLICA deploys.
Given a set of time series and related parameters, the mFLICA package can infer a following relation between two time series, following networks, faction leaders, faction members, degrees of coordination, and faction size ratios for each time step.
The network densities inferred by mFLICA tell us regarding the magnitude of coordination: how many time-series individuals follow the same pattern in a given time interval. The faction size ratios provide information regarding faction dynamics; the changes of faction leaders, and/or faction members over time. We provided the examples of how to use mFLICA for solving many tasks in leadership inference. Our framework can be applied to any multivariate time series.
I wish to confirm that there are no known conflicts of interest associated with this publication and there has been no significant financial support for this work that could have influenced its outcome.
{The author would like to acknowledge the support from NSF III-1514126 in the development of the methodology used in this work.}