*3.1. Similarity Metrics*

Defining similarity is a key aspect in clustering. In general, it is not usually possible to find an optimal kernel, but different approaches can be tested and compared to specific data sets.

This study analyzes correlation, jump, entropy, and Gaussian-based similarity kernels. When calculating the similarity matrices, we expect strongly connected indices have coefficients close to one, whereas loosely connected close to zero. Level plots (Figure 1) give a feeling about the network structure which seems to be homogeneous; thus, clusters could not be well separated.

Figure 1 displays the correlation, Gaussian-kernel, relative entropy and jump-based similarity structure of the equity index graph, in which the whiter the color the stronger the connection between the indices. Indices are sorted alphabetically and (*i*, *j*) represents the similarity between index *i* and *j*.

Different similarity measures imply similar patterns, which is in line with our *a priori* intuition. However, the spectra of normalized Laplace and normalized modularity matrices help us to find the most adequate kernel function: the wider the spectral gap, the better the clustering property. This means, we have to find similarity metrics, which in turn implies large gaps in the spectrum of normalized Laplacian and modularity matrix (Chung 1997).

**Figure 1.** Level plots of daily similarity matrices.

Empirical evidences (Figures 2 and 3) show relative entropy, and Gaussian-kernel can also be used to cluster the stock index network while correlation and jump-based similarities are not promising.

**Figure 2.** Eigenvalues of normalized modularity matrix in decreasing order.

**Figure 3.** Eigenvalues of normalized Laplacian matrix in decreasing order.

A correlation-based similarity approach implies roughly uniform eigenvalue density on [0, 1]. This means, a lot of gaps appear in the spectrum, hence we could not comment on the optimal number of clusters. Moreover, lower dimensional representations will not contain all the information as some of the large eigenvalues are not considered. These hurdles highlight the problems of squared correlation similarity matrices.

Counting at least two standard deviation jumps results in a small number of eigenvalues with large multiplicity. Therefore, lower dimension representation cannot be used to cluster the data points. Accordingly, jumps are random and do not reflect the network structure; thus we could say all the clusters are exposed to the same systematic risk. Thus, the results provide evidence of spillover effect. Moreover, we show that shocks and market collapses have a minor effect on the equity index graph i.e., network structure of equity indices.

Gaussian and relative entropy-based similarity matrices infer promising figures, especially in the case of normalized modularity. Here, we ge<sup>t</sup> large well separated eigenvalues necessary to transform the data into a lower dimensional space.

Notice that these results are in line with Figure 1 because the normalized Laplacian minimizes the normalized cut (Equation (10)), which in turn, is small if, and only if, the clusters are loosely connected. Whereas, the modularity approach maximizes the information of clustering, hence, it can also be used in a homogeneous network structure as well.

Investigating the spectra, especially the positions of spectral gaps, gives some guidance on the optimal number of clusters. Considering the previous results, the spectra of Gaussian and relative entropy-based normalized modularity matrices are suitable. Figure 4 shows indices could be put into 2, 3, or 5 clusters.

**Figure 4.** Largest eigenvalues of Gaussian- and relative entropy-based normalized modularity matrices.

In order to identify the spectrum gap, we apply the elbow method to identify the optimal number of clusters. This approach is rather computationally intensive, because of the percentage of variance explained as a function of clusters has to be estimated (Equation (12)); thus, the whole process has to be repeated many times. However, in our case, as we have 59 stock indices, the elbow method can also be used. Figures 5–7 provide evidence for using 2, 3, 4, or 5 clusters.

**Figure 5.** Explained percentage variance of Gaussian-kernel based clusters of representations.

**Figure 6.** Histogram of 10,000 Gaussian similarities which are generated from i.i.d. 250 dim. standard normal samples.

**Figure 7.** Explained percentage variance of Gaussian-kernel based clusters after zero out similarities less than 0.2.

Analyzing the Gaussian similarity kernel shows that if we randomly generate data, then we would ge<sup>t</sup> similarities smaller than 0.2, with probability more than 0.99.

