This paper develops new mathematical techniques to identify temporal shifts among a collection of US equities partitioned into a new and more detailed set of market sectors. Although conceptually related, our three analyses reveal distinct insights about financial markets, with meaningful implications for investment managers. First, we explore a variety of methods to identify nonlinear shifts in a market sector structure and describe the mathematical connection between the measure used and the captured phenomena. Second, we study a network structure with respect to our new market sectors and identify meaningfully connected sector-to-sector mappings. Finally, we conduct a series of sampling experiments over different sample spaces and contrast the distribution of Sharpe ratios produced by long-only, long-short, and short-only investment portfolios. In addition, we examine the sector composition of the top-performing portfolios for each of these portfolio styles. In practice, the methods proposed in this paper could be used to identify regime shifts, optimally structured portfolios, and better communities of equities.

Equity markets are highly nonstationary and continually change their behaviors over time. In recent years, many securities and asset classes have exhibited huge gains and/or fluctuations in their returns. In particular, equities exposed to the broad macroeconomic themes of artificial intelligence, decarbonization, and energy prices have benefited from growing investor interest. As investors turn to these market themes, however, other sectors are being overlooked and are experiencing capital outflows. These shifts in market dynamics can yield dislocations and create opportunities for arbitrage with respect to certain sectors. All these reasons make the time-varying study of stock prices more essential than ever. In addition, changes to the twenty-first century landscape of businesses require more nuanced sectors to divide the marketplace than traditional options such as the GICS classification system. In this work, we develop new methodologies to most appropriately identify nonlinear shifts in market behaviors, to reveal suitable market themes for portfolio diversification, and to optimally construct portfolios to perform best over long time horizons, all via a modern and sophisticated sector division.

Modern financial portfolio management is an increasing complex endeavor. Sophisticated investment firms have numerous teams focused on strategic, dynamic, and well-diversified asset selection over a variety of time frames, from periods of nanoseconds to years. In this paper, we look holistically over the long term and address three aspects that remain consistently pertinent to portfolio selection: shifts in market structure and behavior over time, representation of various sectors in strong-performing portfolios over the long-term, and a framework for identifying communities of equities from a universe of potential candidates.

A significant body of literature focuses on the evolution of a financial market structure, where the correlation matrix of individual security returns is used as the primary item of study.1–4 Studying the nuanced connectedness between various groups of assets provides insights into the interdependencies of certain sectors, and how the market can be decomposed into smaller communities.5–9 In more recent years, network analysis has been used in various applications in financial markets, such as equities,10 foreign exchange,11 cryptocurrency transactions,12 mergers of companies,13 and global volatility.14 Most of these analyses originally derive from the correlation matrix, but nonlinear alternatives also exist.15 

Like previous work, this paper focuses on identifying structurally important (and locally similar) communities of stocks, where each independent cluster on the network exhibits local affinity and dissimilarity with global comparisons across the graph. Our analysis also makes use of a modern and nuanced division of our universe of stocks into 60 sectors. The existing GICS (Global Industry Classification Standard) sectors are rather old, limited in number, fail to caption important differences in sector subdivisions, and have numerous companies that are misclassified by today’s understanding. Our use of 60 sectors augments and aids the process of trying to find relevant market communities and themes.

We must also acknowledge the influence of statistical physics and time series analysis on this work, particularly Sec. III. In financial markets, time series analysis has been applied to a wide range of asset classes, such as equities,16–19 foreign exchange,20 cryptocurrencies,21–28 and debt-related instruments.29 Such methods have been used more broadly in a variety of other disciplines, including epidemiology,30–39 environmental sciences,40–48 crime,49–51 and other fields.52,53

Traditionally, the study of time-varying market shifts has rested on regime-switching models. These begin with the observation that financial assets exhibit switching patterns, moving between periods of heightened volatility and ease.54–56 One then applies the analysis of locally stationary time series57–60 to partition a long time window into designated and discrete segments. These segments are classified into a small number of distinct regimes, usually two,61–63 but often different numbers64 or with varying assumptions that may yield different levels of flexibility.65–71 In addition, change point or structural break detection algorithms have been applied for a similar purpose,72–74 to divide a time interval into periods of fundamentally distinct market behavior. These do not have a specified number or type of regime in mind, nor do they classify and group different segments, but they do divide the entire window of analysis into discrete periods. While these discretized divisions have their place, they are a little contrived; therefore, we instead develop a suite of different methods that reveal market shifts on a continual basis and interpret their different uses and benefits.

The study of portfolio optimization has grown widely in the decades since Markowitz’s mean-variance model.75,76 While there are many approaches, including statistical mechanics,77–79 clustering,80,81 fuzzy sets,82,83 regularization,84–86 Bayesian approaches,87 and multiobjective optimization,88 almost all of these approaches aim to find a unique optimal portfolio. Frequently, NP hard constraints,89,90 such as portfolio cardinality constraints,91 are imposed, which can make the selection of a single portfolio a difficult computational problem. In addition to being computationally difficult, finding a single optimal portfolio may be sensitive to changes in the data and may prove inflexible for future decision making. Thus, in this paper, we conduct a series of appropriately chosen sampling experiments to instead identify collections (specifically quantiles) of top-performing portfolios and analyze their composition.

This paper is structured to address the broad topic of dynamic asset allocation and optimal portfolio construction during changing market conditions. Our paper proposes new mathematical techniques to address the three most critical aspects of tactical asset allocation: identifying market regimes, highlighting association between underlying portfolio components (assets, trading strategies, and so on) and optimally constructing portfolios within a sample space (with some degrees of freedom). In Sec. III, we compare a variety of new techniques to identify shifts in behavior in the market, consistently taking into account the structure of the market divided into our 60 sectors. We also contrast the findings and effectiveness of these techniques in various portfolio management contexts. In Sec. IV, we turn to the network structure of the market and use our nuanced 60 sectors and network analysis to identify key clusters of structurally similar equity themes and test for essential ingredients in long-term portfolio diversification. In Sec. V, we conduct an extensive sampling experiment where we compare the long-run performance and portfolio composition of long-only, short-only, and long-short portfolios, taking into account the sector structure of the market. In Sec. VI, we conclude. Throughout the paper, we take an interdisciplinary approach, as often seen in econophysics, borrowing methodologies from a wide range of mathematical foundations.

We analyze the daily closing prices of 268 equities between 2005-01-01 and 2023-12-31. Each equity has been allocated into one of 60 (new) sectors that more closely tie with their respective companies’ roles in the business cycle. We feel that our nuanced sector allocation, which is much richer than the traditional Global Industry Classification Standard (GICS) methodology, is key in producing high quality insights. These sector allocations are done manually based on market consensus and are provided in  Appendix A. Price data have been sourced from Yahoo Finance.92 

The primary objects of study in this section are aggregated sector log returns (averaged over their composite assets) investigated over 30-day periods. We present four primary measures of deviation to identify temporal shifts in a market structure. As we consistently group returns by sector, such changes may identify dislocations in sector pricing and, hence, arbitrage opportunities.

As mentioned in Sec. II, the full 268 stocks are divided into n = 60 detailed sectors, S j , j = 1 , , n. Our data consist of asset prices from 2005-01-01 to 2023-12-31. We index the trading days as t = 0 , 1 , , T with T = 4780. Averaged daily sector returns are defined as follows:
(1)
Concretely, this represents the return of a portfolio that is concentrated entirely within one sector and equally weighted on the assets therein. Next, we consider τ = 30-day periods of returns, which we donate R j [ t τ + 1 : t ] , t = τ , , T. This is to be understood as a sequence of adjacent sector returns over 30 days.

This analysis of 30-day intervals requires comment, specifically around the choice of a 30-day window and alternatives. In general, smoothing out a time series is a balance with respect to signal and noise. Given the high level of noise in financial time series, de-noising these time series often helps us make better predictions as we can more accurately capture the true “signal” in the underlying time series. A 30-day window acts as a low-pass filter; a larger window induces more bias into the estimator but reduces the variance more substantially, while a smaller window yields less bias. In our previous work, we have experimented with several time lags, windows, offsets, and so on. Having applied similar methods to underlying financial time series, a 30-day window tends to generalize best. As we acknowledge in Sec. VI, alternative time windows may be an avenue for future work.

First, we sum over the 30-day sequences R j [ t τ + 1 : t ] to yield monthly returns; that is, let R ¯ j [ t τ + 1 : t ] = R j [ t τ + 1 : t ] = t τ + 1 s t R j ( s ). With this, our first measure of shifts in the market structure is defined as
(2)
(3)
(4)
Above, R ¯ j denotes averages taken over time, while R ¯ denotes the length n = 60 vector of all R ¯ j values across all sectors, j = 1 , , n. The 1 notation signifies an L 1 norm used as a metric between vectors. S t is defined for t = τ , , T τ and computes the shift in returns’ monthly sums on a sector-by-sector basis between the 30-day periods immediately prior to and following t. We plot this in Fig. 1.
FIG. 1.

Line plots of S t (adjacent L 1 sums between sector returns) and C t (normalized operator norms of rolling correlation matrices), defined in (2) and (7), respectively. Both estimators provide consistent indication of financial crisis detection, with S t exhibiting greater variability. We include thresholds noting the top 5% of respective values of each series. There is no relationship between the two y-axis scales.

FIG. 1.

