Application of a New Quantitative Approach to Stock Markets : Minimum Spanning Tree

The systems involving interacting agents such as food networks, scientific citations, social networks, communication networks, the Internet, and the companies interacting in stock portfolios have long been studied by many researchers under the concept of complex systems. Such systems are expressed in terms of weighted networks. The dense connections and entwined relations amongst the agents play important roles for forecasting or risk analysis. In this study we present a novel approach to determine hierarchical structure of Industrial sector in the globally operating stock market network. By using the subdominant ultra-metric topology emerge from the minimum spanning tree of the stock market network; it becomes possible to extract the important properties of this complex system. Moreover, we use the dynamic time warping distance to determine the taxonomy and to measure similarity between time series of the operating Industrial sectors. It is found that United States, United Kingdom, Netherlands and Denmark are the most dominant stock exchanges in Industrials sector. We also find three hierarchical clusters and then topologically analyze the structure of considered clusters.


Introduction
The stock market is a regulated and organized financial market where investors buy and sell shares of publicly traded companies.There are several relations and interactions between the market structures.The problem is whether there is a suitable scientific representation of the relevancy between stock markets that would allow one to have helpful information about the nature of the market.Recently, graph-theoretical representation and analysis of the financial markets has been studied by many authors.In 1999, Mantegna [1] suggested mapping of the stocks into the graph nodes.By using the Pearson's correlations between the particular pairs of stock returns, the relations between stocks are projected into the graph edges.Under the inspiration of Mantegna's paper, the studies [2][3][4][5][6] are prepared on various branches of financial markets by using minimum spanning tree (MST).The concept of the MST could be considered as a minimal graph that covers all nodes without loops.Moreover the MST allows us to visualize complex and sophisticated relations by presenting in an uncomplicated manner.
Recently, differing from previous studies some authors focus on MST diagram employing dynamic time warping.In [7] authors analyzed the relations between foreign exchange currencies before, during, and after the US subprime mortgage crisis.Sectorial hierarchy in Turkish stock exchange market (Borsa Istanbul) has been investigated by using MST based on dynamic time warping [8].In this manner here we consider dynamic time warping instead of classical correlation to weight the edges of MST.The MST is constructed to visualize the relations of the stock prices changes in Industrials sectors between different stock markets.Then hierarchical tree is constructed for clustering.Finally determined clusters were analyzed through numerical calculations.In section 2, basic information about the considered data, MST, and methods for analyzing the structure of the clusters is provided.In section 3, the results are presented as MST diagram, dendrogram of hierarchical tree and analyzing table for the structure of clusters.In section 4, concluding remarks are discussed.MSTs for each cluster are also considered to analyze the topology evolution of each cluster.

Data and Methodology
To analyze the topology evolution of considered stock market clusters, here we state the evaluation criteria given by [7].First, the mean similarity measure (MSM) for the n×n similarity matrix D, is defined as where  is the number of stock exchanges in the investigated cluster.Then the normalized tree length (NTL) is defined by [10] as, where Ω is the set of edges, and  − 1 denotes the number of edges in the considered MST.Finally to quantify the average minimal route between pairs of nodes, we give the definition of the characteristic path length (CPL) as,   ,  ,: 1 1 where   is the number of edges in the shortest path between nodes  and  [11].By finding CPL we may understand how compact the structure of investigated network.After all, values   ,   and   for the determined 3 clusters are presented in Table 2.All computations and plotted graphs are obtained with the help of software Mathematica 11.

Results
In this section we first analyze the similarity degree of the stock exchanges focusing on Industrials sectors of 25 countries around the world is represented by the MST approach.Obtained MST diagram is demonstrated in Figure 1.Further dendrogram is obtained by using hierarchical clustering by dynamic time warping.Plotted dendrogram is presented in Figure 2. Finally the topology evolution of clusters is investigated and the results are presented in Table 2.By investigating the hierarchical clustering depending on dynamic time warping, we reach the dendrogram presented in Figure 2. According to Figure 2, the 3 obvious clusters of stock exchanges are obtained.It is seen that DE, GB, US and MY clustering together.The second obvious cluster is BE, NL, DK, FR, IS, FI, SE and PT.The third cluster is consisting of CA, MX, CI, TH and NA.Moreover the couples AU, SA and BR, HK are forming clusters of 2 nodes.However these clusters are omitted for topology evolution analysis due to not having enough number of nodes.VE is near to the first cluster and so is KW to the second; however they are also not having the desired similarity with nearby clusters.The other exchanges IT and TR are neither able to form a cluster nor have enough similarity with other clusters.
Alphanumeric Journal Volume 5, Issue 1, 2017 The numerical comparison of MST properties of the considered 3 clusters is calculated in Table 2. Three network property measures namely, mean similarity measure, normalized tree length and characteristic path length are used to analyze the topology evolution of determined clusters.The average distance of edges in MST of the clusters could be found by normalized tree length.It is seen that third cluster has the smallest value so nodes in the third cluster are nearer to each other by comparing to other clusters.Further, regarding the Table 2 the characteristic path lengths are investigated.The results indicate that first cluster is the tightest and second one is the loosest cluster.

