Skip to main content
NIHPA Author Manuscripts logoLink to NIHPA Author Manuscripts
. Author manuscript; available in PMC: 2011 Aug 15.
Published in final edited form as: Physica A. 2010 Aug 15;389(16):3250–3253. doi: 10.1016/j.physa.2010.04.005

Untangling complex networks: risk minimization in financial markets through accessible spin glass ground states

Andreas Martin Lisewski, Olivier Lichtarge
PMCID: PMC2899695  NIHMSID: NIHMS196490  PMID: 20625477

Abstract

Recurrent international financial crises inflict significant damage to societies and stress the need for mechanisms or strategies to control risk and tamper market uncertainties. Unfortunately, the complex network of market interactions often confounds rational approaches to optimize financial risks. Here we show that investors can overcome this complexity and globally minimize risk in portfolio models for any given expected return, provided the relative margin requirement remains below a critical, empirically measurable value. In practice, for markets with centrally regulated margin requirements, a rational stabilization strategy would be keeping margins small enough. This result follows from ground states of the random field spin glass Ising model that can be calculated exactly through convex optimization when relative spin coupling is limited by the norm of the network's Laplacian matrix. In that regime, this novel approach is robust to noise in empirical data and may be also broadly relevant to complex networks with frustrated interactions that are studied throughout scientific fields.

Keywords: networks, spin glass, ground states, econophysics, portfolio

1. Introduction

Large and abnormal fluctuations in financial markets can spread into other parts of the global economy with untoward and often incalculable effects—as observed to dramatic consequences in recent times. Therefore a key priority is to minimize risks and contain their propagation in spite of the tendencies of current financial markets to the contrary [1, 2]. Important examples of such market places include exchanges where stocks, commodities, futures and other financial products can be bought and sold short by using leverage on margin accounts held by investors. A central financial decision problem in these markets is, for a given expected return rP, to distribute the available capital among multiple assets, which comprise a portfolio P of size n, so to minimize the overall risk.

In portfolio selection models this goal can be mathematically formulated as finding the global minimum of a risk function [4-7], R=1/2i,k=1nCikpipki=1npiriγi=1npisi, where pi is the positive or negative amount of capital invested in asset i, and si = sign (pi) ∈ {−1, 1} are binary spin variables; ri is the expected return of asset i such that rp=i=1nripi;Cik is the covariance between assets i and k; and γ is the margin account requirement which sets the fraction of capital that the investor must deposit in a margin account before buying or selling short assets. With the inverse C−1 of the covariance matrix C the minimum risk distribution p = (p1,…, pn) becomes pi=kCik1rk+γkCik1sk. It is known that finding the absolute risk minimum is computationally equivalent to the ground state problem of the random field Ising model [4, 6]. This is evident after inserting p into the risk function while neglecting fixed terms that do not depend on spin variables which gives R=1/2i,k=1nJiksiski=1nhisi, and where we introduced an interaction term Jik=γCik1 and a random local field h = (h1,…, hn) with hi=k=1nCik1rk. Covariance among assets can be both positive and negative (see, for example, inset in Fig. 1 A), and globally minimizing risk means finding a ground state of the random field Ising model with random spin glass interactions, which in general belongs to the class of NP-complete decision problems [8, 9] and for which efficient algorithms are not known. This computational intractability arises from the non-convexity of the cost function R; non-convex problems are much harder to solve computationally than convex optimization problems for which efficient algorithms do exist [10]. In the context of financial markets, the non-convexity of the spin glass model prevents equilibration into an optimum ground state and is viewed as an inherent source of risk [3, 4].

Figure 1.

Figure 1

(A) Portfolio risk can be globally and rationally minimized if the relative margin requirement satisfies γ / yc < 1. In contrast, for γ / γc > 1 the estimated risk undergoes large fluctuations above the optimum. Red data points (“TAP”) give the risk from solutions of the TAP equation for n = 16 with randomly selected assets from the S&P500 price data, and with a random field h = (h1,…, hn) with |hi| ≤ 1. Blue data points (“Local field”) depict the risk obtained by taking the sign of local field h. Error bars represent standard deviations after 128 random trials. Inset shows the distribution of all price correlations between all pairs in the m = 395 assets taken from the S&P500 index. (B) Estimated critical margin requirement as a function of portfolio size nm and for three different choices of price samples, t = {2511, 193, 78}, where stock prices were selected every {1, 13, 32} days, respectively. Error bars represent standard deviations from 128 random selections in the S&P500 price data. Black solid and dashed graphs represent the function (1n/t)2. (C) The inverse partition ratio Ns=l=1m(ulk)4 for each normalized eigenvector uk of the m × m correlation matrix ranked by its increasing eigenvalues [13]. Red dots represent the unfiltered correlation matrix which, up to a rank of k = 372, follow a semicircle distribution; blue dots represent the filtered correlation matrix after setting all eigenvalues with lower rank to zero, i.e. those in size smaller than λmax. Inset shows the resulting histogram of pairwise price correlations after filtering. (D) Estimated critical margin requirement γc from the S&P500 correlation matrix before (red) and after (blue) eigenvalue filtering. Black solid line represents the graph (2n)-1.

