0% found this document useful (0 votes)
12 views9 pages

Efficient On-Line Computation of Visibility Graphs

Uploaded by

Areej Abdul Hai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views9 pages

Efficient On-Line Computation of Visibility Graphs

Uploaded by

Areej Abdul Hai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

1

Efficient On-line Computation of Visibility Graphs


Delia Fano Yela, Florian Thalmann, Vincenzo Nicosia, Dan Stowell, and Mark Sandler

Abstract—A visibility algorithm maps time series into complex Both of these approaches comprising the current existing
networks following a simple criterion. The resulting visibility methods to compute visibility graphs, are off-line algorithms,
graph has recently proven to be a powerful tool for time as they require all the data points in the time series to
series analysis. However its straightforward computation is time-
consuming and rigid, motivating the development of more effi- be available before the graph is constructed. Consequently,
cient algorithms. Here we present a highly efficient method to the integration of new data points normally requires to re-
compute visibility graphs with the further benefit of flexibility: compute the visibility graph from scratch, representing a major
on-line computation. We propose an encoder/decoder approach,
arXiv:1905.03204v1 [cs.DS] 8 May 2019

shortcoming limiting the real-world applications of visibility


with an on-line adjustable binary search tree codec for time series graphs.
as well as its corresponding decoder for visibility graphs. The
empirical evidence suggests the proposed method for computation In this paper we present, to the best of our knowledge,
of visibility graphs offers an on-line computation solution at no the first on-line algorithm to compute visibility graphs effi-
additional computation time cost. The source code is available ciently. The proposed algorithm employs an ‘encoder/decoder’
online. approach by means of a binary search tree representation of
Index Terms—on-line, visibility graphs, binary trees, networks. the time series (or any ordered sequence of data points). In
particular, the time series is encoded into a binary search tree
that can be updated every time a chunk of time series is
available by merging its corresponding binary search trees. The
I. I NTRODUCTION resulting binary search tree can subsequently be decoded into
a visibility graph when required. This introduced flexibility
I N the last decade, several methods to map time series into
graphs have been proposed under the hypothesis that, ap-
propriate graph representations can preserve the original time
comes at no significant computational cost as the presented
method shares the computational complexity of the current
series information while providing alternatives to deal with fastest visibility algorithm (DC).
non-linearity and multi-scale issues typical of complex sig-
nals [5], [25]. This line of research represents a bridge between II. V ISIBILITY G RAPHS
nonlinear signal analysis and complex network theory, and has A visibility graph is obtained from an ordered sequence of
been successfully applied to extract meaningful information values by associating each datum to a node and connecting two
from a variety of different systems in physics [27], [16], nodes with an edge if the corresponding data points are visible
finance [8], [15], [24], engineering [28], and neuroscience [2], from each other. A point a is visible from the point b if one can
[3]. draw a straight line from a to b without passing underneath any
The most notable algorithms to construct a graph from an intermediate points. In this paper we will consider visibility
ordered sequence of data points are either based on correla- as a symmetric relation, so that the resulting visibility graphs
tion [21], [1], [29], recurrence [6], [4], [7], dependence [22], are undirected.
[18], or visibility [13]. However, the visibility algorithms The natural visibility criterion (NV) allows the visibility
proposed by Lacasa et al. [13], [19] are amongst the most line between a and b to take any slope, whereas the horizontal
popular as they provide a deterministic and non-parametric visibility criterion (HV) is restricted to horizontal lines, as
symbolisation of a time series preserving full information of shown in Figure 1.f. More precisely, given a time series
its linear and non-linear correlations. Such visibility algorithms
can also effectively deal with non-stationary signals and are y = f (t)
deemed computationally efficient. In consequence, visibility of length n, two points (ta , ya ) and (tb , yb ) are said to be
graphs have found numerous applications in diverse fields naturally visible if every intermediate point (tc , yc ), such
including image processing [12], [11], number theory [14], that ta < tc < tb , fulfills the following simple geometrical
finance [15], [9], and neuroscience [26]. criterion:
The straightforward computation of visibility graphs tc − ta
yc < ya + (yb − ya )
presents a worst case time complexity quadratic in the length tb − ta
of the series. Even though such complexity should not be This natural visibility criterion will therefore establish the
an issue for medium-sized series (104 − 105 points), it re- connections between nodes in the resulting natural visibility
mains inefficient for longer time series. Therefore, faster al- graph (NVG).
gorithms have been proposed employing a ‘Divide & Conquer’ One can analogously map a time series into a horizontal
(DC) approach, reducing the average-case time complexity to visibility graph (HVG) where two points (ta , ya ) and (tb , yb )
O(n log n) [17]. are said to be horizontally visible if :
This work was funded by EPSRC grant EP/L019981/1 ya , yb > yc ∀c such that ta < tc < tb
2

