Image Image Image Image Image Image Image Image Image Image

Turing Finance | December 2, 2016

Scroll to top



Graph Theory for Systemic Risk Models

Graph Theory for Systemic Risk Models

The markets around the world are highly connected. The risk that the entire financial system crashes as a result of the failure of one or more entities is called systemic risk. The 2008 Financial Crisis demonstrated first hand how reliant banks are on one another and how interconnected the financial markets are. When credit derivative portfolios suffered this triggered margin calls on US banks which forced them to deleverage in order to raise capital. This deleveraging caused the stock market to collapse and yet more margin calls to be triggered. In the end Lehman Brothers was forced to file for bankruptcy and many other smaller banks were taken over.

A serious question for the 21st century should be "how can we measure and mitigate systemic risk in the financial system". In my opinion regulation won't work, the only way to do this is by rewarding transparency and using more sophisticated models which are based on considerably more market and firm data.

Banking Systemic Risk

Banking crises are not new, so much so that Wikipedia has a page which just lists historical banking crises. Yet the study of systemic risk is still relatively new. One of the more promising avenues of systemic risk modelling involves the application of networks, also known as graph data-structures by my fellow computer scientists. In the year 2000, Franklin Allen and Douglas Gale wrote a popular paper, 'Financial Contagion', which demonstrated the effect that network structures can have on the stability or fragility of financial networks.

In banking, systemic risk is the risk that the failure of one bank could cause other banks to fail. This risk stems from the direct and indirect links between banks. Indirect links are caused by holding similar portfolios of investments or sharing the same base of depositors this is a form of concentration risk. Direct links are caused by exposures in the interbank market which is the market which allows banks to do business with each other.

Systemic risk is introduced into the network through transactions. For example if one bank allows another bank to trade on margin the systemic risk posed by the bank trading on margin increases. That said, transactions can also stabilize the financial system through the distribution of risk. Using graph theory I believe it would be possible to construct a model of systemic risk and potentially optimize the financial system to reduce systemic risk. 

This quote, taken from a speech given by the vice chairperson of the board of governors of the federal reserve system, Janet L. Yellen, entitled 'Interconnectedness and Systemic Risk: Lessons from the Financial Crisis and Policy Implications', sums up my sentiment regarding the ineffectiveness of traditional models quite nicely:

Today, our capability to monitor and model financial outcomes is vastly greater, and the tools available to the Federal Reserve are vastly more powerful, than the private capital and moral suasion that financier J. P. Morgan summoned in 1907 to stabilize the banks and trusts. But as we learned during the recent crisis, the financial system has also grown much larger and more complex, and our efforts to understand and influence it have, at best, only kept pace. - J.L. Yellen

Graph theory

A graph / network is a collection of nodes and the arcs that connect those nodes to one another. In the context of banking, each node represents a different bank and each arc represents some link between two banks. These links could represent direct or indirect links. Networks are thus very dynamic data structures with few structural limitations. For this reason they are a useful representation of the banking industry. 

Networks are further divided between directed and undirected networks. In a directed network, arcs between nodes stipulate the 'direction' of their application e.g. Bank A is exposed to bank B, however bank B is not exposed to bank A. Many algorithms exist for identifying shortest paths and clusters in networks, but few algorithms exist for optimizing the network structure so that it is more stable and resilient to shocks.  

Network-based computational model of systemic risk

This network-based computational model illustrates a number of fictitious links between large US banks. These links are directional and, as in reality, there exist multiple types of links. In the appendix of this post I discuss how one goes about creating such a model.

Such a graph could be constructed by making available information about the dealings of banks on the interbank market both locally and internationally. This information would not need to be publicly available but could simply be provided to a regulatory body capable of systemic risk modelling. Once the model has been constructed and the sensitivities of the transactions to external stimuli such as equity returns and interest rates have been calculated it would be possible to test different economic scenarios using simulation methods such as agent based models.