2. Accessible ground states in the spin glass Ising model with random field

Here we demonstrate that ground states are efficiently accessible in the random field spin glass Ising model provided the margin requirement γ remains below a critical value, which we define as γc=L1=[maxi(k=1n|Lik|)]1, where L = DC−1 is the network's Laplacian matrix, with D=diag(i=1nCik1) and ‖L‖ is its maximum norm. This upper bound on the margin requirement ensures that there exists a related but convex risk function Rc=1/2i,k=1nJik(sisk)2+i=1n(hisi)2, which in matrix form reads Rc=(sh)T (sh) + γsT L s. We note that in the special and simpler case with non-negative interactions Jik ≥ 0 similar objective functions have been studied in semi-supervised machine learning [11]. In the more challenging spin glass case, our prerequisite γ < γc makes the Hessian matrix Hc =1 + γL positive definite such that Rc remains convex with one global minimum even if the interaction is described by a random mix of positive and negative numbers. Let s denote the minimum configuration in Rc obtained after convex optimization, then s also depicts the ground state s* of the spin glass Ising model with a random field because assuming the contrary, R(s) > R(s*), leads to a contradiction. To see this we choose a discrete path of single spin flips that leads from s to s*. At the beginning Rc(s) is a global minimum and nowhere on the path the cost in Rc can be lower. Concurrently, for any spin flip at site i the resulting change in Rc equals twice the risk change in R, viz. ΔRc,i=Rc(si)Rc(si)=2ΔRiwithΔRi=2si(hi+1/2k=1nJiksk), and so nowhere along the path–including its end–the risk in R can be lower than at the beginning. Therefore, in contradiction to the assumption, it is R(s*) ≥ R(s) which proves that s is a global minimum of the Ising model. Note that this argument is valid only for the Ising model with non-zero external field h; without a random field the cost function Rc cannot be made convex by reducing the parameter γ.

This result directly implies that once γ < γc is satisfied any feasible algorithm that converges to a local minimum of the random field Ising model will, due to the underlying convexity of Rc, reach the absolute minimum in R; for example, this may be achieved by solving for all si the local stability condition through fixed points of the TAP (Thouless-Anderson-Palmer) equation [12], si=sign[hi+kJiksk] for i ∈ {1,…, n}. It also shows that the critical margin requirement separates two distinct regimes: a disordered regime for γ > γc with an exponential number ∼2n of equivalent local minima in the risk function [4, 7], each one giving a different selection of the portfolio; and, for γ < γc, an ordered regime with only one distinguished minimum. Thus in the latter case the portfolio risk model significantly loses complexity and a computationally efficient, rational access to the optimum is opened.

3. Application to stock price data

To illustrate this general result with a numerical example we compared risk values from actual stock price data evaluated below and above the critical margin requirement. For the calculation of the covariance matrix C we used end-of-day (EOD) stock prices of m = 395 companies included in the Standard and Poor's 500 (S&P500) index over ten years, recorded from February 1999 to February 2009 in t = 2511 time points, which after centralization defined an m×t matrix M with zero mean. From this portfolios of any size nm were randomly selected defined through a reduced n×t matrix Mn where only n rows out of m were retained. Given the selected portfolio's n×n covariance matrix C=(MnMnT)/t and a random input distribution of the local field h, the portfolio risk was optimized efficiently by solving the TAP equation through iteration until a fixed point was reached. Relative risk is the lowest possible risk value (which was a negative number in our example) divided by the estimated risk after optimization. The lowest risk was found through exhaustive search in all spin states; this was computationally feasible due to our choice of a small portfolio size (n = 16) even though solving the TAP equation by iteration is computationally efficient for any network size n. Consistent with the theoretical prediction Fig. 1A shows that with margin requirements below γc the relative risk settled at its global minimum, i.e. at the spin glass Ising model ground state. The picture changes for γ > γc, where strong fluctuations significantly elevate the risk above the ground state; for instance, at γγc, the average relative risk from the TAP solutions leveled out at ∼25% above the optimum.