This observation (Figure 6) implies that we have to filter out similarities less than 0.2 from the adjacency matrix.

Figures 2–4 show the Gaussian-kernel infers the clearest spectrum property. The relative entropy-based kernel also gives usable results, whereas, jump and correlation-based approaches are ineffective.

### *3.2. Comparing Normalized Modularity and Laplacian*

We propose the use of an accuracy ratio-based (Engelmann et al. 2003) measure to compare the efficiency of different clustering techniques. Calculating the area between the variance explanation function of the random and the different spectral clustering methods generates an appropriate statistic.

Considering this metric (Zhao 2012), it can be seen that the Gaussian-kernel over-performs relative totheentropy-basedapproach;thisisbecauseineachcaseitsvarianceexplanationfunctionissteeper.

 Henceforth, the Gaussian-kernel based normalized modularity matrix is used.

### *3.3. Equity Index Network Structure*

Spectral gap (Figure 4) and variance analyses (Figures 5 and 7) imply equity indices can be studied by using 2, 3, and 5 clusters. The explanatory power of two clusters is 38%. This means roughly one-third of the total variance comes from the sample heterogeneity. If we increase the number of clusters and investigate the three cluster cases, we ge<sup>t</sup> a similar explanatory power. However, a spectral gap appears between the third and fourth eigenvalues (Figure 4), so, theoretically, we propose the three clusters. The next gap is between the fifth and sixth eigenvalues. The explanation power of five clusters is 52%. This means, half of the total variance of data can be explained by five clusters.

This result (Figure 8) also suggests that additional clusters have little explanatory power, which is in line with spectrum properties.

**Figure 8.** Explained percentage variance of Gaussian-kernel based clusters.

In practice, mean-variance plots can be used to represent risks and rewards. Intuitively, indices with similar risk and return can be believed to be similar. This approach applies a *k*-means algorithm to cluster the two-dimensional (mean, standard deviation) representation of logarithmic returns.

We have seen this naïve method does not give optimal cuts. However, if we calculate Gaussian similarities and normalized modularity matrix based representation, then we ge<sup>t</sup> clusters with a higher variance explanatory power. We have seen stock indices can be put into 2, 3, or 5 clusters. If we plot the mean-variance representation of indices we ge<sup>t</sup> Figures 9–11, for 2 and 5 clusters, respectively.

**Figure 9.** Two Gaussian-kernel based normalized modularity clusters (part of the total graph).

In Figure 9 we can see clusters that are optimizing the modularity cut are concave in a mean-variance framework. If we have a closer look at the indices in Appendix A (Table A1) we could say that a qualitative approach also works, because east-west geographical clustering would imply almost similar results.

Putting the indices into three different clusters (Figure 10) gives a complicated structure, but we could still state that the first cluster is dominated by European countries, the second by American, and the third is a mixture of indices from the rest of the world. Thus, applying geographical diversification is in line with cluster property. The network generated by simple index returns incorporates geographical information.

Calculating five different clusters helps us to gain a deeper understanding of the network. The first surprising result is that despite the penalty of different cluster sizes, the Dhaka Stock Exchange (.DS30) is separated into cluster three. In addition, cluster four contains only two African and two American indices. Another interesting result is the first cluster, which includes the Arabian indices except Morocco. Cluster two primarily comprises developed, while cluster five is dominated by emerging market names. Hence, we could notice that spectral clustering-based classification is similar to qualitative categorizations. However, these results also sugges<sup>t</sup> that a portfolios constructed using only geographical scope can integrate indices which behaves significantly differently compared to real regional regimes.

**Figure 10.** Three Gaussian-kernel based normalized modularity clusters, edges with weights stronger than 0.5.

**Figure 11.** Five Gaussian-kernel based normalized modularity clusters.

In order to compare our quantitative approach with geographical and MSCI classifications, we run the following regressions:

$$
\sigma = \beta\_0 + \beta\_1 \sigma + \beta\_2 cluser + \epsilon,\tag{13}
$$

The regressions (Table 2) show that spectral clustering provides statistically reliable figures, while geographical- and MSCI-based clusters are not statistically significant.