Line plots of S t (adjacent L 1 sums between sector returns) and C t (normalized operator norms of rolling correlation matrices), defined in (2) and (7), respectively. Both estimators provide consistent indication of financial crisis detection, with S t exhibiting greater variability. We include thresholds noting the top 5% of respective values of each series. There is no relationship between the two y-axis scales.

Close modal

Our second measure is slightly more sophisticated. We retain R j [ t τ + 1 : t ] as sequences without summing them and instead compute Wasserstein distances between these sequences, understanding them as distributions; that is, let d W be the L 1 Wasserstein metric. Consider each length-30 sequence R j [ t τ + 1 : t ] of daily log returns as a distribution of real values. The Wasserstein metric d W ( R j [ t τ + 1 : t ] , R j [ t + 1 : t + τ ] ) is defined informally as the work required to transform the distribution R j [ t τ + 1 : t ] into R j [ t + 1 : t + τ ] and is outlined in  Appendix B.

The Wasserstein metric d W offers a way to simultaneously compute aggregated measures of disparity between two sequences (considered as distributions) while allowing individual terms to remain relevant. For example, a strong negative shock R j ( t + 1 ) followed by positive shock R j ( t + 2 ) in the return sequence R j [ t + 1 : t + τ ] could “cancel out” in the computation of S t, whereas both terms will remain relevant in the computation of W t below.

With this, our second measure of shifts in the market structure is defined as
(5)
again defined for t = τ , , T τ. This computes the shift in returns’ monthly distributions on a sector-by-sector basis between the 30-day periods immediately prior to and following t. It is plotted in Fig. 2.
FIG. 2.

Line plot of W t, defined in (5). These Wasserstein distances provide a more abrupt estimator, which may exhibit a higher signal-to-noise ratio for short-term anomaly identification. The metric identifies the cumulative deviation in sector-to-sector log return distributional changes. Large measurements are likely associated with latent structural shifts in the market.

FIG. 2.

Line plot of W t, defined in (5). These Wasserstein distances provide a more abrupt estimator, which may exhibit a higher signal-to-noise ratio for short-term anomaly identification. The metric identifies the cumulative deviation in sector-to-sector log return distributional changes. Large measurements are likely associated with latent structural shifts in the market.

Close modal
Our third measure of shifts in the market structure reflects the collective strength of correlations between sector returns, computed over a rolling 60-day basis. Specifically, for j , k = 1 , , n and t = τ , , T τ, we define
(6)
where Corr is the Pearson correlation between length-60 vectors. For each t, we obtain a n × n matrix Ψ ( t ) that is symmetric with real eigenvalues λ 1 ( t ) λ n ( t ) 0. All diagonal elements of Ψ ( t ) equal 1. Thus, the trace of the matrix, and, hence, the sum of the eigenvalues, equals n. We normalize the leading eigenvalue by dividing by n and define C t = λ 1 ( t ) n . This computes the collective strength of correlations between sectors across both 30-day periods immediately prior to and following t, concatenated into a 60-day period. In addition, λ 1 ( t ) can be interpreted as the operator norm of Ψ ( t ),
(7)
Informally, one can think of this measure as the maximum factor by which a vector is lengthened under a linear map. We plot C t in Fig. 1 to compare with S t.

Finally, we include one additional measure of deviation that targets not just magnitudes of deviations in returns between 30-day periods, but changes in the ranking order of sector returns. Once again, we utilize the 30-day summed returns (equivalently monthly log returns) R ¯ j [ t τ + 1 : t ]. Let K t be the Kendall tau coefficient between the two vectors ( R ¯ j [ t τ + 1 : t ] ) j and ( R ¯ j [ t + 1 : t + τ ] ) j in R n, where j ranges over 1 , , n = 60 and produces two vectors of dimension 60. The Kendall tau coefficient is computed as follows: a pair 1 i < j n is said to be concordant between the two vectors if the order of ( R ¯ i [ t τ + 1 : t ] , R ¯ j [ t τ + 1 : t ] ) and ( R ¯ i [ t + 1 : t + τ ] , R ¯ j [ t + 1 : t + τ ] ) is the same and discordant otherwise. Then, the coefficient is defined as the difference between the number of concordant and discordant pairs as a proportion of all ( n 2 ) pairs. The Kendall tau has an associated p-value corresponding to the null hypothesis of a zero tau coefficient between vectors. We plot K t in Fig. 3, again for t = τ , , T τ. For the sake of robustness, we also include the related Pearson and Spearman correlation coefficients between the same vectors. The Spearman correlation is defined as the Pearson correlation computed between the ranks of the two vectors and is, thus, computed entirely based on the ranks of the sector return values, not their relative magnitudes.

FIG. 3.

In (a), we display the rolling Kendall tau K t over time, defined in Sec. III. For robustness, we include the closely related Spearman correlation (b) and the more traditional Pearson correlation (c). The Kendall and Spearman are determined solely in terms of changing ranks of sector log returns. In (d), we include the p-values associated with the Kendall tau computations. The more robust Kendall and Spearman coefficients show a consistently changing order in sector return performance on a rolling basis, with little change to this observation during the GFC or COVID-19 crises.

FIG. 3.

In (a), we display the rolling Kendall tau K t over time, defined in Sec. III. For robustness, we include the closely related Spearman correlation (b) and the more traditional Pearson correlation (c). The Kendall and Spearman are determined solely in terms of changing ranks of sector log returns. In (d), we include the p-values associated with the Kendall tau computations. The more robust Kendall and Spearman coefficients show a consistently changing order in sector return performance on a rolling basis, with little change to this observation during the GFC or COVID-19 crises.

Close modal

Figure 1 reveals some key similarities between our measures S t and C t. First, both measures identify the global financial crisis (GFC) and the COVID-19 market crash as the most significant equity market crises over the full period investigated. We consider values in the top fifth percentile of each respective series as indicative of the most atypical market dynamics and mark these thresholds in the figure. Both measures detect three breaches of this 5% threshold during the GFC and one during COVID-19. Furthermore, both measures broadly correspond in amplitude over the entirety of the period studied: generally, they are relatively high and low during the same times.

And yet, some differences between the quantities exist that distinguish them as estimators of structural market shifts. First, S t may serve as a more effective tool in an online capacity for market turmoil identification. Prior to the GFC and COVID-19 market crash, smaller scale perturbations are detected, which could be used as an indicator for subsequent sell-offs in equity markets. Next, S t produces greater contrast in magnitude when compared to the C t measurement. This is highlighted during the GFC: both C t and S t produce three spikes at approximately the same time, but the spikes of S t exhibit greater variability in amplitude. On the other hand, one potential drawback of the S t measurement is the potential for false positive structural shift identification. During the period investigated, 11 breaches of the 5% threshold are identified using S t. By contrast, C t only identifies four structural breaks—three during the GFC and one during the COVID-19 market crisis.

Our more refined measure for time-varying market shifts is shown in Fig. 2 and determines the rolling, cumulative sector-to-sector Wasserstein distance between adjacent length-30 sequences of log return distributions. Figure 2 is quite different from the three other measures we have employed for several reasons. First, our Wasserstein metric approach produces the most abrupt changes around market crises. One could argue that this methodology has a higher signal-to-noise ratio with respect to crisis identification, and given the strong association between the amplitude of the estimator and the actual existence of financial market crises—it may indeed be the most effective tool for regime or crisis identification. This is to be expected, as using the Wasserstein metric rather than the sum in S t allows one to more carefully take into account extreme daily values, even if a sharp positive market shift is directly followed by a sharp negative shift. Indeed, such behavior is quite common during crises, and only using the Wasserstein metric will properly detect these unique patterns. Like our S t methodology, the Wasserstein approach produces significant variability in amplitude. By contrast, C t, which captures the evolutionary change in the amount of collective market movement, does not exhibit the same variance in amplitude. This framework may have favorable properties for online regime identification, crisis detection, and be useful as an indicator of market dislocations or required shifts in optimal portfolio composition.

Finally, we display the Kendall tau K t in Fig. 3(a), along with the closely related Spearman correlation coefficient in Fig. 3(b) and the more standard Pearson coefficient in Fig. 3(b). Unlike our other time-varying measures, Fig. 3(a) displays the evolution of change in sector log returns ranks and perhaps best indicates the need for changes in portfolio composition over time. The three figures display some similarity in their evolutionary structure and volatility. However, it is notable that pronounced spikes around the GFC and COVID-19 crash are only clearly visible in Pearson Fig. 3(b) and not the others. Log returns are not normally distributed, particularly during market crises, and therefore, the Pearson coefficient may be distorted by extreme values during these times. Thus, looking only at the ranks (Kendall tau) or correlations between the ranks (Spearman) reveals no particular shifts in rank orderings during the crises. Instead, we see considerable consistency over time in the behaviors of K t and the closely related Spearman coefficient, included for robustness. The magnitudes of the Kendall tau and Spearman coefficient are generally quite low, never exceeding 0.3 and 0.4, respectively, and more frequently close to 0. To complement this, we include a histogram of the associated Kendall tau p-values in Fig. 3(c). Less than half (of 4721) of the p-values are less than 0.05, with many distributed between 0.05 and 1, indicating that there are many times t where the Kendall tau K t is not significantly different from zero. This indicates a considerable shift in ordering from one rolling period of returns to another. Both of the above findings indicate that optimal portfolios must switch between market sectors on a near-continual basis.