From the definition of visibility it immediately follows that, graph of a time series is always a sub-graph of the natural
for a set visibility criterion, the visibility graph associated to visibility graph associated to the same time series.
a given time series is unique. Moreover, any two subsequent
data points of the time series are always connected by an edge,
thus visibility graphs are connected and Hamiltonian [20]. III. S TATE OF THE ART
In addition, visibility graphs are also invariant to re-scaling
on both horizontal and vertical axes (i.e., the first point on A straightforward approach to compute visibility graphs
either side of a node i remains visible from i no matter how consists in checking whether any of the points of the time
far apart they are), and invariant to vertical and horizontal series is visible or not from every other point. This corresponds
translations (i.e., only the relative values of point determine to evaluating the visibility criteria for every pair of points in
visibility relations). the time series. Since we consider visibility as a symmetric
In Figure 1.f. we show both the natural and horizontal relation, the total number of checks needed to obtain a
visibility criteria at work on an arbitrary time series. Notice visibility graph of a time series of n data points is equal to
that horizontal visibility is a more stringent criterion than n(n − 1)/2, corresponding to a O(n2 ) time complexity.
natural visibility, meaning that if two points are horizontally In the case of horizontal visibility, one can take a step
visible then they are also trivially visible when using the nat- further and safely assume that no point after a value larger
ural visibility criterion. Consequently, the horizontal visibility than the current value ta will be horizontally visible from
ta . This observation effectively reduces the time complexity
of the construction to O(n log(n)) and, in the case of noisy
(stochastic or chaotic) signals, it can be proved that this
algorithm has an average-case time complexity O(n) [20].
Nevertheless, all pairs of points need to be checked in the
case of natural visibility. From now on, this simple approach
will be referred to as the basic method for both natural and
horizontal visibility computation 1 .
As an improved alternative for visibility computation, Lan
et al. presented a ‘Divide & Conquer’ approach [17]. This
algorithm reduces the average case time complexity of the
construction of the natural visibility graph to O(n log(n)) and
it significantly reduces computation time for most balanced
time series.
The basic idea behind the ‘Divide & Conquer’ algorithm
is related to the horizontal visibility optimisation mentioned
above. Once the maximum value M of the time series is
known, one can safely assume that the points on the right of
M will not be naturally visible from the points on the left of
M (the point M is effectively acting as a wall between the two
sides of the time series). The same argument is then applied
recursively on the two halves of the time series separated
by M , where the local maxima subsequently found at each
level are connected with an edge to the maxima at the level
immediately above them. From now on, this improved method
will be referred to as ‘Divide & Conquer’ (or DC for short).
Both the basic method and DC are off-line approaches,
meaning that they require all the points of the time series
to be accessible at the beginning of the computation. This
rigid requirement limits the applicability of visibility graphs,
specially in fields like telecommunications or finance, where
there is a constant incoming flow of new data to be processed
and assimilated. Moreover, in such big data scenarios, one
tends to favour an initial overall high level analysis that will
Fig. 1. Representation of the different steps of the proposed algorithm reveal the need for further processing. This work-flow would
for visibility graphs computation. In section A, the sample time series and benefit from dynamic algorithms unlike the ones presented
its correspondent maximum binary search tree. Section B represents the above.
connections deduced by the first connectivity rule. The second and third
connectivity rules are illustrated in section C and D respectively. Section
E shows the remaining checks needed to ascertain natural visibility. Finally, 1 The original Fortran 90 implementations of basic algorithms to con-
section F reports the horizontal and natural visibility graph associated to the struct visibility graphs can be found at http://www.maths.qmul.ac.uk/∼lacasa/
original time series. Software.html
3

(see function build tree in Algorithm 1) until there are no