The price data further allowed us to follow the critical margin requirement as a function of portfolio size n. Figure 1B shows that (a) γc is a decreasing function of n, indicating that in larger portfolios efficient risk minimization imposes stricter limitations on margins, and (b) γc vanishes for qn / t → 1, which means that for a given number of observed prices t efficient risk minimization can only occur up to a maximum portfolio size n = t. This behavior can be understood by assuming that C is a random Wishart matrix where the bulk of eigenvalues follows a Marcenko-Pastur distribution [13] with a minimum eigenvalue λmin=σ2(1q)2 and a maximum λmax=σ2(1+q)2; here, without loss of generality, σ2 ≥ 1 denotes the variance of the elements in M. Therefore—by duality—the spectral radius ρ(C−1), defined as the largest eigenvalue of C−1, equals λmin1. Since (1q)2ρ(C1)C1L+D it follows that in the limit q →1 the norm ‖L‖ diverges and hence γc must vanish.

Random matrix theory can be further applied to analyze the influence of noise on the critical margin requirement. For that we normalized C by the variance to obtain the price correlation matrix with a small parameter q = 395 / 2511 ≈ 0.16; we then filtered by setting all its eigenvalues below λmax to zero because these are expected to contribute only uninformative noise [13, 14]. Even though this procedure discarded all but the highest 23 eigenvalues (Fig. 1C) the resulting distribution of price correlations remained practically unaffected (compare inset in Fig. 1C with inset in Fig. 1A), which indicates that spin glass interactions from these data are genuine and not mere noise artifacts [14, 15]. However, filtering significantly lifted the critical margin requirement estimates (Fig. 1D) which suggests that this number is systematically underestimated when computed from unfiltered correlations. In this filtered case, the critical margin requirement is expected to scale inversely proportional to 2n, which directly follows from the definition of γc and from the fact that the underlying pairwise correlations form a totally connected graph. Indeed, Fig. 1D shows that this simple scaling, γc ∼ (2n)−1, is an accurate approximation to the critical margin requirement graph obtained from actual price data. Thus, in this example, noise filtering becomes a stabilizer that can extend the parameter range for efficient risk optimization.

4. Conclusions

Risk minimization in portfolio selection models with short selling is equivalent to the ground state problem of the random field Ising model with spin glass interactions. Because calculating its ground state is computationally hard in general, globally minimizing the risk has been regarded as unfeasible with a computationally efficient and rational approach [3, 4]. Our result shows that, under realistic conditions, finding the ground state and thus efficient risk minimization is rationally possible. As a direct consequence in financial markets, this may provide an instrument for curbing volatility if financial products are traded below the critical margin requirement, and if investors and traders rationally optimize their portfolios. The second condition is both desirable and realistic in today's highly computerized markets, although it may have been less realistic in the past when computers were not widespread and therefore complex financial decisions were to a lesser degree rational. But the first condition seems to be in conflict with interests of traders and lenders who, in individual contracts, seek to reduce default risk by increasing margins. From a collective market perspective, however, higher margin requirements may have a destabilizing effect through higher transaction costs, which can drive traders from the market place; this may lead to a lower overall liquidity thus making the market more susceptible to volatility [16, 17]. Hence, in financial markets where minimum margin requirements are regulated a reduction of risk by lowering margins is conceivable. Historically, the possibility of such a regulatory approach is indirectly supported by the fact that both the 1987 and the 1929 financial market crashes were accompanied by an increase in margin requirements which exacerbated liquidity problems and which might have contributed to rapid downfall [18, 19]. Of practical relevance may be the observation that for portfolio sizes above n ≈ 10 our estimates on the critical margin requirement from the recent American stock market fall below one (Fig. 1B), thus potentially imposing realistic upper limits on margins requirements.

The efficient access to an optimum is not restricted to portfolio risk models; in general, an efficient computation of a ground state is possible in any spin glass Ising model with a random field if the relative coupling strength between spins falls below the critical value. Further applications may follow in frustrated systems that routinely occur in artificial [20, 21] and in biological [22, 23] networks and where the goal is to find a ground state.

Acknowledgments

The authors thank Peter McPhee for providing historical stock price data. Financial support was given by the National Science Foundation grants NSF DBI- 0547695 and CCF-0905536, and by the National Institute of Health grants NIH R01GM066099 and R01GM079656.

Footnotes