Let Ψ i j be the n × n correlation matrix between sectors calculated over the entire period of analysis. This is defined analogously to the n × n matrices Ψ ( t ) in (6) but over the entire interval [ 1 , T ] rather than a 60-day window. We apply the following common transformation:
(8)
This is motivated by the fact that correlation can be interpreted as a normalized inner product or an inner product between unit vectors u , v . For unit vectors u , v, we have the following identity:
(9)
where is the norm associated with the inner product . , . . Thus, the transformation (8) yields the metric between unit vectors that is associated with a correlation.

We then form two networks, one traditional and one somewhat unusual. First, more traditionally, we form a weighted graph using the n sectors as vertices and the associated distances D i j as edge weights. In this graph, two vertices (sectors) have a small edge weight between them if they are highly correlated (high correlation being equivalent to small D i j). Then, we pass this to Kruskal’s algorithm to form an associated minimum spanning tree (MST).

On the other hand, a little unusually, we form a weighted graph directly using the correlation coefficients Ψ i j themselves as edge weights. In this graph, two vertices are close if they have a low correlation. Unlike D i j, Ψ i j does not satisfy the triangle inequality property of a metric; therefore, there is no transitive property of closeness. However, we once again form a minimum spanning tree on this weighted graph. This tree will reveal the minimal sequence of edges to connect the graph subject to wanting connected sectors to be uncorrelated, which is important in diversification.

Kruskal’s algorithm to produce a minimum spanning tree proceeds as follows. In a weighted graph, one first orders the edges by increasing weight. Then, edges are successively added to the tree if and only if the addition of such an edge would not create a cycle. By design, the algorithm never produces any cycles, but successively adds edges until the graph is connected, producing a connected spanning graph with no cycles, and, hence, a tree. We remark that Kruskal’s algorithm works fine when some edges of the graph have negative weight, which may be the case for the correlation weightings Ψ i j. The resulting MST still aims to minimize path lengths with respect to correlation; negative correlation values are fine and indeed are even desired to show assets with a low correlation, which is beneficial for diversification. Concretely, Kruskal’s algorithm finds the exact same MST as if we adjusted all edges by a constant, for example, examining edges Ψ i j + 1, all of which would be non-negative.

In Figs. 4 and 5, we display the minimum spanning tree using D and Ψ as the edge weights between sectors considered vertices, respectively. In the first network, Fig. 4, we identify sectors that are more closely correlated. Several noteworthy clusters are identified, and such groupings could be used to identify broad themes among the market. First, we see a strong association between software applications, Internet, and software infrastructure companies. These sectors are connected to semiconductors and consumer electronics, with the latter two exhibiting higher centrality on the graph. These nodes are connected to sectors, such as computer hardware, information technologies, electrical equipment, and scientific instruments, which are again more central to the underlying graph. This entire collection of sectors could form a primary “digitization” theme or be broken down into more detailed sub-themes, such as “software businesses” and “computing infrastructure.” We also see a strong association between healthcare plans, medical distribution, biotechnology, and drug manufacturers, forming a “healthcare” theme. One can also see a collection of sectors that includes discount stores, home improvement retail, packaging containers, and restaurants, forming a theme related to “consumer goods and services.” The groupings that are identified on the graph could be used in several contexts. One potential application would be forming new communities of equities based on the exposed themes and re-computing sector attributes, such as expected returns, volatilities, and beta against the larger market. One could use these themes as an alternative to portfolio factors or could diversify a portfolio with respect to these algorithmically determined themes (rather than GICS sectors).

FIG. 4.

Minimum spanning tree associated with the distance matrix D indicating high similarity between sectors. We see numerous themes in the market structure, including manufacturing (more central), electronics/computer manufacturing and software (to the bottom), household (top right), and financial services (left).

FIG. 4.

Minimum spanning tree associated with the distance matrix D indicating high similarity between sectors. We see numerous themes in the market structure, including manufacturing (more central), electronics/computer manufacturing and software (to the bottom), household (top right), and financial services (left).

Close modal
FIG. 5.

Minimum spanning tree directly associated with the correlation matrix Ψ, where edges link sectors of a low correlation. This showcases the central role of the gold sector as the asset class with the least correlation with almost every other sector.

FIG. 5.

Minimum spanning tree directly associated with the correlation matrix Ψ, where edges link sectors of a low correlation. This showcases the central role of the gold sector as the asset class with the least correlation with almost every other sector.

Close modal

In Fig. 5, we display the minimum spanning tree associated with the correlation matrix Ψ, directly. Edges are drawn between equities with a lower correlation, rather than a greater similarity. The structure of this network is striking, almost entirely centered around the gold sector (which contains four assets) as a star-shaped graph. Almost every sector shares an edge only with gold because the gold sector repeatedly exhibits the lowest pairwise correlation relative to anything else. The centrality and importance of the gold sector demonstrate that gold (and gold-related businesses) is a vital asset in diversifying financial portfolios in all weather settings.

In this section, we conduct a series of simulation studies across different sample spaces. We sample over long-only, short-only, and long-short portfolios, uniformly across all stocks or stratified by sectors. This allows us to investigate the composition of strong-performing portfolios across sectors and identify sectors that are disproportionately represented in top-performing portfolios. We complement the previous work that only varied the portfolio size as the determinant of the sample space and did not consider any sector structure.93 

Let S L be the sample space consisting of all long positions in the N = 268 equities. Symmetrically, let S S be the sample space consisting of the corresponding short positions. These produce the exact negative returns of the long positions; thus,
(10)
In our experiments, we primarily sample portfolios of size m = 30 from both S L and S S. In light of common investor portfolio statements that impose tight constraints on the weights of individual assets94 and research indicating it is frequently difficult to beat equally weighted portfolios,95,96 we restrict our sampling to equally weighted portfolios. Thus, a sampled long-only or short-only portfolio of size m from our universe of equities is equivalent to a sample drawn of size m from S L or S L, respectively.
Next, let S S L be the sample space consisting of all long and/or short positions in the N = 268 equities. There is a subtle distinction that yields two different ways to define this sample space. First, perhaps more naively, we can interpret S S L as a disjoint union,
(11)
(12)
Then, a sampled long-short portfolio of size m is equivalent to a sample drawn of size m from S S L above. However, such a sampled portfolio may contain both long and short positions of the exact same asset, which would be equivalent to holding neither. This is not necessarily entirely redundant, as it is common for investment teams to hedge one another, simultaneously taking long and short positions of similar or identical assets. For robustness, we also present an alternative sample space that explicitly prohibits a long and short position in the same equity. Consider the Cartesian product
(13)
Then, a long-short portfolio of size m can also be understood as a pair of samples, one m-length sample from S L and one m-length sample from { 1 , 1 }. Then, if A 1 , , A m are m distinct assets, we write any long-short portfolio with no duplicated long and short positions as
(14)
where ϵ i { 1 , 1 }; then, no asset can be held both long and short simultaneously. In all experiments, we observe no discernible difference in results between the two long-short sample spaces; therefore, we proceed with the second definition.
With these three sample spaces in mind, we now present one further distinction. While we always define a portfolio using equal weights, we conduct two distinct experiments regarding the random drawing of assets from S L, S S, and S S L ( m ). In one set of experiments, which we term uniform sampling, we sample any asset with equal probability. That is, each of the N = 268 equities may be chosen with equal probability from the sample space S L. In another set of experiments, which we term stratified sampling, we sample each equity with a probability that is inversely proportional to the size of the sector. Specifically, let the n = 60 sectors have sizes k 1 , , k n. Then, an equity in sector i is sampled with probability
(15)
Then, for any sector, the total probability of an asset in that sector being chosen is equal to 1 60. This ensures that each sector is represented the same number of times (on average) throughout our sample draws, effectively adjusting uniform sampling for sector size.
In all these sampling experiments, our primary quantity of interest is the Sharpe ratio of a portfolio, defined as
(16)
In (16) above, R i is the return of a stock over the entire period, Σ is the covariance matrix between stocks over the period, w i is each stocks’ portfolio weight, and R f is the risk-free rate. In this paper, we only use equally weighted portfolios, with all w i set to 1 m for a size m portfolio and a risk-free rate of 0. The Sharpe ratio is a measure of the risk-adjusted returns of a portfolio that seeks to reward portfolios with high returns, while simultaneously penalizing excessive variance.

In Sec. V B, we report numerous results from sampling both uniform and stratified portfolios, either long-only, short-only, or long-short, and for various values of portfolio size m, most commonly m = 30. In every instance, we draw 10 000 samples from each sample space in each experiment. We report both quantiles of the annualized Sharpe ratio across the entire sample space, as well as the composition of portfolios by sector in top 1% performing portfolios, quantified and ordered by a Sharpe ratio.

Table I displays Sharpe ratio quantiles for portfolios of size m = 10 , 20 , 30 with uniform sampling and then m = 30 with stratified sampling. A short-only trading strategy over such a prolonged period in the market, where equities exhibit survivorship bias and significantly positive cumulative returns, would almost certainly be a losing investment strategy. This is visible in the consistently negative values of the short-only Sharpe ratios. Accordingly, we do not focus on the short-only strategy and contrast the return profiles of the long-only and long-short strategies. The results demonstrate that the long-only portfolio is superior to the long-short portfolio in almost all points of the distribution. This highlights, over the long-term, the degree of a manager skill that is required when incorporating more shorting into a portfolio. Our results indicate that among our collection of equities, short positions are best used when highly targeted and over discrete periods with finite end dates. Indeed, shorting allows limitless downside on portfolio returns. Furthermore, our simulations do not consider transaction costs, stock loan, or margin requirements, which all add to the difficulty of beating a standard long-only portfolio. The inherent asymmetry associated with short positions further adds to the difficulty in long-short managers beating traditional long-only investors. The four parts of the table show that, predictably, the spread of quantiles narrows from m = 10 to 20 and 30. In addition, a comparison of the third and fourth quarter of the table shows essentially no difference in the Sharpe distribution between stratified and uniform sampling.