more data points (i.e. indices) to add.
In the case of the sample time series in Figure 1.a, the
maximum is in position 5 and will therefore be the root of
the binary tree. The point whose value is immediately smaller
than the maximum is in position 4 (less than 5), so it will
become the left child of the root. The third point in the list
is in position 2, and will travel down the tree on the left-
most branch (as it is smaller than both 5 and 4). The right
branch of the tree is populated by the fourth point (in position
8), whose index is bigger than the root. In Figure 1.A one
may appreciate the correlation between the time series and
its associated binary tree structure. The visibility information
captured by such tree may also now be more apparent.
The time complexity of the procedure needed to encode the
Fig. 2. Illustration of the encode/decode approach of the proposed method time series into the maximum binary search tree is O(S + T )
to calculate visibility graphs.
where O(S) is the time complexity of sorting the series and
O(T ) is the time complexity of the algorithm to construct
IV. P ROPOSED M ETHOD : B INARY S EARCH T REE C ODEC the binary search tree. Sorting by comparisons is known to
be O(n log n) (e.g., by using either MergeSort of QuickSort),
Here we propose a new method to compute visibility graphs while constructing a binary search tree costs on average
on-line based on an encoding/decoding approach. In our O(n log n). Hence the overall average-case time complexity
method, the necessary visibility information is first encoded of the encoding step is O(n log n).
into an appropriately constructed binary search tree, and then
successively decoded into a visibility graph when needed, as
shown in Figure 2. Node {
index : float # x, input, argument
value : float # f(x), output
left : Node # left child subtree
A. Encoding - Maximum Binary Search Tree
right : Node # right child subtree
The construction of a maximum binary search tree is fairly }
straightforward and its corresponding pseudo-code is shown in
def buildTree(values : {float}, indexes: {float}):
Algorithm 1. The first step is to sort the given time series in
descending order of values, while storing the original position root ← Node()
of each value in the time series. From now on, we will refer
to the original positions as indices (i.e. t) and to the values sorted_values = sort_descending(values)
of the times series simply as values (i.e. y(t)). In the case of sorted_indexes = indexes[getIndex(sorted_values)]
repeated values in the sequence, the first encountered index for (i, v) in (sorted_indexes, sorted_values):
will come first while sorting. root.add(Node(index = i, value = v))
Once we have a list of values sorted in descending order, to-
gether with the corresponding indices, we follow the standard return root
procedure to build a binary search tree based on the indices.
Every entry in the index list will be a node and each node has def add(self : {Node}, node : {Node}):
a left and right child, as shown in the data structure proposed
in Algorithm 1 (i.e., Node). The first node of the binary tree if self is empty :
(the one with no parent) is called root. In our case, the root self.index = node.index
will be the index of the datum corresponding to the maximum self.value = node.value
else:
value in the time series, which is also the first entry in the if node.index < self.index:
index list. self.left.add(node)
The next index, corresponding to the point with the largest else:
value smaller than the maximum, will then be added to the self.right.add(node)
tree. If its index is smaller than the root, it will become Algorithm 1. Pseudocode of the algorithm used to build a maximum binary
the left child of root, while if its index is larger than the search tree
root it will become the right child of root (see function add
in Algorithm 1). The next index to add will start off being
compared to the root; if its smaller, it will travel to the left B. Decoding - Connectivity Rules
of the tree and, if its bigger, to the right. It will continue The structure of the maximum binary search tree encodes
descending the tree in this manner until it finds an empty sufficient information about the time series to allow to effi-
spot. We continue adding the indices in the list accordingly ciently construct the corresponding horizontal visibility graph.
4

The decoding procedure is based on the following connectivity