If one bank were to fail in the scenario, the impacts on the other banks balance sheets and liquidity could be computed directly. In this was one could model the spread (contagion) of systemic risk through the system,

A network-based computational model of systemic risk

Conceptual view of a network-based computational model of systemic risk. In this diagram each circle represents a bank. The colour of the circle represents a bank which has been highly impacted by either some external factor (initial conditions) or by other linked banks. The spreading of the financial shock through the system is called contagion. How the network is structured significantly impacts how the contagion spreads. In some, optimal, networks risk is shared across all banks whilst in other, sub-optimal, networks, risk compounds causing the system to collapse.

A computational model of systemic risk

Previous studies show that highly interconnected networks are more stable. To test this theory I created a computational model of an interbank network consisting of fifty banks. A random number was uniformly generated between 50 and 2500. This represents the network size i.e. the number of connections in the network. When equal to 50, each bank was connected to just one other bank. When equal 2500, each was theoretically connected to every other bank in the network. Lastly, the connections were made between randomly selected banks.

Once the interbank network was created, a 'market shock' was simulated. This shock spread through the network like a financial contagion, and decreased proportionately to the number of neighbours connected to each bank as it traveled through the network. Each bank recorded the total shock it received during the simulation. After each simulation the maximum, minimum, and average total shocks were calculated across the banks in the network. Lastly, a script was created to run one million of these simulations. 

To help visualize trends, the graphs below have been smoothed. From these graphs we can see that increased network sizes positively correlate with the overall stability of the network. After a certain threshold network size, the stability of the network either remains constant or deteriorates slightly. This is an intuitive result, because at this point the network is fully connected and systemic risk can be distributed through the network.

Click on the images to enlarge them

Generic Python code for graphs is shown below,

And the exact code used for the interbank network is shown below,

Lastly the main method used to produce the results is shown below,

Next Steps

The above example is obviously quite trivial and does not come close to replicating the realistic conditions and constraints of the financial system. A better model should take into consideration the following,

  • Different types of inter-bank connections - the model should be able to distinguish between different types of transactions taken between the banks including, but not limited to, deposits, loans, and trades. Different types of transactions may offset vs. increase systemic risk.
  • Different types of banks - there are different types of banks and firms which use the interbank network with different characteristics. These include retail banks, commercial banks, investment banks, and even some of the largest hedge funds in the world. Another form are so called shadow banks.
  • Geographic constraints - overseas connections between banks can result in complex geographic and regulatory constraints which should be factored into the model.
  • Indirect connections - the model should cater for indirect connections caused by holding similar investment portfolios and sharing the same depositor base.
  • Leveraged positions & Margin Calls - leverage is the use of borrowed capital for investments. Banks often enter levered positions using funds borrowed from other banks.
  • Sensitivity - sensitivities of repayments based on equity returns and changes in long and short term interest rates should be factored in. These could be modeled using stochastic processes.

Furthermore, using a network stabilization algorithm it would be possible to optimize an existing network structure such that systemic risk is reduced. Lastly, the greatest hurdle of any network-based computational model of systemic risk, is the availability of real world data as the financial services industry is notoriously secretive.


A network-based computational model of systemic risk, would make it easier to study complex network effects such as financial contagion. This model could also be used in conjunction with a network stabilization algorithm to monitor and mitigate systemic risk in interbank networks. As a result, a banks position within the network could in the future become a source of competitive advantage. In this case banks might pro-actively seek connections to strategically located banks. Lastly, a network perspective of the interbank market could help guide central banks to design new and improved financial regulations that incentivize systemic risk reduction.


  1. Stuart,
    Hello. This is a nice idea, that is widely explored at present time (try googling systemic risk and network). As I told you, I am working on this area actually, form a CVA point of view. Mathematically, you could find this Rama Cont paper, and ref therein, interesting :

    Hope this helps

  2. Duygu

    Hi Stuart,
    this is a great article. It's very informative. But I couldn't understand the sensitivity part in the "Next Steps" section. Could you explain it more?


Submit a Comment