**Table 2.** Regression statistics.

Notes: This table shows the daily linear regression coefficients and *p* statistics of geographical, MSCI, and spectral clusters. Returns are regressed on standard deviations and clusters.

The outcomes highlight the difficulty of diversification, because the correlation structure of the network is quite homogeneous. Moreover, geographical and other qualitative diversification techniques do not give us statistically significant results. However, indices can be clustered by spectral methods. This means indices in the same cluster are affected by the same risk factor, hence, only cluster wise diversification can be used to eliminate non-systematic global risk.

### *3.4. Equity Index Graph*

Clustering helps us to globally analyze the network. However, the local structure can be better understood by node-specific attributes. Our aim is to find the most influential markets. Hubs can be identified as vertices with the largest vertex weights. Vertex weight of node *i* can be defined as the sum of the edge weights.

$$\mathcal{W}\_i := \sum\_{j=1}^{N} \mathcal{W}\_{i,j} \delta(\mathcal{W}\_{ij} > 0.2), \tag{14}$$

Calculating the histograms, we ge<sup>t</sup> Figure 12.

**Figure 12.** Histogram of vertex weights, five Gaussian cluster, two nodes are connected if their Gaussian similarity is stronger than 0.2.

The outcomes show that essentially cluster wise histograms differ. In each cluster, there are vertices whose connection numbers substantially differ from the cluster wise mean (Figure 12). Note that the vertex connection density of an Erd˝o-Rény<sup>i</sup> graph is binomial, hence hubs and separated nodes cannot be generated (Erd˝os and Alfréd 1960). This implies that preferential attachment processes should be used to model the network structure (Barabási and Réka 1999).

However, the randomness of vertex weights is twofold: one factor is the number of connections, while the other factor is edge weights.

In order to distinguish the effects, we calculate the vertex weights as the sum of connections;

$$V\_i^{\text{count}} := \sum\_{j=1}^{N} \delta(\mathcal{W}\_{ij} > 0.2), \tag{15}$$

Calculating the histogram of counting-weights we ge<sup>t</sup> Figure 13.

**Figure 13.** Histogram of vertex count-weights, five Gaussian cluster, two nodes are connected if their similarity is stronger than 0.2.

We could say clusters 1 and 2 contain hubs, whereas, the vertex-count distribution in cluster 5 is more balanced. There is no hub, but there are vertices with more than 40, and less than 10 connections. The results show that the shape of the cluster wise vertex connection differs, hence, the vertex weight distribution is also a mixed distribution.

Comparing Figures 12 and 13 shows that counting implies higher skewness, while having less effect on the shape. When analyzing edge weights, it turns out that they are not uniformly distributed. In addition, different clusters have different edge weight densities.

Moreover, it also can be seen (Figure 14), that if the average connection strength is higher, the vertex has more connections; this is true cluster-wise as well.

**Figure 14.** Cluster-wise connection number and average connection strength.

All of this implies that spectral clustering techniques can be used to distinguish subgraphs. Moreover, the number of connections of an index and its average edge weight, follow the preferential attachment process.

### *3.5. Risk and Reward*

To understand the connection between risk and reward, we can use the mean-standard deviation framework. When calculating the regressions we arrive at Table 3. The outcomes imply that the total sample regression does not provide reliable figures, nevertheless, cluster-wise regressions are significant. This points to the conclusion that the relationship between risk and return, cluster wise has different behavior.


**Table 3.** Descriptive statistics of daily linear regressions.

Notes: This table shows the *p* statistics and *R*<sup>2</sup> values of daily linear regressions. Returns are regressed on standard deviations. Calculation is done for total, only the first, second and fifth clusters.

Figure 11 and Table 3 show higher standard deviations, implying higher returns, because regression lines slope upwards. In addition, it also turns out that connections between returns and standard deviations are strong in Arabian and developed market cases. Nevertheless, emerging markets show different statistics: index returns in the fifth cluster are not linear in standard deviation, hence emerging market returns cannot be estimated in the Markowitz framework.