TABLE I.

Comparison of Sharpe ratio quantiles for long-only, short-only, and long-short portfolios of cardinality 10, 20, and 30 (uniform sampling) and then size 30 (stratified sampling). As m increases, the spread of values narrows. Uniform and stratified sampling exhibits a negligible difference in values.

Quantile Long-only Short-only Long-short
m = 10  Uniform sampling 
0.01  0.23  −0.69  −0.66 
0.05  0.29  −0.62  −0.50 
0.10  0.32  −0.58  −0.41 
0.25  0.38  −0.52  −0.24 
0.50  0.45  −0.45  0.01 
0.75  0.52  −0.38  0.24 
0.90  0.58  −0.32  0.41 
0.95  0.61  −0.29  0.50 
0.99  0.68  −0.22  0.65 
m = 20  Uniform sampling 
0.01  0.31  −0.64  −0.65 
0.05  0.35  −0.58  −0.50 
0.10  0.37  −0.56  −0.42 
0.25  0.42  −0.51  −0.25 
0.50  0.46  −0.47  −0.00 
0.75  0.52  −0.42  0.24 
0.90  0.56  −0.38  0.41 
0.95  0.59  −0.35  0.50 
0.99  0.64  −0.31  0.65 
m = 30  Uniform sampling 
0.01  0.34  −0.61  −0.64 
0.05  0.38  −0.57  −0.50 
0.10  0.40  −0.55  −0.42 
0.25  0.43  −0.51  −0.25 
0.50  0.47  −0.47  0.00 
0.75  0.51  −0.43  0.24 
0.90  0.55  −0.40  0.42 
0.95  0.57  −0.38  0.50 
0.99  0.61  −0.34  0.65 
m = 30  Stratified sampling 
0.01  0.34  −0.62  −0.66 
0.05  0.38  −0.58  −0.50 
0.10  0.40  −0.55  −0.42 
0.25  0.44  −0.52  −0.24 
0.50  0.47  −0.48  0.00 
0.75  0.52  −0.44  0.24 
0.90  0.55  −0.40  0.41 
0.95  0.58  −0.38  0.50 
0.99  0.62  −0.34  0.65 
Quantile Long-only Short-only Long-short
m = 10  Uniform sampling 
0.01  0.23  −0.69  −0.66 
0.05  0.29  −0.62  −0.50 
0.10  0.32  −0.58  −0.41 
0.25  0.38  −0.52  −0.24 
0.50  0.45  −0.45  0.01 
0.75  0.52  −0.38  0.24 
0.90  0.58  −0.32  0.41 
0.95  0.61  −0.29  0.50 
0.99  0.68  −0.22  0.65 
m = 20  Uniform sampling 
0.01  0.31  −0.64  −0.65 
0.05  0.35  −0.58  −0.50 
0.10  0.37  −0.56  −0.42 
0.25  0.42  −0.51  −0.25 
0.50  0.46  −0.47  −0.00 
0.75  0.52  −0.42  0.24 
0.90  0.56  −0.38  0.41 
0.95  0.59  −0.35  0.50 
0.99  0.64  −0.31  0.65 
m = 30  Uniform sampling 
0.01  0.34  −0.61  −0.64 
0.05  0.38  −0.57  −0.50 
0.10  0.40  −0.55  −0.42 
0.25  0.43  −0.51  −0.25 
0.50  0.47  −0.47  0.00 
0.75  0.51  −0.43  0.24 
0.90  0.55  −0.40  0.42 
0.95  0.57  −0.38  0.50 
0.99  0.61  −0.34  0.65 
m = 30  Stratified sampling 
0.01  0.34  −0.62  −0.66 
0.05  0.38  −0.58  −0.50 
0.10  0.40  −0.55  −0.42 
0.25  0.44  −0.52  −0.24 
0.50  0.47  −0.48  0.00 
0.75  0.52  −0.44  0.24 
0.90  0.55  −0.40  0.41 
0.95  0.58  −0.38  0.50 
0.99  0.62  −0.34  0.65 

Figure 6 shows the kernel density estimation [6(a)] and histogram [6(b)] of the Sharpe ratio distribution for long-short and long-only investment portfolios with m = 30. Confirming Table I, it is clear that long-only Sharpe ratios are superior in expectation to that of long-short portfolios due to the length of the period. We also visually see that the distribution of outcomes is much narrower for long-only Sharpe ratios—highlighting the increase in the size of the sample space when incorporating more degrees of freedom into the portfolio. However, the increase in the sample space is predominantly negative—further emphasizing the importance of a manager skill when managing portfolios with more degrees of freedom. By way of contrast, Fig. 6(c) repeats this experiment restricting to the period 2007-09-01 to 2009-03-31, comprising the global financial crisis (GFC). Here, we see a clear shift, with short-only outperforming long-short and short-only. This reflects the fact that for investment managers to successfully engage in short-selling, they are better off doing so in focused bear market windows.

FIG. 6.

Portfolio sampling for 30-stock portfolios. In (a), we show kernel density plots and (b) histograms, and in (c), we show the contrast in results where we restrict data just to the GFC. There, we see almost the opposite result than over the entire period.

FIG. 6.

Portfolio sampling for 30-stock portfolios. In (a), we show kernel density plots and (b) histograms, and in (c), we show the contrast in results where we restrict data just to the GFC. There, we see almost the opposite result than over the entire period.

Close modal

In Table II, we quantify this comparison between long-only and long-short distributions. Specifically, we compute P ( X > Y ), the empirical probability that a randomly chosen long-short portfolio has a greater Sharpe ratio than a randomly chosen long-only portfolio. We compute this for m = 10 , 20 , 30, using uniform and stratified sampling and over the entire period or just the GFC. Confirming Fig. 6, we calculate a relatively small probability (around 7%) that a candidate long-only portfolio across the entire period can beat long-short. However, this increases to around 70% when restricting to the GFC. Curiously, we observe slightly smaller probabilities for stratified sampling than uniform sampling, but only when the full period is considered, but it is possible these differences are simply random.

TABLE II.

Probability (%) that a random long-short portfolio has a superior Sharpe ratio to a random long-only portfolio for m = 10, 20, 30 over the full period and GFC. The top half of the table pertains to uniform sampling and the bottom to stratified sampling. Over the full period, incorporating shorting is unwise, but it carries substantial benefits during a bear market period.

Portfolio size Full period GFC
10  9.16  68.6 
20  7.48  70.0 
30  7.02  71.1 
10  8.97  69.6 
20  6.64  70.5 
30  6.65  71.0 
Portfolio size Full period GFC
10  9.16  68.6 
20  7.48  70.0 
30  7.02  71.1 
10  8.97  69.6 
20  6.64  70.5 
30  6.65  71.0 

In Tables III, IV and V, we turn to the second part of our experiments, where we investigate the sector composition among top-performing portfolios (top 1% by the Sharpe ratio). Table III gives the top five most occurring and bottom five least occurring sectors in uniformly sampled long-only, short-only, and long-short portfolios of size m = 30, ranked by the percentage of high-performing portfolios they appear in. In long-only portfolios, we see primarily the largest sectors represented the most: semiconductors, oil and gas, and REITs (real estate investment trusts). The smallest sectors (by a number of constituent stocks) are represented the least, such as credit and casinos.

TABLE III.

Most and least represented sectors by percentage of selection in top-performing long-only, short-only, and long-short portfolios under uniform sampling (m = 30). There is a close relationship between the above representation percentages and the corresponding sector sizes.

Long-only uniformly sampled Percentage
Semiconductors  4.67 
Oil and gas  4.43 
REIT  4.27 
Aerospace defense  3.33 
Drug manufacturers  3.23 
Auto manufacturers  0.50 
Leisure  0.50 
Retail  0.37 
Credit  0.23 
Casinos  0.20 
Short-only uniformly sampled  Percentage 
Oil and gas  5.37 
Banks—diversified  5.30 
REIT  4.63 
Insurance  4.03 
Communications  3.30 
Tobacco  0.60 
Internet  0.60 
Home improvement retail  0.40 
Biotechnology  0.30 
Internet retail  0.20 
Long-short uniformly sampled  Percentage 
Semiconductors  5.40 
Oil and gas  4.90 
REIT  4.53 
Banks—diversified  3.27 
Drug manufacturers  3.27 
Lodging  0.70 
Computer hardware  0.60 
Home improvement retail  0.50 
Credit  0.47 
Internet retail  0.27 
Long-only uniformly sampled Percentage
Semiconductors  4.67 
Oil and gas  4.43 
REIT  4.27 
Aerospace defense  3.33 
Drug manufacturers  3.23 
Auto manufacturers  0.50 
Leisure  0.50 
Retail  0.37 
Credit  0.23 
Casinos  0.20 
Short-only uniformly sampled  Percentage 
Oil and gas  5.37 
Banks—diversified  5.30 
REIT  4.63 
Insurance  4.03 
Communications  3.30 
Tobacco  0.60 
Internet  0.60 
Home improvement retail  0.40 
Biotechnology  0.30 
Internet retail  0.20 
Long-short uniformly sampled  Percentage 
Semiconductors  5.40 
Oil and gas  4.90 
REIT  4.53 
Banks—diversified  3.27 
Drug manufacturers  3.27 
Lodging  0.70 
Computer hardware  0.60 
Home improvement retail  0.50 
Credit  0.47 
Internet retail  0.27 
TABLE IV.