Publisher's Disclaimer: This is a PDF file of an unedited manuscript that has been accepted for publication. As a service to our customers we are providing this early version of the manuscript. The manuscript will undergo copyediting, typesetting, and review of the resulting proof before it is published in its final citable form. Please note that during the production process errors may be discovered which could affect the content, and all legal disclaimers that apply to the journal pertain.

References

  • 1.International Monetary Fund. Global financial stability report. Washington DC: 2009. [Google Scholar]
  • 2.Caporale GM, Pittis N, Spagnolo N. Volatility transmission and financial crises. J Econ Finance. 2006;30:376–391. [Google Scholar]
  • 3.Bouchaud JP. The (unfortunate) complexity of the economy. Physics World. 2009;22:28–32. [Google Scholar]
  • 4.Galluccio S, Bouchaud JP, Potters M. Rational decisions, random matrices and spin glasses. Physica A. 1998;259:449. [Google Scholar]
  • 5.Gabor A, Kondor I. Portfolios with nonlinear constraints and spin glasses. Physica A. 1999;274:222–228. [Google Scholar]
  • 6.Rosenow B, Gopikrishnan P, Plerou V, Stanley HE. Random magnets and correlations of stock price fluctuations. Physica A. 2002;314:762–767. [Google Scholar]
  • 7.Bongini L, Degli Esposti M, Giardina C, Schianchi A. Portfolio optimization with short-selling and spin-glass. Eur Phys J B. 2002;27:263–272. [Google Scholar]
  • 8.Bachas CP. Computer-intractability of the frustration model of a spin glass. J Phys A. 1984;17:L709–L712. [Google Scholar]
  • 9.Istrail S. Statistical mechanics, three-dimensionality and NP-completeness. Proceedings of the 31st ACM Annual Symposium on the Theory of Computing. 87-96; 2000. [Google Scholar]
  • 10.Rieger H. Lecture Notes in Physics. Vol. 501. Springer Verlag; 1998. Frustrated systems: ground state properties via combinatorial optimization; pp. 122–158. [Google Scholar]
  • 11.Zhou D, Bousquet O, Weston J, Schölkopf B. Advances in Neural Information Processing Systems. Vol. 16. MIT Press; 2004. Learning with local and global consistency; pp. 321–328. [Google Scholar]
  • 12.Thouless D, Anderson PW, Palmer RG. Solution of solvable model of a spin glass. Phil Mag. 1977;35:593–601. [Google Scholar]
  • 13.Laloux L, Cizeau P, Bouchaud JP, Potters M. Noise dressing of financial correlation matrices. Phys Rev Lett. 1999;83:1467–1470. [Google Scholar]
  • 14.Rosenow B, Plerou V, Gopikrishnan P, Stanley HE. Portfolio optimization and the random magnet problem. Europhys Lett. 2002;59:500–506. [Google Scholar]
  • 15.Pafka S, Kondor I. Noisy covariance matrices and portfolio optimization II. Physica A. 2002;319:487–494. [Google Scholar]
  • 16.France VG, Kodres L, Moser JT. A Review of Regulatory mechanisms to control the volatility of prices. Econ Perspect. 1994;18:15–28. [Google Scholar]
  • 17.Anshuman VR. Regulatory measures to curb stock price volatility. Econ Polit Week. 2003;38:677–679. [Google Scholar]
  • 18.Rappoport P, White EN. Was the crash of 1929 expected? Amer Econ Rev. 1994;84:271–281. [Google Scholar]
  • 19.Warshawsky MJ, Dietrich E. The adequacy and consistency of margin requirements in the markets for stocks and derivative products. Staff Studies from the Board of Governors of the Federal Reserve System (U.S.) 1989 158. [Google Scholar]
  • 20.Hopfield JJ. Neural networks and physical systems with emergent collective computational abilities. Proc Natl Acad Sci USA. 1982;79:2554–2558. doi: 10.1073/pnas.79.8.2554. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Sourlas N. Spin-glass models as error-correcting codes. Nature. 1989;339:695–697. [Google Scholar]
  • 22.Goldstein RA, Luthey-Schulten ZA, Wolynes PG. Optimal protein-folding codes from spin-glass theory. Proc Natl Acad Sci USA. 1992;89:4918–4922. doi: 10.1073/pnas.89.11.4918. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Scheidman E, Berry MJ, Segev R, Bialek W. Weak pairwise correlations imply strongly correlated network states in a neural population. Nature. 2006;440:1007–1012. doi: 10.1038/nature04701. [DOI] [PMC free article] [PubMed] [Google Scholar]

RESOURCES