Conclusion
This study aims mathematical and quantitative approach to social sciences.By this way it is possible to have more reliable comparison of complex systems than classical methods obtained MST, it is seen that GB, US, NL and DK are located in the center of studied stock exchanges.It can be said that other studied 20 nodes (stock exchanges) are directly or indirectly connected to these 4 central nodes.Then hierarchical tree based on dynamic time warping is demonstrated through a dendrogram.Further, regarding to dendrogram hierarchical clusters were formed.Then the structures of clusters were analyzed by numerical calculations.With respect to the results it is found that US, DE, GB and MY indices are close and forming a cluster.We realized that second cluster grouped similarly with the geographical regions of corresponding countries in the world.Following stock exchanges are included in the second cluster BE, NL, DK, FR, IS, FI, SE and PT.Also CA, MX, CI, TH and NA are forming another cluster.Finally it is found that the nodes of first cluster are the closest to each other, and the third cluster is the tightest cluster.
It is not easy to find clusters in the MST of investigated stock exchanges.Therefore by using hierarchical clustering we build a dendrogram presented in Figure2, depending on dynamic time warping.With respect to the dendrogram, 19 investigated stock exchanges are separated into 3 clusters.It is seen that other 6 stock exchanges are grouping as 2 couples and 2 stock exchanges that does not have enough similarity to form a cluster.For topology evolution of clusters, 3 clusters formed by 19 stock exchanges are considered which are containing more than 2 stock exchanges.Hence 6 stock exchanges are omitted due to not having enough similarity distance with at least 3 stock exchanges.Once the clusters are obtained, the sub Alphanumeric Journal Volume 5, Issue 1, 2017

Figure 1 .
Figure 1.The MST diagram of stock exchanges focusing on Industrials sectors Industrials sector stock shares of GB, US, NL and DK are in the central position of MST since they all have three edges.According to the MST diagram, GB stock prices are mainly affecting DE, US and MY stock prices.Similarly US is affecting GB, VE and IS.Another central position is DK since it directly affects FR, NL and SE.As the last center node of interacting stock markets, NL is similar with DK, BE and KW.These central position nodes (stock exchanges) have dominant hierarchy along the other nodes.

Figure 2 .
Figure 2. The hierarchical tree of stock exchanges focusing on Industrials sectors . The description of complex systems may be more efficient by graph representation.It is known that visualizing the data has a positive effect on readers.Application of MST diagrams in socio-economic networks ensures more comprehensible data.Here we consider the MST diagram regarding on stock prices interactions in Industrials sectors among focused stock exchanges.Previous studies on stock exchanges usually construct MST diagrams depending on correlation coefficients.Calculation of correlation coefficients needs synchronous data to analyze.However sometimes one cannot obtain the synchronous data so it would be impossible to make comparison between such multivariate data.In this study to overcome the restrictions of classical correlation, a MST is constructed based on dynamic time warping which enables us to analyze asynchronous data.According to Alphanumeric Journal Volume 5, Issue 1, 2017

Research is conducted on 29 stock exchanges covering time period beginning from September 20, 2006 till September 20, 2016. The daily stock change rates of
Industrials sector shares are investigated.The studied stock exchanges which involve Industrial sectors and data intervals are listed in Table1.

Table 1 .
List of countries, symbols, related stock exchanges and operating time period Classical correlation coefficients are widely used to determine the similarity distance between the nodes of graphs.However calculation of classical correlation coefficients (Spearman, Pearson etc.) needs synchronous data.Sometimes obtaining the same length of time series would be impossible.To analyze such multivariate data, dynamic time warping might be a useful tool.Dynamic time warping algorithm, uses the two temporal sequences of daily logarithmic return of the closure prices of each stock exchange during given time period.So by using DTW algorithm given by [6,8], the distance matrix D is computed to measure the similarity among the asynchronous time evolution of each pair of stock exchanges for Industrials sector.Then computed distance matrix is represented by MST in Figure1.

Table 2 .
Mean similarity measure, normalized tree length, characteristic path length