Most and least represented sectors by representation of selection in top-performing long-only, short-only, and long-short portfolios under uniform sampling (m = 30), adjusted by the sizes of the respective sectors.

Long-only uniformly sampled Representation ratio
Biotechnology  2.02 
Internet retail  1.97 
Non-alcoholic beverages  1.94 
Restaurants  1.61 
Medical distribution  1.56 
Retail  0.49 
Department stores  0.49 
Auto manufacturers  0.45 
Credit  0.31 
Casinos  0.18 
Short-only uniformly sampled  Representation ratio 
Retail  2.05 
Leisure  1.92 
Banks—diversified  1.78 
Department stores  1.68 
Casinos  1.55 
Medical instruments supplies  0.58 
Waste management  0.58 
Internet retail  0.54 
Home improvement retail  0.54 
Biotechnology  0.27 
Long-short uniformly sampled  Representation ratio 
Consumer electronics  1.40 
Non-alcoholic beverages  1.25 
Internet  1.25 
Restaurants  1.23 
Diagnostics research  1.23 
Real estate  0.80 
Specialty chemicals  0.71 
Internet retail  0.71 
Home improvement retail  0.67 
Credit  0.63 
Long-only uniformly sampled Representation ratio
Biotechnology  2.02 
Internet retail  1.97 
Non-alcoholic beverages  1.94 
Restaurants  1.61 
Medical distribution  1.56 
Retail  0.49 
Department stores  0.49 
Auto manufacturers  0.45 
Credit  0.31 
Casinos  0.18 
Short-only uniformly sampled  Representation ratio 
Retail  2.05 
Leisure  1.92 
Banks—diversified  1.78 
Department stores  1.68 
Casinos  1.55 
Medical instruments supplies  0.58 
Waste management  0.58 
Internet retail  0.54 
Home improvement retail  0.54 
Biotechnology  0.27 
Long-short uniformly sampled  Representation ratio 
Consumer electronics  1.40 
Non-alcoholic beverages  1.25 
Internet  1.25 
Restaurants  1.23 
Diagnostics research  1.23 
Real estate  0.80 
Specialty chemicals  0.71 
Internet retail  0.71 
Home improvement retail  0.67 
Credit  0.63 
TABLE V.

Most and least represented sectors by percentage of selection in top-performing long-only, short-only and long-short portfolios under stratified sampling (m = 30). This aims to adjust for differing sector size in the construction of the sample portfolios.

Long-only stratified Percentage
Discount stores  3.20 
Non-alcoholic beverages  2.93 
Biotechnology  2.77 
Medical instruments supplies  2.77 
Household  2.73 
Capital markets  0.73 
Gambling  0.67 
Department stores  0.60 
Retail  0.53 
Casinos  0.37 
Short-only stratified  Percentage 
Banks – diversified  3.67 
Casinos  3.10 
Communications  2.70 
Retail  2.70 
Department stores  2.70 
Tobacco  0.90 
Diagnostics research  0.87 
Medical instruments supplies  0.80 
Internet retail  0.73 
Biotechnology  0.63 
Long-short stratified  Percentage 
Specialty chemicals  2.23 
Biotechnology  2.10 
Medical instruments supplies  2.10 
Gaming  1.97 
Software infrastructure  1.93 
Advertising  1.37 
Credit  1.37 
Leisure  1.30 
Healthcare plans  1.23 
Casinos  1.17 
Long-only stratified Percentage
Discount stores  3.20 
Non-alcoholic beverages  2.93 
Biotechnology  2.77 
Medical instruments supplies  2.77 
Household  2.73 
Capital markets  0.73 
Gambling  0.67 
Department stores  0.60 
Retail  0.53 
Casinos  0.37 
Short-only stratified  Percentage 
Banks – diversified  3.67 
Casinos  3.10 
Communications  2.70 
Retail  2.70 
Department stores  2.70 
Tobacco  0.90 
Diagnostics research  0.87 
Medical instruments supplies  0.80 
Internet retail  0.73 
Biotechnology  0.63 
Long-short stratified  Percentage 
Specialty chemicals  2.23 
Biotechnology  2.10 
Medical instruments supplies  2.10 
Gaming  1.97 
Software infrastructure  1.93 
Advertising  1.37 
Credit  1.37 
Leisure  1.30 
Healthcare plans  1.23 
Casinos  1.17 

Thus, we complement this with Table IV, where we adjust the percentage of representation in top-performing portfolios by the size of each sector. For example, biotechnology is represented 2.02 times more often in top-performing portfolios relative to the number of biotechnology stocks in our equity universe. Results are expected to be relatively similar to Table V, which reports percentages of occurrence in top-performing portfolios under stratified sampling. Stratified sampling is specifically designed to correct for the difference in sizes of sectors; therefore, results are expected to be similar. In both Tables IV and V, the top and bottom sectors, respectively, represent the most and least frequently represented sectors in top portfolios adjusted for their different sizes.

We see two main themes in these aforementioned tables. First, biotechnology, medical distribution, and medical instruments are among the most represented sectors (adjusted for size) in top-performing long-only portfolios. This indicates the significant growth of the pharmaceutical industry over the past two decades, especially around the COVID-19 pandemic.97 Second, (physical) retail and department stores are among the most represented in short-only portfolios and least represented among long-only portfolios, in stark contrast to Internet retail. This reflects the growth in online shopping and the decline of brick-and-mortar retail in the past 20 years. Furthermore, numerous other findings can be observed, such as a poor representation (even after adjusting for sector size) of credit-related companies and casinos and a strong performance of restaurants and producers of non-alcoholic beverages.

Our paper makes several contributions to the field. First, in Sec. III, we introduce new techniques to identify structural shifts in the market structure relative to our original sector decomposition, which may identify market dislocations between sector pricing. The Wasserstein metric may prove especially useful for online change point detection, given its association with empirically significant financial crises and clarity in the amplitude of its measurements. The four techniques we present each have respective benefits and drawbacks and could be used by investment managers in different contexts. Based on the individual investor’s portfolio management goals and preferences, one of these methods may be preferable to the others. While the metrics S t , C t , W t all reveal financial crises (including signals in advance), the Kendall tau coefficient K t has a complementary finding that optimal portfolios must switch between market sectors on a near-continual basis, an observation that is unchanged during crises.

In Sec. IV, we study the market’s connectedness and underlying network structure relative to our new sectors, building from both the correlation matrix and the transformed distance matrix. We capture two key findings. First, we identify communities of sectors that behave similarly over time. Such communities could be thought of by investment managers as broad themes to diversify across when managing a collection of investments. Their differing market centrality may also be of note and significant when diversifying across the revealed themes. Second, the gold-related sector is identified as an essential group among a portfolio of equity sectors. This is primarily due to gold’s long-term (structurally) depressed correlation with almost every sectors, as reflected in the minimum spanning tree of the untransformed correlation matrix.

Finally, in Sec. V, we conduct an extensive sampling experiment, employing uniform sampling across all stocks and stratified sampling adjusted by sector sizes and varying portfolio sizes and the period of analysis. We compare the distributional performance of equally weighted long-only, short-only, and long-short investment portfolios by the Sharpe ratio and investigate the sector composition of the top 1% performing portfolios. We show in quantitative detail that the incorporation of shorting is generally unwise across a long period, but may show positive results over select bear market periods. Regarding sector composition of top performing portfolios, we carefully control for sector size in two different ways and are able to identify the sectors that were most and least represented in successful portfolios. We see that medical-adjacent industries, such as biotechnology, medical instruments, and distribution performed well, as did Internet retail, while long positions in physical retail were poorly represented in top performing portfolios.

This section is motivated by the study of investment managers along the spectrum of sophistication, which is generally correlated with management and performance fees. Typically, investors who have more discretion as to how they manage their portfolio by way of a wider degree of instruments (equity, credit, options, and others) and direction (both long and short) to use, charge higher fees for managing clients’ money. Mathematically, this is equivalent to making investment decisions from a wider universe of potential decisions (a larger decision space). The specific exposures that such sophisticated portfolios can capture may deviate meaningfully from the index in both positive and negative directions and, therefore, make the matter of an investor’s skill level extremely important. With the increased fees these portfolio managers command, asset owners should see a commensurate increase in returns and risk-adjusted returns. The general approach in this section could be used by asset allocators to assess fee justifiability among potential fund managers.

Overall, our proposed methodologies are most helpful to a Chief Investment Officer or a Head of Quantitative Research type role, where one is managing a portfolio of underlying investors or trading strategies. Our paper demonstrates concrete use cases for managing equity hedge funds, where one can systematically identify shifts in equity market dynamics, clusters of businesses that are likely to respond similarly to exogenous shocks and make appropriate inference as to how portfolio returns are likely to be impacted. These ideas are at the very core of quantitative investment and portfolio management, and although they may seem independent, the three methodologies we present are inter-connected. Our regime identification would be used in an online (real-time) setting to identify changes in market dynamics. As market dynamics change, portfolio managers are likely to change their underlying portfolio composition. To understand which equities are likely to behave similarly and dissimilarly, one must be able to determine their inherent similarity. Our network analysis is a parsimonious framework for identifying clusters of equities that are likely to behave similarly. Finally, our portfolio simulation section provides portfolio managers with an approach for thinking about how the distribution of risk and return is likely to change as the underlying composition changes.

In particular, the methods in this paper, such as the 30-day smoothing window and long-term analyses of portfolio performance, are designed for investors who make portfolio decisions relatively infrequently, that is, investors who are building trading strategies for mid-long term asset allocation. This includes large pensions and endowments, superannuation funds, and focused investment groups who specialize in security selection rather than exploiting market inefficiencies in very short-term periods. This approach is not uncommon in trading, where momentum and trend following strategies can work based on smoothing out the underlying time series. CTA and managed futures strategies have worked in this way for many years.

There are a variety of opportunities for future research. First, one could extend our work in detecting the market structure and see if this can be done in an online setting where machine learning algorithms may predict the probability of future dislocations in the market. Furthermore, many parameters in our modeling approach could be optimized based on the specific properties of an underlying time series. For instance, a time series with more substantial short-term variance may require a tighter window, while a more slow-moving time series may benefit from a larger window. This could be estimated based on the specific time series properties that are presented. Second, it would be interesting to explore the market’s inherent connectedness between a mixture of asset classes. That is, how would the market’s network diagram look after fixed income, cryptocurrency, currencies, and other options are incorporated into the graph? After including assets with longer-term structurally depressed correlation with equities, alternative assets may be seen as a more suitable diversification strategy than gold. Finally, in our portfolio sampling section, we highlight the required level of a manager skill (by quantile of the distribution) in order to justify the existence of long-only vs long-short equity managers. This is due to the enlarged space of outcomes as investors manage portfolios from larger decision spaces. It would be interesting to test this on a wider range of periods than simply the entire window and the GFC. There may be numerous periods other than just market crises where shorting has its place in expanding the possible space of returns in both positive and negative directions. Similarly, with an even larger sample space of asset classes, such as a portfolio that can invest across the capital structure and in different markets, there may be an even higher benchmark on an investment manager skill.

The authors have no conflicts to disclose.

Nick James: Conceptualization (equal); Data curation (equal); Formal analysis (equal); Investigation (equal); Methodology (equal); Software (equal); Validation (equal); Visualization (equal); Writing – original draft (equal); Writing – review & editing (equal). Max Menzies: Conceptualization (equal); Data curation (equal); Formal analysis (equal); Investigation (equal); Methodology (equal); Software (equal); Validation (equal); Visualization (equal); Writing – original draft (equal); Writing – review & editing (equal).

The data that support the findings of this study are openly available in Ref. 92.

Advertising 
Aerospace defense 
Agriculture 
Alcoholic beverages 
Asset management 
Auto manufacturers 
Banks - diversified 
Biotechnology 
Building products and equipment 
Capital markets 
Casinos 
Communications 
Computer hardware 
Conglomerates 
Consumer electronics 
Credit 
Department stores 
Diagnostics research 
Discount stores 
Drug manufacturers 
Electrical equipment 
Entertainment 
Farming heavy construction 
Footwear and accessories 
Gambling 
Gaming 
Gold 
Healthcare plans 
Home improvement retail 
Household 
Industrial metals mining 
Information technologies 
Insurance 
Internet 
Internet retail 
Leisure 
Lodging 
Medical devices 
Medical distribution 
Medical instruments supplies 
Non-alcoholic beverages 
Oil and gas 
Packaged foods 
Packaging containers 
Publishing 
REIT 
Railroads 
Real estate 
Restaurants 
Retail 
Scientific instruments 
Semiconductors 
Software applications 
Software infrastructure 
Special industrial machinery 
Specialty chemicals 
Telecom 
Tobacco 
Utilities 
Waste management 
Advertising 
Aerospace defense 
Agriculture 
Alcoholic beverages 
Asset management 
Auto manufacturers 
Banks - diversified 
Biotechnology 
Building products and equipment 
Capital markets 
Casinos 
Communications 
Computer hardware 
Conglomerates 
Consumer electronics 
Credit 
Department stores 
Diagnostics research 
Discount stores 
Drug manufacturers 
Electrical equipment 
Entertainment 
Farming heavy construction 
Footwear and accessories 
Gambling 
Gaming 
Gold 
Healthcare plans 
Home improvement retail 
Household 
Industrial metals mining 
Information technologies 
Insurance 
Internet 
Internet retail 
Leisure 
Lodging 
Medical devices 
Medical distribution 
Medical instruments supplies 
Non-alcoholic beverages 
Oil and gas 
Packaged foods 
Packaging containers 
Publishing 
REIT 
Railroads 
Real estate 
Restaurants 
Retail 
Scientific instruments 
Semiconductors 
Software applications 
Software infrastructure 
Special industrial machinery 
Specialty chemicals 
Telecom 
Tobacco 
Utilities 
Waste management 

In this brief appendix, we explain the definition and computation of the Wasserstein metric d W, which we use between distributions of log returns in Sec. III. In greatest generality, the L 1 Wasserstein metric is defined between any two probability measures μ , ν on a metric space X. When X is the set of real numbers R, the metric has the form
(B1)
This infimum is taken over all joint probability measures γ on R × R with marginal probability distributions μ and ν. In the case where μ , ν have cumulative distribution functions F , G, respectively, on R, there is a simple representation,98 
(B2)
where F 1 is the inverse cumulative distribution function or the quantile function associated with F.99 In our application, we apply d W to distributions of 30-day log returns d W ( R j [ t τ + 1 : t ] and R j [ t + 1 : t + τ ] ), both of which yield cumulative distribution functions and quantile functions that are simple to compute.
1.
D. J.
Fenn
,
M. A.
Porter
,
S.
Williams
,
M.
McDonald
,
N. F.
Johnson
, and
N. S.
Jones
, “
Temporal evolution of financial-market correlations
,”
Phys. Rev. E
84
(
2
),
026109
(
2011
).
2.
A. J.
Heckens
,
S. M.
Krause
, and
T.
Guhr
, “
Uncovering the dynamics of correlation structures relative to the collective market motion
,”
J. Stat. Mech.: Theory Exp.
2020
(
10
),
103402
.
3.
M. C.
Münnix
,
T.
Shimada
,
R.
Schäfer
,
F.
Leyvraz
,
T. H.
Seligman
,
T.
Guhr
, and
H. E.
Stanley
, “
Identifying states of a financial market
,”
Sci. Rep.
2
(
1
),
644
(
2012
).
4.
R. K.
Pan
and
S.
Sinha
, “
Collective behavior of stock price movements in an emerging market
,”
Phys. Rev. E
76
(
4
),
046116
(
2007
).
5.
G.
Bonanno
,
G.
Caldarelli
,
F.
Lillo
, and
R. N.
Mantegna
, “
Topology of correlation-based minimal spanning trees in real and model markets
,”
Phys. Rev. E
68
(
4
),
046130
(
2003
).
6.
D.-H.
Kim
and
H.
Jeong
, “
Systematic analysis of group identification in stock markets
,”
Phys. Rev. E
72
(
4
),
046133
(
2005
).
7.
J.-P.
Onnela
,
A.
Chakraborti
,
K.
Kaski
,
J.
Kertész
, and
A.
Kanto
, “
Dynamics of market correlations: Taxonomy and portfolio analysis
,”
Phys. Rev. E
68
(
5
),
056110
(
2003
).
8.
J.-P.
Onnela
,
K.
Kaski
, and
J.
Kert’esz
, “
Clustering and information in correlation based financial networks
,”
Eur. Phys. J. B
38
(
2
),
353
362
(
2004
).
9.
A.
Utsugi
,
K.
Ino
, and
M.
Oshikawa
, “
Random matrix theory analysis of cross correlations in financial markets
,”
Phys. Rev. E
70
(
2
),
026110
(
2004
).
10.
G.
Leibon
,
S.
Pauls
,
D.
Rockmore
, and
R.
Savell
, “
Topological structures in the equities market network
,”
Proc. Natl. Acad. Sci. U.S.A.
105
(
52
),
20589
20594
(
2008
).
11.
J.
Miśkiewicz
, “
Network analysis of cross-correlations on forex market during crises. Globalisation on forex market
,”
Entropy
23
(
3
),
352
(
2021
).
12.
D.
Kondor
,
M.
Pósfai
,
I.
Csabai
, and
G.
Vattay
, “
Do the rich get richer? An empirical analysis of the Bitcoin transaction network
,”
PLoS One
9
(
2
),
e86197
(
2014
).
13.
Y.
Fang
,
H.
Xu
,
M.
Perc
, and
Q.
Tan
, “
Dynamic evolution of economic networks under the influence of mergers and divestitures
,”
Phys. A
524
,
89
99
(
2019
).
14.
T.
Cheng
,
J.
Liu
,
W.
Yao
, and
A. B.
Zhao
, “
The impact of COVID-19 pandemic on the volatility connectedness network of global stock market
,”
Pac. Basin Finance J.
71
,
101678
(
2022
).
15.
P.
Fiedor
, “
Networks in financial markets based on the mutual information rate
,”
Phys. Rev. E
89
(
5
),
052801
(
2014
).
16.
L. G. A.
Alves
,
H. Y. D.
Sigaki
,
M.
Perc
, and
H. V.
Ribeiro
, “
Collective dynamics of stock market efficiency
,”
Sci. Rep.
10
(
1
),
21992
(
2020
).
17.
N.
James
and
M.
Menzies
, “
An exploration of the mathematical structure and behavioural biases of 21st century financial crises
,”
Phys. A
630
,
129256
(
2023
).
18.
N.
James
,
M.
Menzies
, and
K.
Chin
, “
Economic state classification and portfolio optimisation with application to stagflationary environments
,”
Chaos, Solitons Fractals
164
,
112664
(
2022c
).
19.
D.
Wilcox
and
T.
Gebbie
, “
An analysis of cross-correlations in an emerging market
,”
Phys. A
375
(
2
),
584
598
(
2007
).
20.
M.
Ausloos
, “
Statistical physics in foreign exchange currency and stock markets
,”
Phys. A
285
(
1-2
),
48
65
(
2000
).
21.
S.
Drożdż
,
J.
Kwapień
, and
M.
Wa¸torek
, “
What is mature and what is still emerging in the cryptocurrency market?
,”
Entropy
25
(
5
),
772
(
2023
).
22.
S.
Drożdż
,
L.
Minati
,
P.
Oświe¸cimka
,
M.
Stanuszek
, and
M.
Wa¸torek
, “
Competition of noise and collectivity in global cryptocurrency trading: Route to a self-contained market
,”
Chaos
30
(
2
),
023122
(
2020
).
23.
R.
Ge¸barowski
,
P.
Oświe¸cimka
,
M.
Wa¸torek
, and
S.
Drożdż
, “
Detecting correlations and triangular arbitrage opportunities in the forex by means of multifractal detrended cross-correlations analysis
,”
Nonlinear Dyn.
98
(
3
),
2349
2364
(
2019
).
24.
N.
James
and
M.
Menzies
, “
Collective correlations, dynamics, and behavioural inconsistencies of the cryptocurrency market over time
,”
Nonlinear Dyn.
107
(
4
),
4001
4017
(
2022a
).
25.
N.
James
and
M.
Menzies
, “
Collective dynamics, diversification and optimal portfolio construction for cryptocurrencies
,”
Entropy
25
(
6
),
931
(
2023
).
26.
J.
Kwapień
,
M.
Wa¸torek
,
M.
Bezbradica
,
M.
Crane
,
T. T.
Mai
, and
S.
Drożdż
, “
Analysis of inter-transaction time fluctuations in the cryptocurrency market
,”
Chaos
32
(
8
),
083142
(
2022
).
27.
M.
Wa¸torek
,
J.
Kwapień
, and
S.
Drożdż
, “
Multifractal cross-correlations of Bitcoin and ether trading characteristics in the post-COVID-19 time
,”
Future Inter.
14
(
7
),
215
(
2022
).
28.
M.
Wa¸torek
,
J.
Kwapień
, and
S.
Drożdż
, “
Cryptocurrencies are becoming part of the world global financial market
,”
Entropy
25
(
2
),
377
(
2023
).
29.
J.
Driessen
,
B.
Melenberg
, and
T.
Nijman
, “
Common factors in international bond returns
,”
J. Int. Money Financ.
22
(
5
),
629
656
(
2003
).
30.
B.
Blasius
, “
Power-law distribution in the number of confirmed COVID-19 cases
,”
Chaos
30
(
9
),
093123
(
2020
).
31.
N.
James
and
M.
Menzies
, “
Estimating a continuously varying offset between multivariate time series with application to COVID-19 in the United States
,”
Eur. Phys. J. Spec. Top.
231
,
3419
3426
(
2022c
).
32.
N.
James
and
M.
Menzies
, “
Collective infectivity of the pandemic over time and association with vaccine coverage and economic development
,”
Chaos, Solitons Fractals
176
,
114139
(
2023
).
33.
N.
James
,
M.
Menzies
, and
H.
Bondell
, “
Comparing the dynamics of COVID-19 infection and mortality in the United States, India, and Brazil
,”
Phys. D
432
,
133158
(
2022a
).
34.
N.
James
,
M.
Menzies
, and
P.
Radchenko
, “
COVID-19 second wave mortality in Europe and the United States
,”
Chaos
31
,
031105
(
2021
).
35.
H.-J.
Li
,
W.
Xu
,
S.
Song
,
W.-X.
Wang
, and
M.
Perc
, “
The dynamics of epidemic spreading on signed networks
,”
Chaos, Solitons Fractals
151
,
111294
(
2021
).
36.
J. A. T.
Machado
and
A. M.
Lopes
, “
Rare and extreme events: The case of COVID-19 pandemic
,”
Nonlinear Dyn.
100
,
2953
2972
(
2020
).
37.
C.
Manchein
,
E. L.
Brugnago
,
R. M.
da Silva
,
C. F. O.
Mendes
, and
M. W.
Beims
, “
Strong correlations between power-law growth of COVID-19 in four continents and the inefficiency of soft quarantine strategies
,”
Chaos
30
(
4
),
041102
(
2020
).
38.
M.
Perc
,
N. G.
Miksić
,
M.
Slavinec
, and
A.
Stožer
, “
Forecasting COVID-19
,”
Front. Phys.
8
,
127
(
2020
).
39.
A. S.
Sunahara
,
A. A. B.
Pessa
,
M.
Perc
, and
H. V.
Ribeiro
, “
Complexity of the COVID-19 pandemic in Maringá
,”
Sci. Rep.
13
(
1
),
12695
(
2023
).
40.
R. G.
Derwent
,
D. R.
Middleton
,
R. A.
Field
,
M. E.
Goldstone
,
J. N.
Lester
, and
R.
Perry
, “
Analysis and interpretation of air quality data from an urban roadside location in central London over the period from July 1991 to July 1992
,”
Atmos. Environ.
29
(
8
),
923
946
(
1995
).
41.
S. K.
Grange
,
D. C.
Carslaw
,
A. C.
Lewis
,
E.
Boleti
, and
C.
Hueglin
, “
Random forest meteorological normalisation models for Swiss PM 1 0 trend analysis
,”
Atmos. Chem. Phys.
18
(
9
),
6223
6239
(
2018
).
42.
N.
James
and
M.
Menzies
, “
Global and regional changes in carbon dioxide emissions: 1970-2019
,”
Phys. A
608
,
128302
(
2022d
).
43.
N.
James
and
M.
Menzies
, “
Spatio-temporal trends in the propagation and capacity of low-carbon hydrogen projects
,”
Int. J. Hydrog. Energy
47
(
38
),
16775
16784
(
2022f
).
44.
N.
James
and
M.
Menzies
, “
Distributional trends in the generation and end-use sector of low-carbon hydrogen plants
,”
Hydrogen
4
,
174
189
(
2023
).
45.
N.
James
and
M.
Menzies
, “
Equivalence relations and L p distances between time series with application to the Black Summer Australian bushfires
,”
Phys. D
448
,
133693
(
2023
).
46.
M. K.
Khan
,
M. I.
Khan
, and
M.
Rehan
, “
The relationship between energy consumption, economic growth and carbon dioxide emissions in Pakistan
,”
Financ. Innov.
6
(
1
),
1
13
(
2020
).
47.
C.
Libiseller
,
A.
Grimvall
,
J.
Waldén
, and
H.
Saari
, “
Meteorological normalisation and non-parametric smoothing for quality assessment and trend analysis of tropospheric ozone data
,”
Environ. Monit. Assess.
100
(
1-3
),
33
52
(
2005
).
48.
E. J.
Westmoreland
,
N.
Carslaw
,
D. C.
Carslaw
,
A.
Gillah
, and
E.
Bates
, “
Analysis of air quality within a street canyon using statistical and dispersion modelling techniques
,”
Atmos. Environ.
41
(
39
),
9195
9205
(
2007
).
49.
N.
James
and
M.
Menzies
, “
Dual-domain analysis of gun violence incidents in the United States
,”
Chaos
32
,
111101
(
2022
).
50.
N.
James
,
M.
Menzies
,
J.
Chok
,
A.
Milner
, and
C.
Milner
, “
Geometric persistence and distributional trends in worldwide terrorism
,”
Chaos, Solitons Fractals
169
,
113277
(
2023
).
51.
M.
Perc
,
K.
Donnay
, and
D.
Helbing
, “
Understanding recurrent crime as system-immanent collective behavior
,”
PLoS One
8
(
10
),
76063
(
2013
).
52.
A.
Clauset
,
M.
Kogan
, and
S.
Redner
, “
Safe leads and lead changes in competitive team sports
,”
Phys. Rev. E
91
(
6
),
062815
(
2015
).
53.
N.
James
,
M.
Menzies
, and
H.
Bondell
, “
In search of peak human athletic potential: A mathematical investigation
,”
Chaos
32
,
023110
(
2022
).
54.
J. D.
Hamilton
, “
A new approach to the economic analysis of nonstationary time series and the business cycle
,”
Econometrica
57
(
2
),
357
384
(
1989
).
55.
C. G.
Lamoureux
and
W. D.
Lastrapes
, “
Persistence in variance, structural change, and the GARCH model
,”
J. Bus. Econ. Stat.
8
(
2
),
225
234
(
1990
).
56.
M.
Lavielle
and
G.
Teyssière
, “Adaptive detection of multiple change-points in asset price volatility,” in Long Memory in Economics (Springer, Berlin, 2007), pp. 129–156.
57.
T.
Ozaki
and
H.
Tong
, “On fitting of non-stationary autoregressive models in time series analysis,” in Proceedings of the 8th Hawaii International Conference on System Science (ACM Press, 1975), pp. 1055–1062.
58.
M. B.
Priestley
, “
Evolutionary spectra and non-stationary processes
,”
J. R. Stat. Soc. Ser. B
27
(
2
),
204
237
(
1965
).
59.
M. B.
Priestley
and
H.
Tong
, “
On the analysis of bivariate non-stationary processes
,”
J. R. Stat. Soc. Ser. B
35
(
2
),
153
166
(
1973
).
60.
H.
Tong
and
K. S.
Lim
, “
Threshold autoregression, limit cycles and cyclical data
,”
J. R. Stat. Soc.: Ser. B
42
(
3
),
245
268
(
1980
).
61.
M.
Guidolin
, “Markov switching models in empirical finance,” in Missing Data Methods: Time-Series Methods and Applications (Emerald Group Publishing Limited, 2011), pp. 1–86.
62.
J. W.
Taylor
, “
Evaluating volatility and interval forecasts
,”
J. Forecast.
18
(
2
),
111
128
(
1999
).
63.
J. W.
Taylor
, “
Generating volatility forecasts from value at risk estimates
,”
Manage. Sci.
51
(
5
),
712
725
(
2005
).
64.
N.
Baba
and
Y.
Sakurai
, “
Predicting regime switches in the VIX index with macroeconomic variables
,”
Appl. Econ. Lett.
18
(
15
),
1415
1419
(
2011
).
65.
M.
Arouri
,
C.
Estay
,
C.
Rault
, and
D.
Roubaud
, “
Economic policy uncertainty and stock markets: Long-run evidence from the US
,”
Finance Res. Lett.
18
,
136
141
(
2016
).
66.
L. C.
Baiardi
,
M.
Costabile
,
D. D.
Giovanni
,
F.
Lamantia
,
A.
Leccadito
,
I.
Massabó
,
M.
Menzietti
,
M.
Pirra
,
E.
Russo
, and
A.
Staino
, “
The dynamics of the S&P 500 under a crisis context: Insights from a three-regime switching model
,”
Risks
8
(
3
),
71
(
2020
).
67.
K.
Balcombe
and
I.
Fraser
, “
Do bubbles have an explosive signature in Markov switching models?
,”
Econ. Model.
66
,
81
100
(
2017
).
68.
C. H.
Campani
,
R.
Garcia
, and
M.
Lewin
, “
Optimal portfolio strategies in the presence of regimes in asset returns
,”
J. Bank. Financ.
123
,
106030
(
2021
).
69.
K.
Carstensen
,
M.
Heinrich
,
M.
Reif
, and
M. H.
Wolters
, “
Predicting ordinary and severe recessions with a three-state Markov-switching dynamic factor model
,”
Inter. J. Forecast.
36
(
3
),
829
850
(
2020
).
70.
A.
Prakash
,
N.
James
,
M.
Menzies
, and
G.
Francis
, “
Structural clustering of volatility regimes for dynamic trading strategies
,”
Appl. Math. Finance
28
(
3
),
236
274
(
2021
).
71.
W.
Song
,
D.
Ryu
, and
R. I.
Webb
, “
Overseas market shocks and VKOSPI dynamics: A Markov-switching approach
,”
Finance Res. Lett.
16
,
275
282
(
2016
).
72.
N.
James
and
M.
Menzies
, “
A new measure between sets of probability distributions with applications to erratic financial behavior
,”
J. Stat. Mech.: Theory Exp.
2021
(
12
),
123404
.
73.
N.
James
,
M.
Menzies
,
L.
Azizi
, and
J.
Chan
, “
Novel semi-metrics for multivariate change point analysis and anomaly detection
,”
Phys. D
412
,
132636
(
2020
).
74.
G. J.
Ross
, “
Modelling financial volatility in the presence of abrupt changes
,”
Phys. A
392
(
2
),
350
360
(
2013
).
75.
H.
Markowitz
, “
Portfolio selection
,”
J. Finance
7
(
1
),
77
(
1952
).
76.
W. F.
Sharpe
, “
Mutual fund performance
,”
J. Busin.
39
(
S1
),
119
138
(
1966
).
77.
N.
James
,
M.
Menzies
, and
J.
Chan
, “
Semi-metric portfolio optimization: A new algorithm reducing simultaneous asset shocks
,”
Econometrics
11
(
1
),
8
(
2023
).
78.
B.
Li
and
R.
Zhang
, “
A new mean-variance-entropy model for uncertain portfolio optimization with liquidity and diversification
,”
Chaos, Solitons Fractals
146
,
110842
(
2021
).
79.
P.
Zhao
and
Q.
Xiao
, “
Portfolio selection problem with liquidity constraints under non-extensive statistical mechanics
,”
Chaos, Solitons Fractals
82
,
5
10
(
2016
).
80.
C.
Iorio
,
G.
Frasso
,
A.
D’Ambrosio
, and
R.
Siciliano
, “
A P-spline based clustering approach for portfolio selection
,”
Expert Syst. Appl.
95
,
88
103
(
2018
).
81.
D.
León
,
A.
Aragón
,
J.
Sandoval
,
G.
Hernández
,
A.
Arévalo
, and
J.
Niño
, “
Clustering algorithms for risk-adjusted portfolio construction
,”
Proc. Comput. Sci.
108
,
1334
1343
(
2017
).
82.
E.
Ammar
and
H.
Khalifa
, “
Fuzzy portfolio optimization a quadratic programming approach
,”
Chaos, Solitons Fractals
18
(
5
),
1045
1054
(
2003
).
83.
H.
Tanaka
,
P.
Guo
, and
I.
Türksen
, “
Portfolio selection based on fuzzy probabilities and possibility distributions
,”
Fuzzy Sets Syst.
111
(
3
),
387
397
(
2000
).
84.
B.
Fastrich
,
S.
Paterlini
, and
P.
Winker
, “
Constructing optimal sparse portfolios using regularization methods
,”
Comput. Manage. Sci.
12
(
3
),
417
434
(
2014
).
85.
J.
Li
, “
Sparse and stable portfolio selection with parameter uncertainty
,”
J. Bus. Econ. Stat.
33
(
3
),
381
392
(
2015
).
86.
C. S.
Pun
and
H. Y.
Wong
, “
A linear programming model for selection of sparse high-dimensional multiperiod portfolios
,”
Eur. J. Oper. Res.
273
(
2
),
754
771
(
2019
).
87.
N.
James
and
M.
Menzies
, “
Optimally adaptive Bayesian spectral density estimation for stationary and nonstationary processes
,”
Stat. Comput.
32
,
45
(
2022e
).
88.
W. S.
Lam
,
W. H.
Lam
, and
S. H.
Jaaman
, “
Portfolio optimization with a mean-absolute deviation-entropy multi-objective model
,”
Entropy
23
(
10
),
1266
(
2021
).
89.
Y.
Jin
,
R.
Qu
, and
J.
Atkin
, “Constrained portfolio optimisation: The state-of-the-art Markowitz models,” in Proceedings of the 5th International Conference on Operations Research and Enterprise Systems (SCITEPRESS—Science and Technology Publications, 2016), pp 388–395.
90.
D. X.
Shaw
,
S.
Liu
, and
L.
Kopman
, “
Lagrangian relaxation procedure for cardinality-constrained portfolio optimization
,”
Optim. Methods Softw.
23
(
3
),
411
420
(
2008
).
91.
K.
Anagnostopoulos
and
G.
Mamanis
, “
The mean–variance cardinality constrained portfolio optimization problem: An experimental evaluation of five multiobjective evolutionary algorithms
,”
Expert Syst. Appl.
38
,
14208
14217
(
2011
).
92.
Yahoo Finance
. See https://finance.yahoo.com; accessed 1 February 2024.
93.
N.
James
and
M.
Menzies
, “
Portfolio diversification with varying investor abilities
,”
Europhys. Lett.
145
(
3
),
32002
(
2024
).
94.
G.
Coffey
, “Investment policy statement: Elements of a clearly defined IPS for non-profits,” Russell Investments Research (April 2016); see https://russellinvestments.com/-/media/files/us/insights/institutions/non-profit/elements-of-a-clearly-defined-ips-for-non-profits-an-update.
95.
V.
DeMiguel
,
L.
Garlappi
, and
R.
Uppal
, “
Optimal versus naive diversification: How inefficient is the 1/n portfolio strategy?
,”
Rev. Financ. Stud.
22
(
5
),
1915
1953
(
2009
).
96.
A.
Farago
and
E.
Hjalmarsson
, “
Small rebalanced portfolios often beat the market over long horizons
,”
Rev. Asset Pricing Stud.
13
(
2
),
307
342
(
2023
).
97.
M.
Mikulic
, “Global pharmaceutical industry—Statistics & facts, ”Statista (January 10, 2024); see https://www.statista.com/topics/1764/global-pharmaceutical-industry/.
98.
E.
del Barrio
,
E.
Giné
, and
C.
Matrán
, “
Central limit theorems for the Wasserstein distance between the empirical and the true distributions
,”
Ann. Prob.
27
(
2
),
1009
1071
(
1999
).
99.
W.
Gilchrist
,
Statistical Modelling with Quantile Functions
(
Chapman & Hall/CRC
,
2000
).