The spread of a financial virus through Europe and beyond

We analyse the importance of international relations between countries on the financial stability. The contagion effect in the network is tested by implementing an epidemiological model, comprising a number of European countries and using bilateral data on foreign claims between them. Banking statistics of consolidated foreign claims on ultimate risk bases, obtained from the Banks of International Settlements, allow us to measure the exposure of contagion spreading from a particular country to the other national banking systems. We show that the financial system of some countries, experiencing the debt crisis, is a source of global systemic risk because they threaten the stability of a larger system, being a global threat to the intoxication of the world economy and resulting in what we call a `financial virus'. Illustrative simulations were done in the NetLogo multi-agent programmable modelling environment and in MATLAB.


Introduction
The global crisis of 2008 had the most devastating consequences in the world economy [1]. One of the main causes for the beginning and aggravation of the crisis was the strengthening of international economic interdependence. Primarily, the crisis hit the financial system and the debtor countries. As a result, systemic financial risks occurred, and the crisis spread to other countries. The global financial system is a kind of configuration of numerous interrelations between national economies, and every day the world economy becomes more like a unified space with a network nature. Failure of one subject of the financial system generates a chain reaction through interconnections and causes shocks and systemic risk. This risk is associated with the incapability of 87 one of the participants to perform their obligations (or to accomplish them properly), which leads to the interruption in the functioning of other participants and, thus, of the entire system. The Bank for International Settlements (BIS) provides the following definition of systemic financial risks: "the risk that the failure of a participant to meet its contractual obligations may in turn cause other participants to default, with the chain reaction leading to broader financial difficulties" [2]. Therefore, the systemic risk is the likelihood of negative changes in the financial system and the economy of a particular country that affect the financial stability of the global market [3,4].
Crises continue to occur at different economic levels, both at micro and macro levels [5], which make the economy an interesting object of study. The interest of scientists to this field is increasing after some collapse in the economy. The contribution of scientists in the study of the world economy is huge and has increased rapidly over the past decade. In [6], the authors investigated contagion between international equity markets using the local correlation. The contagion effects among the stock markets were investigated in [7] using the asymmetric dynamic conditional correlation dynamics. Authors in [8] investigated Corporate Default Swap spreads using the vector autoregressive regression with correlation networks in their model. Also, one of the interesting types of research in this area is the work [9], where the authors studied information contagion due to the counterparty risk and examined its effects on banks ex-ante choices and systemic risk.
Mathematical epidemiology is widely developed, as described in [10], and has wide application in various fields of science [11,12,13,14,15]. However, the use of epidemiological models in the economy is scanty and the economy has not been studied yet completely. Thus, the economy needs to be investigated in order to prevent possible negative consequences, since the systemic risks accumulate in the world financial system and become a general threat to the new global crisis [16]. The study of the systemic financial risks allows to characterize comprehensively the current picture of the global financial world, and also to develop new methods of protection against global threats. The significance of global systemic financial risks is increased by their complexity in the identification, estimation, and developing methods for their calculation and minimization [17].
A key feature of global systemic financial risks is the potential infection of the world economy with a financial virus [18]. For example, if some European Union countries are a source of global systemic risk, as they experience a debt crisis, then they threaten the stability of a larger system, which is a global threat. For this reason, it is necessary to study the spread of financial viruses in the world economic network. The complex study of country interrelations shows which national banking systems are most exposed to a particular country, both on an immediate counterparty basis and on an ultimate risk basis [17]. Our research focuses on total foreign claims on an ultimate risk basis, which captures lending to a borrower in any country that is guaranteed by an entity that resides in the counterparty country. The object of study is the process of infection spreading through network interconnections. Moreover, we investigate economic relations between the subjects of the global financial system, which arise in the process of managing systemic financial risks. The aim is to study the process of spreading the infection through network interconnections, identify regularities, and whenever possible give recommendations for minimization risks in global scale management.
The scientific novelty of our study consists in modelling and investigating the process of contagion in the network using epidemiological models. The research was done with statistical data from BIS [19] on the volumes of consolidated foreign claims on ultimate risk bases in a number of countries, and data of countries credit rating from the Guardian Datablog [20].
The paper is structured as follows. In Section 2 of "Methodology", the basic concepts of network and epidemiological models are introduced as well as the data used for the considered models. The results of modelling and various scenarios of contagion spreading are presented in Section 3 of "Results". We end our work with Section 4 of "Conclusions".

Methodology
Based on the network nature of the global economy, described above, the systemic risk can be considered as a network risk, which causes infection of networks.
Our method for investigating the spread of a virus in the financial system consists of six steps: 1) to build the network; 2) to define the virus transmitting rate and recovery rate; 3) to visualise the process of virus transmission in the network by implementing a multi-agent programmable modelling environment in NetLogo [21]; 4) to run the spreading process in a closed population by solving the Kermack-McKendrick SIR model [22] in the multi-paradigm numerical computing environment MATLAB [23]; 5) to compare results between dynamics of infection in the network and dynamics obtained by solving the SIR system of differential equations; 6) to confirm or disprove the economic reasonableness of the results.

Network
Network analysis is well used in various fields of science [24]: in computer science, to describe the internet topology [25]; in social sciences, to describe the evolution and spread of ideas and innovations in societies [26]; in ecology, to model networks of ecological interactions [27]; in biology, to investigate the neurovascular structure of the human brain [28]; in biochemistry, to infer how selection acts on metabolic pathways [29,30]; as well as in economics, to study financial contagion in the banking system [18,31].
Many mechanisms and quantitative tools for describing networks have been provided by research in graph theory. Networks are mathematically described as graphs. There are different types of graphs: random graphs, small-world graphs, scale-free graphs, and others.
A network consists of multiple nodes connected to each other. In this research we construct a fully connected network, which includes n nodes. This network is also known as a complete graph, denoted by K n . The complete graph is a regular graph, where each vertex has the same degree n − 1, and K n always has n(n − 1)/2 links. It means that all nodes are interconnected, i.e., each vertex has the same number of neighbours.
In graph theory, a finite graph is often represented as an adjacency matrix: where elements a i j equal to zero or one, respectively for disconnected and connected vertices. Such matrix is the basis for network building. A network construction provides a good visualization of its structure, knowledge and understanding, which allows us to compute the epidemic dynamics and to predict a spreading phenomena.

Epidemiological model
The epidemic spreading can be described by many models. Epidemiological models, in their majority, are based on dividing the population according to the disease status of their individuals. The main models describe the proportion of population that is infected, susceptible to infection, and recovered after a disease [32].
In our study, we use the classical Kermack-McKendrick SIR model [22], which considers such factors as infection spreading and recovery [33]: 3) The SIR model (2.2)-(2.3) expresses the spread among the population compartments as a system of differential equations, where S , I and R refer to the number of susceptible, infectious and recovered individuals, respectively, in a constant population of N individuals for all time t: System (2.2) describes the relationship between the three compartments: a susceptible individual changes its state to infected with probability β (the contagion spreading rate), while an infected changes its state to recovered with probability γ (the speed of recovery). These parameters are assumed constant for the entire sample.

Data
Sixteen European and Non-European developed countries were chosen based on statistical data from the Bank for International Settlements (BIS) for the end of the year 2012 [19]. The number of countries N = 16 is fixed throughout the contamination time. They connected to the network (see Figure 1) according to the adjacency matrix (2.1) as follows: where the elements a i j are equal to one for connected vertices, and zero for disconnected. The connection is provided by the presence of bilateral foreign claims on an ultimate risks basis. The diagonal elements are all zero, since loops are not determined by statistical data of amounts outstanding from BIS [19]. In our work, we assume that only one country is contagious at the initial time. Thus, the values of initial conditions (2.3) for the SIR model are as follows: S (0) = 15, I(0) = 1, and R(0) = 0.
We also assume that the initially infected country I cannot fulfil all of its obligations to other countries (for example, by domestic reasons). This means that all foreign claims α i j of a counterparty country i are infected. A contribution of infected debts to the total amount of claims from all countries, defines the value of β parameter: (2.6) The values of the infection spreading rate β i ∈ [0, 1] and 16 i=1 β i = 1 or 100%. Thus, the more outstanding debts in the total amount of debts, imply the higher possibility of infection. Statistical information was taken from the BIS consolidated international banking statistics on an ultimate risk basis [19]. It is the most appropriate source for measuring the aggregate exposures of a banking system to a given country [34].
The recovery rate was calculated according to country's credit rating: Here, γ i implies that it takes 1 γ i = 101 − C i time steps to recover. The credit rating C i takes into account not only countries' debt, but also assets. This measures the ability to fulfil their obligations as borrowers -the probability of recovery. The data of countries' credit rating is taken from the Guardian Datablog [20] and converted by ourselves to the numerical representation based on the rating table from [35], where the credit rating is shown by country's credit worthiness between 100 (riskless) and 0 (likely to default). Thus, a susceptible country S can obtain contagion if it has a relationship with an infected country I, and if it has not enough money in reserve to cover possible risk losses.
The values of contagion spreading rate and the speed of recovery are given in Figure 2.

Results
We now present the obtained results. For comparison, all countries are grouped according to the value of the recovery parameter γ (see Table 1). We compare the results depending on the belonging of the initially infected country to a particular group. For illustrative purposes, we consider the dynamics of the chain propagation reaction for three cases: when the contagion process starts 1) from Portugal (PT, Group 1); 2) from United States (US, Group 2); and 3) from Switzerland (CH, Group 3). Both network and SIR model simulation results are consistent.

Network
To investigate the dynamics of infection spread in the network, we use the NetLogo agent-based programming language and integrated modelling environment [21]. It is well-recognized that its visualization makes it easy to understand chain reaction processes [36]. Figure 3 demonstrates the spread of the financial virus through the network, where each node represents a random country from the considered list represented in Figure 2. At the initial moment, all nodes are susceptible (white colour) except one infected node (black colour). In each time step ("days"), the "nodes" check whether they have an infection, and an infected node attempts to infect all of its neighbours. "Days" is an arbitrary unit during which the "nodes" check and change their status. If an infection has been detected, then there is a probability of β that susceptible neighbours will get an infection and change their colour to black, and there is a probability γ that an infection will be removed and the nodes will be recovered. Recovered nodes (grey colour) cannot be infected. When a node becomes recovered, the links between it and its neighbours are darkened, since they are no longer possible vectors for contagion spreading [36]. It is important to notice that, in reality, the country's financial system cannot recover evermore. Therefore, applying this model, we consider that recovered countries are resistant for some short period of time, and then they again become susceptible to the virus. For the case where the infection begins from Portugal (Figures 3(a)-3(f)), the first infected node (Figure 3(a)) spreads the virus to one of its neighbours at time T = 9 (Figure 3(b)). At time T = 15 (Figure 3(c)) the contagion process slowly continues, and the last infected node (Figure 3(e)) changes its state to recovered at time T = 281 (Figure 3(f)).
It is easy to see that the chain reaction of infection and recovery of nodes occurs much faster when it starts from United States of America (Figures 3(g)-3(l)). The initially infected node (Figure 3(g)) spreads the infection to neighbouring nodes in the next time step T = 1 (Figure 3(h)). The maximum number of infected nodes is reached at time T = 2 (Figure 3(i)). At time T = 5 (Figure 3(j)) most of the infected nodes have already been recovered and the last infected node (Figure 3(k)) changed its state to recovered at time T = 15 (Figure 3(l)).
In the case when Switzerland is initially infected, the virus is not transmitted to the neighbours and the infected node is immediately recovered (Figures 3(m)-3(n)).

Epidemiological SIR model
The initial value problem (2.2)-(2.3) can be solved using a numerical approach. In practice, the solution can be obtained in the form of a time-series function of each compartment. In our work we solve the system of differential equations in MATLAB. The obtained results are consistent with those that were obtained with the network simulations.
The behaviour of the epidemiological model for Portugal, United States of America, and Switzerland parameters, are shown in Figure 4. When infection spreading begins from Portugal (Figure 4(a)), contagion has almost reached the contagion-free equilibrium (I(T ) = 0) after 281 time steps. The spread of contagion occurs over a long period of time and the recovery process goes slowly too. If the United States is the starting point for virus spreading (Figure 4(b)), the contagion spreads rapidly and affects a large number of countries in a short period of time, and then swiftly decreases as the recovery process takes fast. If the initially infected country is Switzerland, the virus immediately dies out (Figure 4(c)).   The results in Figure 4 coincide with those that were obtained earlier in Figure 3. It means that both methods of modelling of contagion spreading are in agreement with each other.  show that the contagion spreading processes take place in different ways, depending on the country where it begins. The countries that are in Group 3 of Table 1 have the highest recovery rate. Within a short period of time, the infected will recover (Figure 4(c) and Figure 5(i)-5(m)). If the infection begins from a country listed in Group 2 of Table 1, then the contagion ceases to spread and all infected become recovered after 10 to 25 time steps (Figure 4(b) and Figure 5(g)-5(h)). The situation is completely opposite for the countries in Group 1 of Table 1. For them, the virus infect the highest number of countries and takes much more time, and the recovery process is slower too (Figure 4(a) and Figure 5(a)-5(f)).
The reason for the identified differences lies in the different economic state of the country where contagion begins, especially in the adequacy of country's reserve capital. If a country has a big reserve capital and, consequently, a high credit rating position, then a high recovery rate indicates its ability to cover possible risks in the shortest time period. The situation is completely opposite for countries with low recovery rate. If any of these countries will be forced to fulfil their obligations, it will be difficult for their economies and, therefore, the recovery process will take longer.

Conclusions
The recent global crisis of 2008 placed the economic analysis as one of the most relevant political and social concerns of the most indebted countries. Here we considered some of the western countries in these conditions. Precisely, we investigated and modelled the process of contagion spreading in a global inter-country network, revealing the degree of interconnection of national financial systems, identifying the potential systemic financial risks and their effects. Our research was done with real data from the Bank of International Settlements on the volumes of consolidated foreign claims on ultimate risk bases in several countries, and data of credit rating from the Guardian Datablog [20]. The dynamics of infection spreading of a virus in the financial system on the given network of countries was simulated with NetLogo, an agent-based programming language, and integrated modelling environment, and confirmed by an epidemiological SIR model. The infection process was shown to depend on the parameter value of the recovery rate, as well as on the country, which initially begins the process of infection. We found out that if one of the financially unstable countries will be the starting point in the spread of contagion, and will be forced to fulfil its obligations as a counterparty, then the global financial system will have serious problems, the negative effects of which will continue during a long period of time. Therefore, the countries with a powerful economy and good credit rating position are more reliable counterparties, since if necessary they will be able to fulfil their obligations.
According to the standard SIR methodology, both parameters β and γ are constant for the entire sample. However, in reality, these data are unique for each country and depend on the infection force of the affected country and the financial stability of the susceptible. Another line of research, motivated by the fact that the level of exposure and interference between countries and financial institutions is not the same, consists to consider a more realistic representation as a graph with varying edge weights. These and other issues are under investigation and will be addressed elsewhere.