rules, also illustrated in Figure 1 :
1) All the nodes connected by an edge in the maximum
binary search tree are visible to each other and therefore
connected in the visibility graph (Figure 1.B);
2) Each node of the maximum binary search tree sees
all the nodes in the left-most branch of the sub-tree
rooted at its right child, as well as all the nodes in the
right-most branch of the sub-tree rooted at its left child
(Figure 1.C);
3) The nodes of the left sub-tree of a node i are not
visible from the nodes of the right sub-tree of node i
(Figure 1.D) Fig. 3. Representation of a perfectly balanced tree of height 4. The nodes in
green are visible to the root and this visibility can be deduced by the proposed
Note that, if there are no adjacent repeating amplitudes, the decoder (i.e. the connectivity rules). The number of nodes at each height in
horizontal visibility graph is fully determined by these connec- a balanced tree can always be expressed in base 2.
tivity rules. In particular, when checking the connectivity rules,
we simply skip a node if it has the same value as the current
node. One can think of adjacent points with equal value as an Hence, the overall time complexity of encoding and decoding
interconnected ‘super node’, which takes the smallest index into a horizontal visibility graph is O(n log(n)).
value when ‘looked’ from the left and the biggest index value The worst case for decoding into a natural visibility graph
when ‘looked’ from the right or from above. is that of monotonically increasing, monotonically decreasing,
Since the horizontal visibility decoding will always be fully or constant series, whose corresponding binary search trees
determined by the three connectivity rules above, its time degenerate into a line. In this case, the second and third
complexity is the sum of the time complexity of the rules. connectivity rules are trivial, leaving only the first rule and
Essentially, each rule can be reduced to a series of look-ups the additional natural visibility checks. More precisely, if the
in a binary search tree, and each look-up operation has time tree is a line we need to check the natural visibility among
complexity O(log(n)) in a balanced tree. These connectivity (n − 1)(n − 2)/2 pairs of nodes, while the visibility of the
rules are applied to every node in the tree, and so the overall remaining (n − 1) pairs of nodes is determined by the first
time complexity of decoding a horizontal visibility graph is connectivity rule. Even though this requires (n−1) checks less
O(n log(n)). This represents a major improvement over the than the basic implementation (which requires n(n − 1)/2),
state-of-the-art algorithms, which can ramp up to O(n2 ) in the time complexity will still be O(n2 ) for the worst case
the worst case scenario. scenario.
The construction of the natural visibility graph, instead, For the average case we assume the maximum binary search
requires the creation of some connections that are not captured tree to be balanced. This means that the connectivity rules of
by the three connectivity rules above. Hence, in this case we the decoder will significantly reduce the overall number of
need to perform additional visibility checks (Figure 1.E). In visibility checks. If we consider a perfectly balanced binary
particular, for each node i we must check the natural visibility tree as shown in Figure 3, the inner left branch of the right
criterion with each node in the sub-tree rooted at the right child sub-tree and the inner right branch of the left sub-tree of a
of i and with each node in the sub-tree rooted at the left child node are visible to the parent node. These are represented in
of i. These additional checks do not modify the average-case green in Figure 3 where the root is the parent node. This means
time complexity (which remains O(n log n), but the worst- that the visibility between the root and all the rest of nodes
case scenario still depends on the actual structure of the time (the ones in blue) is unknown and needs to be checked.
series, and yields a time worst-case time complexity O(n2 ) Therefore we can deduce that the number of remaining
for monotonically increasing or decreasing time series. visibility checks for the root in a balanced tree of height
hmax is equal to 2hroot +1 − 1 − 2hroot , where 2hroot +1 − 1 is
the total number of nodes below the root while 2hroot is the
C. Time Complexity number of nodes whose visibility can be deduced by the three
In order to determine the time complexity of the proposed decoding rules (green nodes). Notice that the height of the root
method, we will follow the standard procedure by considering hroot corresponds to the maximum height of the balanced tree
the worst-case and average-case scenarios. In both scenarios, hmax . The same reasoning applies to all the other nodes. More
the time complexity of the encoding stage is determined by precisely, for a node at height h, there will be (2h+1 − 1 − 2h)
the time complexity of the sorting algorithm used, which in remaining visibility checks to be performed.
general is O(n log(n)), and of the construction of the binary In order to calculate the total number of remaining visibility
search tree, which is O(n log n). So in both cases encoding checks, one needs to multiply the individual expression above
into a binary search tree costs O(n log n). by the number of nodes at that height 2hmax −h and sum across
Decoding into a horizontal visibility graph is made through all heights where the checks are needed (all except the last
the three rules explained in Figure 1B-D, which require only two). Therefore, one can express the total number of remaining
a visit of the binary search tree (with time complexity O(n)). natural visibility checks in a perfectly balanced binary tree as
5

follows: encoder is a binary search tree, there is a possibility to


hX
max
hmax −h
 h+1  efficiently update it on-line.
2 2 − (2h + 1) =
Given a time series and its correspondent binary search tree,
h=2
we would like to integrate new data points in the tree structure
hX
max hX
max without recomputing it from scratch. One could process the
2hmax 2(hmax − 1) − h21−h − 2−h
 
points of the newly available batch of data individually and
h=2 h=2 include them in the existing tree structure by comparing
Since the maximum height of a balanced tree with n nodes is both values and indices. However, other than being a time
hmax = log2 (n), the total number of operation is dominated consuming approach for large numbers of points, processing
by the first term of the expression above, points individually fails to include useful information of both
the batch and the current tree structure. As an example, in
2hmax 2(hmax − 1) = 2n(log2 (n) − 1)
Figure 4.A, all the nodes in the batch to be added (red nodes)
while the remaining terms will only introduce logarithmic have larger indices than the nodes in the current tree structure
corrections. In conclusion, the time complexity of the decoding (blue nodes), and so larger indices than the current root. This
for natural visibility graphs is on average O(n log(n)). means, all the nodes in the batch will populate the right side
The proposed method has the same average-case time of the resulting tree. If the nodes are treated individually,
complexity than the DC algorithm, thus improving on the orig- this information will be overlooked producing an inefficient
inal basic algorithm for both horizontal and natural visibility algorithm.
graphs. In the Experiment section below we will see that in Therefore, we propose to take a different approach by
practice our algorithm out-competes the basic algorithm and treating the new batch of points as an entity. More precisely,
performs as well as the DC approach, with the additional we propose to compute the binary search tree of the new nodes
property of allowing for on-line assimilation of new data and merge it with the previous tree structure as illustrated in
points. Figure 4. In this way, if all the new nodes indices are larger
than the current root, one can include such information and
produce an optimised algorithm, where potentially only one
def merge(input:{Node}): comparison is needed to merge the current with the batch
if input is empty: return null
tree. This is the case for real-time incoming data, as the
batch’s nodes always have larger time values (indices) than
r ← min_index(maxima_value(input)) the previous points in the time series.
pool ← input \ {r} Furthermore, the proposed merge approach covers both
append and insert operations, illustrated in Figure 4.A and
pool.append(r.left, r.right)
Figure 4.B respectively. In terms of time series representation,
for n in input \ {r} : this means one could update the binary tree codec with
observations that happened later in time or with a higher
for c in [n.left, n.right] : time resolution. This novel introduced flexibility for visibility
computation, opens the door to new applications such as big
if sign(n.index - r.index)
6= sign(c.index - r.index):
data or audio applications where the sampling rate may vary
at different analysis stages.
pool.append(c) In order to merge two trees, we propose to compare them
n.remove(c) by levels, increasing depth at every recursion of the merge
function outlined in Algorithm 2. The comparison happens in
return Node(
index = r.index,
two steps: firstly the node values at a level are compared to
value = r.value, determine which node will occupy that location in the resulting
left = tree; secondly, the node indices are compared to determine
merge({p | p ∈ pool, p.index < r.index }), which direction the rest of the nodes will travel down in depth.
right = Following the construction of the proposed binary search
merge({p | p ∈ pool, p.index > r.index }))
tree, the node with larger value will be chosen and the rest of
Algorithm 2. Pseudocode of the proposed algorithm to merge two binary the nodes will travel left if their indices are smaller than the
trees defined by their root (class Node). The input is a list of roots to be
merged.
chosen one and right otherwise. The nodes to be compared
are the children of the chosen node with the nodes from the
previous level that were not chosen; starting of by comparing
V. O N - LINE VISIBILITY GRAPHS : MERGING BINARY TREES the two roots of the trees to be merged. The merge algorithm
Every time a node is added to an existing binary search tree, is illustrated step by step at the top and bottom of Figure 4.
it essentially ‘travels’ down the tree, going left if smaller and In the example in Figure 4.A, the blue and red tree are to
right if larger, until it finds an empty space (see pseudocode be merged. Initially, the blue root is compared to the red root.
function add in Algorithm 1). Therefore when a node is added Since the blue root has a larger value than the red root, it will
to an existing binary tree there is no need to recalculate the be chosen to take that position in the resulting tree (i.e. the
tree structure from scratch. Due to the fact that the proposed root of the resulting tree). The red root will then travel down
6

Fig. 4. Visual representation of the proposed method to merge two maxima binary trees, covering both append (A) and insert (B) operations. This corresponds
to an on-line scenario where a new batch (red) needs to be incorporated to an existing structure (blue).

the right branch as it index is larger than the chosen blue root, and that child will be broken thereafter. For example, in Figure
leaving the left branch of the chosen blue root untouched. 4.B., this situation takes place in layer 3, where Node 7, the
Consequently the right blue child is to be compared with child of Node 2 belongs on the right branch of Node 5 unlike
the red root. In this case, the red root has a larger value and its parent.
so it will take the right branch position in the resulting tree.
Now is the turn to the right blue child to descend down the VI. N UMERICAL E XPERIMENTS
red tree. Since the blue child happens to be the lowest value In this section we present empirical results in order to show
in the series, it will just descend layers following the binary how the proposed visibility algorithm compares to the state of
search tree rules until is reaches an empty spot. the art. All the code related to this paper and necessary to run
Usually, as one may observe in Figure 4, the children of the following experiments is implemented in Python 2.7 and
the nodes that travel down in depth are not included in the freely available online 2 . The machine used in the simulations
level comparison. However, when new data is to be inserted is an early 2015 MacBook Pro Retina with a 2.9GHz Intel
to the existing series, the child of the node traveling down Core i5 processor and 16GB of RAM.
could have an index corresponding to the other branch of the
resulting tree. In this case, the connection between the node 2 Available at https://github.com/delialia/bst
7

Fig. 5. Computation time of the natural visibility graph (nvg, second row) and horizontal visibility graph (hvg, third row) of different time series (examples
on first row) using the current visibility algorithms: Basic, Divide & Conquer (DC), and the proposed binary search tree (BST) method. Each point at every
series size is the mean of the computation time for 10 series of that size.

To put the presented algorithm into context [17], in Figure 5 to vary very little between data types in comparison to the
we report the computation time needed by current visibility relatively high spread observed for the basic algorithm.
algorithms on different synthetic time series of increasing
The horizontal visibility computation remains stable in both
length. Since the actual efficiency of each algorithm depends
the DC and proposed method, and could potentially be con-
to some extent on the character of the original time series,
sidered independent of the data type given a time computation
we considered uniform random noise (which has no structure
scaling factor. This behaviour was expected as the proposed
and on average produces almost-balanced binary search trees),
method is fully defined by the aforementioned connectivity
a Conway series (which has a quite rich structure and corre-
rules and has average-case time complexity O(n log n).
sponds to a quite unbalanced tree), and a random walk series
(which represents the more realistic scenario of a signal with On the other hand, Figure 6 suggests that the efficiency of
both structure and noise). the computation of natural visibility graphs is subject to wider
In the first case we observe the largest gap in computation fluctuations. The position of the maximum in the time series
time between the basic algorithm and the more efficient affects the efficiency of both the DC and the proposed method,
ones as it corresponds to the aforementioned average case as it will determine the number of additional visibility checks
where both algorithms (DC and the proposed one) significantly needed to obtain the natural visibility graph.
reduce the number of operations. Such differences are more An English speech time series will typically have its max-
prominent in the computation of the horizontal visibility graph. imum somewhere towards the middle section of the signal
Additionally, in Figure 6 we present a similar computa- (since we rarely tend to raise our voice at the end of our
tional time analysis over real samples of speech (English speech). Therefore the speech time series proposed codec will
language) [10] and financial data [23]. Figure 6 is particularly most probably produce an almost balanced binary search tree,
interesting as it clearly shows a correlation between time com- yielding a time complexity of O(n log n). For this reason, one
putation and the time series structure (please note the different may observe a wider gap in computation time between the
scale for time computation). Even though the time computation basic method and the faster alternatives for the speech data in
may differ, the DC and proposed method distribution seem Figure 6 than for the financial time series.
8

Fig. 6. Current and proposed visibility algorithms computation time for 100 speech and finance time series of 1000 points. The speech time series are sampled
from the training TIMIT dataset [10]. The finance time series corresponds to the 2013 quarterly data used in [23].

In terms of computation time, the proposed method and the the new batch is simply added to the time series itself and
DC one are closely related. They are both quicker than the then the binary tree codec must be re-computed from scratch.
basic implementation in both natural and horizontal visibility In the proposed on-line approach, the next batch is encoded
and they both present similar trends for increasing time series into its own binary tree that is then merged to the existing
size (Figure 5). However, the proposed algorithm has proven codec using the procedure detailed in Algorithm 2. Note that
to consistently be the quickest option for horizontal visibility the decoding step remains the same for the on-line and off-line
graph computation. On the other hand, the DC algorithm in approach, and so the comparison will essentially be between
general does perform better than the proposed method for computing a codec from scratch (off-line) and merging two
natural visibility computation. Even though at this point both codecs into a single binary search tree (on-line).
DC and the proposed method seem equally good of an option Figure 7 shows how much quicker the computation of
for fast visibility computation, the presented algorithm has the the on-line method (codec for new data + merging) is in
additional property of allowing on-line assimilation of new comparison to the computation time of the off-line approach
data, which is something not easily achievable in either the (codec from scratch), for different time series and batch sizes.
basic approach or the DC algorithm. In particular, the on-line approach is always better if the new
The most straightforward way to asses the on-line func- batch to be added is equal or bigger than the existing time
tionality of the proposed method is to compare it with the series, especially for large time series.
equivalent off-line approach. In our case, it directly relates to
the binary tree codec. Given a batch of new points to be added
to the time series visibility analysis, in the off-line approach,
9

[4] J. F. Donges, R. V. Donner, and J. Kurths. Testing time series irre-


versibility using complex network methods. EPL (Europhysics Letters),
102(1):10004, apr 2013.
[5] R. V. Donner, M. M. Small, J. F. Donges, N. Marwan, Y. Zou, R. Xiang,
and J. Kurths. Recurrence-based time series analysis by means of
complex network methods. International Journal of Bifurcation and
Chaos, 21(04):1019–1046, 2011.
[6] R. V. Donner, Y. Zou, J. F. Donges, N. Marwan, and J. Kurths. Re-
currence networks: a novel paradigm for nonlinear time series analysis.
New Journal of Physics, 12(3):033025, 2010.
[7] J. H. Feldhoff, R. V. Donner, J. F. Donges, N. Marwan, and J. Kurths.
Geometric signature of complex synchronisation scenarios. EPL (Euro-
physics Letters), 102(3):30007, may 2013.
[8] P. Fiedor. Networks in financial markets based on the mutual information
rate. Phys. Rev. E, 89:052801, May 2014.
[9] R. Flanagan and L. Lacasa. Irreversibility of financial time series: A
graph-theoretical approach. Physics Letters A, 380(20):1689 – 1697,
2016.
[10] J. S. Garofolo, L. F. Lamel, W. M. Fisher, J. G. Fiscus, and D. S.
Pallett. Darpa timit acoustic-phonetic continous speech corpus cd-rom.
nist speech disc 1-1.1. NASA STI/Recon technical report n, 93, 1993.
[11] J. Iacovacci and L. Lacasa. Visibility graphs for image processing. IEEE
Transactions in Pattern Analysis and Machine Intelligence, in press.
[12] L. Lacasa and J. Iacovacci. Visibility graphs of random scalar fields and
spatial data. Phys. Rev. E, 96:012318, Jul 2017.
[13] L. Lacasa, B. Luque, F. Ballesteros, J. Luque, and J. C. Nuno. From
time series to complex networks: The visibility graph. Proceedings of
the National Academy of Sciences, 105(13):4972–4975, 2008.
[14] L. Lacasa, B. Luque, I. Gmez, and O. Miramontes. On a dynamical
Fig. 7. Given a random time series (size L) and a batch of new random approach to some prime number sequences. Entropy, 20(2), 2018.
points (size N ) to be added to it, this plot shows the advantage, in terms [15] L. Lacasa, V. Nicosia, and V. Latora. Network structure of multivariate
of computation time, of the proposed on-line approach versus the off-line time series. Scientific reports, 5:15508, 2015.
alternative. The proposed method computation time is the time it takes to [16] L. Lacasa and R. Toral. Description of stochastic and chaotic series
build the maxima tree of the new points and merge it with the existing time using visibility graphs. Phys. Rev. E, 82:036120, Sep 2010.
series tree (i.e. ton−line ). The off-line alternative computation time is the [17] X. Lan, H. Mo, S. Chen, Q. Liu, and Y. Deng. Fast transformation from
time it takes to build a new maxima binary tree from scratch including the time series to visibility graphs. Chaos: An Interdisciplinary Journal of
new points to the time series (i.e. tof f −line ). The time ratio is the log scale Nonlinear Science, 25(8):083105, 2015.
of tof f −line /ton−line , how much quicker the proposed method is. The size [18] W. Liao, J. Ding, D. Marinazzo, Q. Xu, Z. Wang, C. Yuan, Z. Zhang,
ratio is L/N , how much bigger the time series is compared to the batch to G. Lu, and H. Chen. Small-world directed networks in the human
be added. Both append and insert scenarios are represented here, 10 random brain: Multivariate granger causality analysis of resting-state fmri.
cases of each were computed. The point in the graph is the mean of these 20 NeuroImage, 54(4):2683 – 2694, 2011.
cases and its uncertainty is captured by the error bars. [19] B. Luque, L. Lacasa, F. Ballesteros, and J. Luque. Horizontal visibility
graphs: Exact results for random time series. Physical Review E,
80(4):046103, 2009.
[20] B. Luque, L. Lacasa, F. Ballesteros, and J. Luque. Horizontal visibility
VII. C ONCLUSION graphs: Exact results for random time series. Phys. Rev. E, 80:046103,
The proposed visibility algorithm based on an encoder/de- Oct 2009.
[21] R. Mantegna. Hierarchical structure in financial markets. Eur. Phys. J.
coder approach is, up to the authors’ knowledge, the first B, 11(1):193?197, Sep 1999.
efficient on-line algorithm to compute visibility graphs. The [22] D. Marinazzo, M. Pellicoro, and S. Stramaglia. Kernel method for
analysis and the numerical experiments shown in the paper nonlinear granger causality. Phys. Rev. Lett., 100:144103, Apr 2008.
[23] N. Musmeci, V. Nicosia, T. Aste, T. Di Matteo, and V. Latora. The
confirm that the proposed algorithm represents a substantial multiplex dependency structure of financial markets. Complexity, 2017,
improvement over the state-of-the art for horizontal visibility 2017.
computation, and is on par with the most efficient natural [24] N. Musumeci, V. Nicosia, T. Aste, T. D. Matteo, and V. Latora.
The multiplex dependency structure of financial markets. Complexity,
visibility algorithm (i.e. DC) available. Moreover, the pro- 2017(9586064), 2017.
cedure to assimilate new data by means of merging the [25] A. M. Nuñez, L. Lacasa, J. P. Gomez, and B. Luque. Visibility
corresponding binary search tree encoding into the existing algorithms: A short review. In New Frontiers in Graph Theory. InTech,
2012.
tree allows for efficient on-line computation of visibility [26] S. Sannino, S. Stramaglia, L. Lacasa, and D. Marinazzo. Visibility
graphs, and represents a substantial speed-up with respect to graphs for fmri data: Multiplex temporal graphs and their modulations
the existing off-line algorithms. This novel on-line capability across resting-state networks. Network Neruroscience, 1(3):208–221,
2017.
broadens the applications for visibility graphs at no additional [27] A. H. Shirazi, G. R. Jafari, J. Davoudi, J. Peinke, M. R. R. Tabar, and
computational cost. M. Sahimi. Mapping stochastic processes onto complex networks. Jour-
nal of Statistical Mechanics: Theory and Experiment, 2009(07):P07046,
R EFERENCES 2009.
[28] I. G. Torre, B. Luque, L. Lacasa, J. Luque, and A. Hernández-Fernández.
[1] G. Bonanno, F. Lillo, and R. Mantegna. High-frequency cross- Emergence of linguistic laws in human voice. Scientific reports, 7:43862,
correlation in a set of stocks. Quantitative Finance, 1(1):96–104, Jan 2017.
2001. [29] Y. Yang and H. Yang. Complex network-based time series analysis.
[2] E. Bullmore and O. Sporns. Complex brain networks: graph theoretical Physica A: Statistical Mechanics and its Applications, 387(5):1381 –
analysis of structural and functional systems. Nat Rev Neurosci, 1386, 2008.
10(3):186–198, Mar. 2009.
[3] E. Bullmore and O. Sporns. The economy of brain network organization.
Nat Rev Neurosci, Apr 2012.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy