Analysis of Stock Price Motion Asymmetry via Visibility-Graph Algorithm

This paper is the first to differentiate between concave and convex price motion trajectories by applying visibility-graph and invisibility-graph algorithms to the analyses of stock indices. Concave and convex indicators for price increase and decrease motions are introduced to characterize accelerated and decelerated stock index increases and decreases. Upon comparing the distributions of these indicators, it is found that asymmetry exists in price motion trajectories and that the degree of asymmetry, which is characterized by the Kullback-Leibler divergence between the distributions of rise and fall indictors, fluctuates after a change in time scope. Moreover, asymmetry in price motion speeds is demonstrated by comparing conditional expected rise and fall returns on the node degrees of visibility and invisibility graphs.


INTRODUCTION
The use of network science to perform time series analysis has emerged in recent decades. Of the numerous approaches to rendering a time series into a complex network, three major categories of approaches have most attracted researchers' attention [1][2][3][4][5][6][7][8][9][10][11]. The first approach uses recurrence networks and was introduced by Donner and Zou et al. in 2009 [5][6][7][8]. This approach analyzes phase space recurrence of a time series from a geometric point of view by interpreting the recurrence matrix of a time series as the adjacency matrix of a complex network. Transition networks represent the second major approach to transform a time series into a complex network. These networks are constructed by partitioning the phase space of a dynamic system and were introduced by Nicolis et al. in 2005 [9]. Hence, a node in a transition network represents a certain discrete state or pattern that describes the dynamic system. Direct links are established if one of the nodes is followed by another with nonzero probability along the time series [10]. The third category is the algorithmic group of visibility graphs (VG) [11]. In 2008, Lacasa et al. proposed an effective method called the visibilitygraph algorithm (VGA) for converting a time series into a graph network by analyzing the mutual visibility relationships between points and cutting points in a computational geometry landscape [12,13]. This concept has attracted great interest and numerous extensions of the standard VGA have been proposed. Luque et al. [14] came up with a simplified VGA called a horizontal visibility graph (HVG) to transform a time series into a complex network. Specifically, two observations are connected in an HVG if and only if there are no obstacles in between [15]. Based on the concepts of the VG and HVG, parametric VGs introduce a viewing angle α and allow one to study the dependence of network structural measures on α [16]. Limited penetrable VG (LPVG) is a less restricted HVG in which two observations are connected if either one has a larger value than the obstacles in between [17,18]. Analyses of financial time series via a VG approach have been studied intensively [19][20][21][22][23][24][25][26][27][28][29]. For example, Long Yu discovered small-world characteristics in visibility-graph networks converted from the time series of the price of gold and its returns [24]. Moreover, Yao et al. found that exchange-rate networks converted from the currency-rate time series of the US dollar, euro, yen, and sterling against the Chinese yuan share consistent topological characteristics with hierarchical structures and mixed small-world and scale-free properties. They also discovered that network communities are actually composed of large numbers of trending points and small numbers of discrete peaks and trough points [25]. Furthermore, a novel method that combined VGA with link prediction was proposed by Zhang et al. to forecast the time series. Using fuzzy logic, better predictability can be achieved by fusing the direct and indirect effects of historical data [26].
Asymmetry in financial time series has generally been explored via statistical analysis [30][31][32][33][34][35][36][37][38][39][40][41][42]. Typically, it is found that the distribution of time horizons over which a detrended stock index moves from an arbitrary initial return to a predetermined positive level deviates to a symmetrically predetermined negative level [37][38][39][40]. This property is known as the gain-loss asymmetry and has been regarded as a characteristic of financial time series [30,34,36,37]. Another well-known asymmetry, which describes the negative correlation between volatility and the direction of price motion, is the leverage effect [41]. Recently, Jiang et al. investigated asymmetry in large-scale price fluctuations. Analyses reveal that dynamic relaxation before and after large fluctuations is characterized by a power law with exponents p + and p − . On minute time scales, large-fluctuation dynamics are time-reversely symmetric with p + p − . On daily time scales, however, large price fluctuations that approach financial crashes are asymmetric with p − ≠ p + [42]. We shall point out that the results of these studies are rather generic in the sense that only the price increases and decreases are considered. In fact, price motions can be classified in more detail into accelerated or decelerated rise (AR; DR) and fall (AF; DF), depending upon the convexity or concavity of the price motion trajectories. Symmetry analysis should also be performed by taking these four types of price motion trajectories into account. However, since different price motion modes can form different convoluted temporal structures, it would be quite difficult to decompose these price movements via statistical approaches.
In this paper, we propose to study the financial time series asymmetry via visibility-graph networks based on the intuition that network approaches may be more effective in identifying different price motion trajectories. Hence the terminology of symmetry in this study specifically refers to the topological symmetry of the price motion trajectories. In particular, in a stock price series, we are concerned with whether concave and convex price motions can form a time-reversed symmetry. The research question reads as follows: whether those accelerated/ decelerated price rises are statistically symmetric with those decelerated/accelerated falls. It is worth mentioning that conventional VGA analysis cannot be applied directly to investigation of the topologically asymmetric properties of financial series because the method is incapable of distinguishing different stock price rise and fall trajectories by mapping the time series as a whole onto an undirected network. To solve this problem, an idea from Yan et al. (2012) [43] is borrowed to address discrimination between price movements via visibility and invisibility-graph (IVG) networks. Using these graph networks, asymmetry in stock index motion can be measured using concave or convex indicator distributions or expected returns that are conditional on node degrees, instead of the conventional waiting-time statistics.
Recently, fruitful results have been achieved in the investigation of time series time reversibility using the HVG method [44][45][46][47][48][49][50][51]. In a study on how crises affect the motions of US stock prices, different market price behaviors are identified by examining the series irreversibility evolved over the time [50,51]. Based on the notion that the reversed and original processes are statistically distinguishable if a stationary process is time-reversible, we may postulate that a topological symmetric time series must be a time-reversible one, and vice versa. A quantitative analysis of this postulation is also conducted.
The whole paper consists of four sections. Following the introduction of the study in Section 1, the methodology is detailed in Section 2. Asymmetry in price motion trajectories and speeds is analyzed using graph networks in Section 3 and 4, respectively. Finally, conclusions are described in Section 5.

Basic Algorithms
Graph networks for AR and DF motions of a stock index can be constructed by mapping a time series of length L, X(t i )(i < L) onto a graph network using VGA. To start, two arbitrary data points (t a , x a ) and (t b , x b ), where a < b, are specified. Two vertical lines are drawn exactly at t a and t b , with heights equal to the values of x a and x b , respectively. Next, the endpoints of the two vertical lines are connected via a straight line whenever vertical lines from any other data points within the range (t a , t b ) do not cut off the connection. That is, if any intermediate data point (t c , x c ) fulfills the condition the two data points (t a , x a ) and (t b , x b ) are visible to each other. The invisibility-graph algorithm (IVGA) [43] can be used to build up the networks that describe DR and AF motions of a stock index. In contrast to the VGA, here, the data points (t a , x a ) and (t b , x b ) are connected only if the point (t c , x c ) intersects the connecting line. Hence, the relationship between these three data points is transformed into the following: Based on Yan's study [43], three conditions are further applied to distinguish AR and DF in VG as well as DR and AF in IVG. These conditions are stated as follows: 1. Any data point in the time series can be linked only to data points located on its left-hand side. 2. The link between (t a , x a ) and only if x b > x a when constructing the graph network for price increases, and vice versa when constructing the graph network for price decreases. 3. A moving time scope S is used to construct a graph network throughout the entire time series; therefore, there is no link between (t a , x a ) and With these three additional conditions, VGA and IVGA can capture rise and fall trends by eliminating links converted from the short-term disturbing price motions. We demonstrate the capture of time series topological symmetry in Figures 1 and 2. The networks in Figures 1 and 2 are built from an artificial time series that combines the original Hang Seng Index sample data with its mirror-symmetric counterpart. Figure 1 shows that VGA can distinguish the concave trajectory of the price rise from other price motions. For those data points located on the concave upward trend (from node 11 to node 14 in the original HSI section and from node 24 to node 26 in the reversed HSI section), the degree numbers of AR nodes are higher. For other data points, in contrast, the degree numbers are lower. VGA can also distinguish concave decreasing price motions as well (from node 3 to node 5 in the original HSI section and from node 15 to node 19 in the reversed HSI section). In Figure 2, however, the convex trajectories of price motions are captured effectively by IVGA based on the degree distributions for price rise (from node 10 to node 12 in the original HSI section and from node 26 to node 28 in the reversed HSI section) and price fall (from node 1 to node 3 in the original HSI section and node 17 to node 19 in the reversed HSI section). Obviously, the artificial time series has perfectly symmetric price motion trajectories since the concave (convex) rise in the original HSI section has a corresponding convex (concave) fall in the reversed HSI section. The identical rising and falling degree distributions of VGs and IVGs in Figures 1 and 2 reveal that this artificial time series does have a perfect topological symmetry. Given the definition of time reversibility, a topologically symmetrical time series must be a time-reversible one. The reason lies in that if a time series is topologically symmetrical, the reversed and original processes should be statistically indistinguishable with regard to the degree distributions of nodes.

Concave and Convex Motion Indicators
To formalize the algorithms shown above, we specify a node b in a time series of length L and set a time scope S (S < L/2). Based on Eq. 1, node a, which has a link to node b in the visibility-graph network, should belong to the following set: Employing the three additional conditions described in Section 2.1, the subsets of nodes that connect to node b in the price rise and price fall trajectories are defined as follows: Hence, the degree of node b in the visibility-graph rise and fall networks reads as By definition, D X VG ∈ [1, 2S], X R, F. The concave motion indicator for a node i is proposed to be the following: Note that, for an ideal concave trajectory consisting of L data points, the concave indicators along the time axis can be sketched as in Figure 3. For a realistic time series, the distribution of this indicator measures how perfectly a concave curve could fit the ideal AR or DF price motion trajectory. Hence, the mean value of I R,F CC can be a measure of the smoothness of AR or DF price motions. The higher the I R,F CC , the less the zigzag price variation, and vice versa.
In the same manner, the mathematical set that describes the invisibility-graph network can be written as Subsets of the rise and fall trend read, respectively, as follows: The degree of node b in the invisibility rise and fall networks is Convex motion indicators can thus be defined via the distribution of which measures how perfectly a convex curve can fit an ideal DR or AF motion price trajectories. Likewise, I X CV measures the smoothness of the price motion trajectory. A quantitative measure of the topological asymmetry in price motion trajectory can be done via the distinguishability between distributions of the concave and convex rise/fall indicators defined above. Specifically, denoting the distribution of rise indicators as P(I R CC,CV ) and the distribution of fall indicators as P(I F CC,CV ), a topologically symmetric time series should have P(I R CC,CV ) P(I F CC,CV ). On the other hand, the degree of topological asymmetry is measured by calculating the Kullback-Leibler divergence (KLD) of P(I R CC,CV ) and P(I F CC,CV ). Stemming from information theory, KLD is employed as a measure of the distance between two probability distributions [52,53]. KLD of concave/convex rise and fall indicators distributions can be calculated as follows: which equals 0 if and only if P(I R Y ) Q(I F Y ) and exceeds 0 otherwise.

ASYMMETRY IN TRAJECTORIES OF PRICE MOTION
Analyses that include the application of VGA and IVGA to the stock indices of various countries and regions are presented in this section. Eight data sets from international stock market indices that span from June 28, 1999 In the upper panel of Figure 4, the long-lasting bubble right before the subprime mortgage crisis in 2008 is characterized by clusters of large concave rise indicators. The large concave fall indicators in the lower panel of Figure 4, however, characterize the decelerated fall of the index over 3 years after it reaches 18,000 points on March 27, 2000. The large convex rise indicators in the upper panel of Figure 5 show that the Hang Seng Index exhibits a decelerated rise from 2009 to 2011 after the subprime mortgage crisis. The notorious 2008-2009 crisis is represented by the extraordinarily large values of convex fall indicators in the lower panel of Figure 5. Both figures show that the concave rise indicator changes asynchronously with its fall counterpart, just as the convex fall indicator changes asynchronously with its rise counterpart.
To illustrate asymmetry in the price motion trajectories for these eight financial time series, distributions of I R, F CC and I R, F CV are   Tables 1 and 2, respectively. The SSEC AR and DF motions are smoothest since its I R CC and I F CC rank first in magnitude among the others in the table. With regard to the DR motions of stock indices, the Indian market behaves in the smoothest manner because the I R CV of the BSESN is larger than those of any other indices. On the other hand, the zigzag AF appears less frequently in the Chinese stock market than in other markets, as suggested by the fact that the SSEC has the largest I F CV in Table 2. These observations are consistent with empirical evidence that emerging financial markets are less efficient than developed markets. The presence of fewer price oscillation in emerging markets implies that investors are more likely to form a herd.
As the time scale can be an important factor that influences the topological asymmetry in stock price motion, we measure the KLD between the rise and fall distributions of I CC and I CV with different time scopes as S 100, 130, 160, . . . , 610. Values of KLD between the rise and fall I CC distributions are shown in Figure 8 as functions of the time scope for the eight stock indices, as well as for a purely random time series. Compared with the KLD of the random series depicted in blue line dots, the DJIA and BSESN have an impressively higher value than any other stock indices. This indicates higher degrees of asymmetry between AR and DF price motions for these two indices. On the other hand, the dependence of KLD on the time scope is rather weak outside of the DJIA, SSEC, and BSESN.
The KL-divergence values between rise and fall I CV distributions are shown as functions of time scopes in Figure 9 for the eight stock indices, as well as for the purely random series. Except in the case of BSESN data, the overall degree of asymmetry between DR and AF price motions is weaker than that in Figure 8. However, the dependence of the KL divergence on the time scope strengthens in all cases except for the FCHI, FTSE, and Nikkei 225.
In Figures 8 and 9, we note that the KLDs for random series are close to 0 and vary little as the parameter S changes. This is in agreement with the postulation that time-reversible time series are topologically symmetrical. On the other hand, the bigger KLDs for stock indices shown in the same figures are consistent with the finding in the previous study on time irreversibility in stock indices via the HVG method [45], which states that a chaotic time series results in a bigger KLD between in-and outdistributions than a Gaussian time series does.
In addition, KLDs of the BSESN are found to be dramatically higher than those of other stock markets in Figures 8 and 9. In particular, the observation that the BSESN KLD follows an increasing trend in Figure 9 indicates that the Indian stock market index exhibits a long-term, low-speed rise. This is in line with observations that the Indian stock market was in a bull market for over 20 years until the coronavirus outbreak. The KLD results in Figure 8 also show that the DJIA has relatively large topological asymmetry between AR and DF price motions during the period from 1999 to 2019, which indicates that the price is pushed upwards mostly by AF motions in the USA bull markets. As Yan et al. [43] published, the AR price motion implies a superexponential growth typically caused by investors' herding behavior. Over the past decade, there have been several reports on herd buying behavior of AAPL and MSFT [54,55]. A report published on December 4, 2019 [56], said "The Dow Jones Industrial Average owes Apple and Microsoft corporation a big thanks." These reports may explain why AR motions dominate the movement of DJIA index.

ASYMMETRY IN SPEEDS OF PRICE MOTION
Yan et al. argued that a higher degree number k a indicates a higher possibility that the time series is growing at a superexponential rate at time tick a; hence, the degree number of VG/IVG could be a good indicator for the proximity to the point of a bubble-and-crash regime shift [43]. However, we should point out that such an argument may not be accurate because the high VG degree number can also be a result of a relatively low-speed and smooth growth as long as the time scope is large enough. As the price approaches the critical point in stock markets, the magnitude of fluctuations becomes dramatically large. Therefore, the correlation between degree number k a and price return r a should be a more appropriate indicator showing the possibility for the stock index to grow/drop at the exponential rate (for AR and DF motions) or at the logarithmic rate (for DR and AF motions). Comparisons of these indicators may reveal the asymmetry in the speeds of price growth and drop. In order to measure the asymmetry in the speeds of price motion, the expected price return r over a unit time span is calculated conditionally on the node degree k in VG and IVG networks. The conditional expected index return is defined as follows: where r a log P a − log P a−1 . P a is the stock index, k a is the node degree at time tick a, and δ(x) is the Kronecker delta function. The conditional expected price rise and fall returns on the node degree in VG and IVG networks are defined as follows in order to illustrate the asymmetry in the speeds of price growth and price drop for the eight aforementioned financial time series: where H(x) is a Heaviside step function [12].  The expected rise and fall returns that are conditioned on the VG node degree for eight stock indices are plotted in Figure 10, while those conditioned on the IVG node degree are in Figure 11. Expected return data points are fitted linearly and shown as black lines for rise motions and pink lines for fall motions, respectively, in Figures 10 and 11. The slopes of the fitting lines show the correlated relationships between expected returns and degree regardless of whether the trajectories are concave or convex. The larger the absolute slope, the more significantly a stock index exhibits a superexponential or a logarithmic motion.
For concave price trajectories in Figure 10, stock indices can be classified into four categories. For category I, which includes the DAX and FCHI, the rise in absolute slope is almost the same as the fall in absolute slope, and both the rise and fall slopes are quite small. This implies that AR and DF are not the main forms in which these two stock markets exhibit bubbles and crashes. For category II, which includes the DJIA and FTSE, the absolute rise slope is far smaller than the fall slope. This suggests that it is possible for the price to decrease at a logarithmic fall rate after stock crashes in these two markets. For case III, which includes  Frontiers in Physics | www.frontiersin.org November 2020 | Volume 8 | Article 539521 Figure 11, the absolute fall slopes exceed the rise slopes for all of the stock indices. This implies that all of the markets crash at logarithmic rates. We also note that the FTSE and FCHI have rather large absolute rise slopes, which means that the price approaches the critical point in the DR way within the bubble regimes. Overall, the findings in this section agree with the previous studies of gain-loss asymmetry [37][38][39][40]. In particular, stock market prices fall faster than they rise in developed countries. The analysis in this study provides a clearer picture regarding the conclusion made in Ref. [40] that the rise speed overtakes the fall speed in developing country stock markets, such as those of India and China. Indeed, the speed of AR price motion is larger than that of DF motion, while the speed of AF price motion exceeds that of DR motion, just as in mature markets.

CONCLUSION
In this paper, we developed a new concept of financial time series asymmetry based on the topological distinguishability of price motion trajectories. A new application of VGA and IVGA was developed to capture different types of price motion trajectories. Measures based on VGA and IVGA were employed to analyze asymmetry in price motion trajectories as well as in price motion speeds. To analyze topological asymmetry in price motion trajectories, we compared the distributions of concave and convex indicators for both rise and fall price motions. Deviations in rise and fall indicator distributions among VG and IVG networks showed that AR-DF and DR-AF stock index motions are asymmetric with each other. To investigate the influences of time scopes, the relation between KLD and time scope was also illustrated. Unlike with the random series, the KLD of stock index rise and fall indicator distributions is significant and the dependence of KLD on time scopes is strong. This is especially true for Indian and American stock indices.
Furthermore, we calculated the conditional expected index return on node degree to show asymmetry in price motion speeds. The rise and fall conditional expected index returns on VG or IVG network node degrees were distributed in an asymmetric manner, which indicates that asymmetry is embedded in AR-DF and DR-AF price motion speeds when the stock index approaches a bubble-and-crash regime shift. Our result was in line with gain-loss asymmetry overall. However, it offered details regarding why AF motions in emerging markets (e.g., China and India) contribute to faster rises and slower falls.
As a byproduct of this study, we also get some knowledge of the relationship between the topological symmetry and the time reversibility of a time series. By the definition of time reversibility, we proved, with an artificially combined piece of HSI time series, that the topologically symmetrical time series must be timereversible. On the other hand, by checking the topological symmetry of a random series, the numerical evidence, which supports the postulation that a time-irreversible series must be topologically asymmetric, has also been found.
Future research will include exploration of topological asymmetry in other empirical data that exhibits chaotic behaviors, such as sunspots, heartbeats, and earthquake waves. The relation between topological symmetry and time reversibility is also to be investigated theoretically. Finally, the most important task is to explore how topological symmetry among financial time series affects the time reversibility. In this sense, we must study the network properties of VG and IVG networks and identify network characteristics right before large-scale price changes.

DATA AVAILABILITY STATEMENT
The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation, to any qualified researcher.