key: cord-0483911-mrvy6eup authors: Rigana, Katerina; Wit, Ernst-Jan Camiel; Cook, Samantha title: Using Network-based Causal Inference to Detect the Sources of Contagion in the Currency Market date: 2021-12-24 journal: nan DOI: nan sha: 7227ae2e59707072047ece0623b69ab3efbd23c1 doc_id: 483911 cord_uid: mrvy6eup Contagion is an extremely important topic in finance. Contagion is at the core of most major financial crises, in particular the 2008 financial crisis. Although various approaches to quantifying contagion have been proposed, many of them lack a causal interpretation. We will present a new measure for contagion among individual currencies within the Foreign exchange market and show how the paths of contagion work within the Forex using causal inference. This approach will allow us to pinpoint sources of contagion and to find which currencies offer good options for diversification and which are more susceptible to systemic risk, ultimately resulting in feedback on the level of global systemic risk. The global economy continues to be more and more integrated and interconnected. This presents enormous opportunities for growth and innovation, as well as new types of risks. In order to see how resilient financial networks are to contagion, financial regulators need to understand how contagion propagates and where the sources of contagion reside (Stiglitz, 2010) . There are various ways to define financial contagion. The first descriptions of contagion are predominantly in terms of what today we would call behavioural finance -in terms of sentiments, emotions, behavioural biases and crowd effects (Hansen, 2021) . Modern research into contagion within the academic literature began to appear in the wake of the 1987 market crash and exploded during the 1995 Mexican crisis, the 1997 Asian financial crisis and the related 1998 Russian financial crisis that followed. The main goal was to explain how a series of potentially local issues could spread from country to country, creating a financial crisis with global repercussions (Edwards, 2000; Claessens and Forbes, 2013) . These events caught many economists off guard and so most papers during this period concentrate on explaining (Edwards, 2000; Calvo and Reinhart, 1996) , or explaining away (Forbes and Rigobon, 2002; Collins and Biekpe, 2003; Karolyi, 2004) , this new market behaviour. Most of the definitions of contagion during the period define it as shocks or correlations that are unexplained or unexpected or significantly higher than usual, in contrast to expected and explainable changes and correlations, called spillovers and interdependence (Rigobon, 2019) . The 2007-2008 financial crisis rekindled interest into analysing contagion. This time around there has been less research into whether contagion exists and more into how to estimate and model it properly to be ready for future crises. During this period we see the appearance of network theory applications that set the tone for future research (Nier et al., 2007; Gai et al., 2011; Elliott et al., 2014; Glasserman and Young, 2015; Soramäki and Cook, 2016; Battiston and Martinez-Jaramillo, 2018) . There have been various approaches to contagion estimation: the copula approach (Rodriguez, 2007; Wen et al., 2012) ; the vector moving average and variance decomposition, related to the Impulse response modelling (Diebold and Yılmaz, 2014; Barigozzi and Hallin, 2017 ; Barigozzi et al., 2020) ; and new approaches of GARCH estimation to structural mod-els (Dahlhaus and Eichler, 2003; Eichler, 2007; Giudici and Parisi, 2018; Avdjiev et al., 2019) . Each of these methods has its own advantages but they lack an intervention-based causality interpretation. Traditionally when it comes to causality economists have relied on the Granger Causality concept (Stavroglou et al., 2017) , but this concept merely relies on temporal correlations rather then structural causation (Sugihara et al., 2012) . We will analyse contagion through changes in price due to factors spreading from instrument to instrument that cannot be explained by individual trends. This type of contagion can be interpreted as "pure contagion" defined by Van Rijckeghem and Weder (2001) . Combining causal networks with a structural Vector Autoregression (VAR) model, we are able to extract from the log returns of the exchange rates which part of a change in the value of a currency is caused by the idiosyncratic characteristics of the currency and which part is caused by contemporaneous contagion effects from other currencies. The structural VAR part of our approach is an extension of Giudici and Parisi (2018) . Similar VAR approaches have been used to analyse systemic risk within the foreign exchange market; none, however, look at the causal direction of such effects. In order to analyse the contagion paths in the foreign exchange market, we will recreate directed partial correlation based networks using the causality concepts from Pearl (2009) extended into practical methods by Spirtes and Glymour (1991) and Colombo and Maathuis (2014) . The rest of this paper is organized as follows. In Section 2, we first explain basic concepts of network theory and causal inference and then describe how we estimate contagion using Causal Graphical models within a structural VAR model. In Section 3 we analyse contagion within a subset of currencies on the Forex during the years 2000-2021; and we conclude in Section 4 by summarising the main advantages of this approach to measuring contagion in finance, while noting the remaining challenges. Our measure of contagion within a network relies on causal graphical model theory. In this section we will introduce the main underlying concepts and notation. A network is a collection or system of interconnected objects such as things, people or groups of people (like institutions or countries, for example). In mathematics these interconnections are represented as graphs, defined as a set of nodes or vertices that are connected by links or edges. In this work we will analyse directed networks by estimating causal links that are not directly observed between financial instruments or assets. Such networks are called causal networks, a specific type of a graphical model (also often called Bayesian or belief networks). These networks incorporate probabilistic relationships between the nodes in the form of a Directed Acyclic Graph or DAG (Howard and Matheson, 1981; Pearl, 1988) . Bayesian networks can be analysed using several different types of algorithms. There are the so-called constraint-based algorithms that look for conditional independence (Colombo and Maathuis, 2014) and the main algorithm of this group, the PC-algorithm (Spirtes and Glymour, 1991) , is the one we will use in Section 2.3. The other type of algorithms are the so-called score-based algorithms, which maximise a causal objective function. A comparison between these methods in terms of speed and accuracy can be found in Scutari et al. (2018) . Importantly, they find that "constraint-based algorithms are more accurate than score-based algorithms for small sample sizes." Here we present the mathematics underlying causal graphical models. We consider N assets that we want to analyse and their log returns are represented as the multivariate random variable X = (X 1 , . . . , X N ). Each of these N assets will represent a node in our network. We can analyse X as a directed graphical model (GM) represented by a causal DAG. The arrows in the network G X are to be interpreted in terms of conditional independence (CI) with the additional causal interpretation. A DAG G X is causal for a probability distribution f (x) if f (x) recursively factorizes with respect to G X and the following intervention formula holds for all subsets A in V , the set of all nodes: is the distribution of X under the knowledge that a subset A of the nodes V in the network have been imposed a value x * A . An example of this could be when a central bank decides to fix its exchange rate with respect to another currency and we want to see the impact on the other currencies in the market. The conditional distributions f (x α |X pa(α) ) are assumed stable under interventions that do not involve x α -hence the condition that α represent nodes in V but not in in the intervention subset A. This conditioning by intervention allows for much more specific causal interpretation than the conditional distribution. The random variable of interest X is a causal GM if it is a directed GM, as described above, such that the intervention factorization in Equation 1 holds. This definition is often referred to as the Lauritzen's causal graph with interventions by replacement (Lauritzen, 2001) or as Pearl's do-intervention (Pearl, 2009 ). In this section we will present a network-based measure for contagion. It is based on the causal graph models presented in the previous section, combined with an autoregressive approach to contagion as described in Giudici and Parisi (2018) . Giudici and Parisi (2018) introduce a structural vector autoregression (VAR) to analyse the contagion impact on the the cost of insuring public debt during the European sovereign debt crisis. We propose a structural equation model for the evolution of the log returns X it on a financial asset i at time t through a structural VAR consisting of an autoregressive part AR(i, t) and a network contagion part that we will call N ECO(i, t): Assets that affect asset i where are the number of considered lags for the autoregressive part, α i are the autoregressive coefficients at lag for asset i and β ji the causal effects of asset j on asset i or X j on X i . In the causal literature, the causal effects are defined as the partial derivative of the expected log-return d dx j E(X i,t |X −i,t , X i,t− ) which in our case is equal to β ji . Just like we do for the autoregressive part, lags can be added to the NECO part. We leave this extension for future research. The arrow in Equation 2 is to be interpreted in a generative manner, such as in a structural equation model (Bollen and Pearl, 2013) . The right-hand side is the driving force behind the value of X it . Equation 2 can be summarised as: where the N ECO it measures the totality of the contagion effect on the market. As a measure of the impact of contagion on the price of an individual asset, we propose the Network Contagion Factor (NECOF), which is computed as follows: , under the assumption that AR it , NECO it and ε it are independent. This independence assumption is realistic, given that the considered contagion is assumed to be instantaneous and therefore by definition isolated from the idiosyncratic effects AR it . The NECOF is expressed in percentages and shows the impact of contagion on the return of the asset i. A NECOF of 0% would mean that contagion has no impact on the considered asset. On the opposite end of the spectrum, a NECOF of 100% would indicate that the impact of contagion for the given asset is absolute. The NECOF measure alone is very useful to identify which assets are at higher risk of outside influence -information that can be useful for investment and diversification strategies alike. We call the NECO a networkbased measure because it depends on the underlying causal graph. This section shows how the causal networks and causal NECO coefficients β ji in Equation 2 are estimated. Once we estimate the NECO coefficients and the NECOF we can recover the contagion factor for each instrument. In order to estimate the causal coefficients correctly, we first need to establish the causal structure, which means finding all the causal parents for every considered asset i in our graph. We estimate the causal structure using a more robust version of the standard PCalgorithm from Spirtes and Glymour (1991) called the PC-stable algorithm (Colombo and Maathuis, 2014) 1 . The PC-Algorithm uses two steps in order to find the sources of contagion, which are summarised in Appendix A. We add a third step to estimate the size of the contagion effects, β ji , by performing a series of linear regressions on Equation 4. Given the set of parents for each asset, the non-zero β ji are to be estimated from the obtained DAG. If at the end of Step 2 we achieve a Completed Partially Directed Acyclic Graph (CPDAG), a subset of Markov equivalent DAGs that can explain our data, we will also find a multiset of possible NECO estimatesβ ij . We can combine these into a range estimator as in Maathuis et al. (2009) . Once we have estimated the NECO we can estimate the NECOF of interest for each instrument in our model using the following equation: that we obtain by applying the Type II 2 Sums of Squares to Equation 3 such that: Using the contagion paths established in the previous section we can identify communities of financial instruments. These communities are groups of nodes that are more connected among themselves within the group then with the other groups. These groups are called communities, clusters or modules. Communities can be seen as sub-graphs that have specific properties not shared by the whole network and this allows for a next-level analysis of the network, moving from a single node to a more meaningful structure. These communities can be also seen as meta-nodes when representing and analysing very large networks, where considering and plotting each singular node would not be practically feasible. There are many different algorithms to identify communities within a network; for a comparative study see Lancichinetti and Fortunato (2009) . We will be using the Louvain algorithm from Blondel et al. (2008) to establish communities among the nodes, because it a benchmark among the clustering algorithm thanks to its robust and efficient results, making the results easier to compare with other studies. 1 We perform the PC-Algorithm using the pcalg package in R as described in Kalisch et al. (2020) 2 Similar to Type I but not dependent on the order of entry of terms into the model (Yandell, 1997) . In the previous sections we defined a measurement of the contagion and the sources of this contagion, assuming that the NECO and its coefficients would remain constant for the entire time period in consideration. In this section we will add a dynamic component, and in doing so not only allow for the AR(i, t) and NECO(i, t) in Equation 2 to change with time but also for the whole causal structure of our contagion graph to change with time. A dynamic version of (2) is written as, describing a dynamic causal graphical model. From an inferential point of view, we will estimate the coefficients in a piecewise-constant way. At each timepoint t we evaluate a new DAG and the associated NECOF estimates, creating a sequence of contagion maps. The contagion effect is considered to be contemporaneous within the considered window of time The length of the window will vary with the use case and depends on the data being analysed, what kind of short or long term trends are associated and the purpose of the study. The Forex is an important financial market, trading $6.6 trillion per day (Bank of international Settlement, 2019). Given that the most traded exchange rates are those over the USD we consider the interaction of 23 exchange rates over the USD for the years 2000-2021 as published daily by the Federal Reserve of New York. This allows us to evaluate the networks among highly traded currencies by expressing their value in terms of the US Dollar, the most liquid of all currencies, based on reliable historic data. Alternative approaches include using exchange rates based on the special drawing right (SDR) as in Wang et al. (2012) . SDR reflects the price of a basket of five major currencies and is periodically rebalance and published on a daily basis by the International Monetary Fund (IMF). Another option for the base currency is to choose a currency that is of lesser importance, but still not completely illiquid. An example of this approach can be found in Keskin et al. (2011) who use the Turkish Lira as a base. A comparison of different currencies being used as the base currency can be found in Kwapień et al. (2009) . One final approach taken by Fenn et al. (2012) is that of ignoring the base currency issue altogether and using each exchange rate as a separate financial asset. We consider the log returns on the spot exchange rates. The distribution of log-returns on the exchange rates is often assumed normal, but as with most financial assets there is the presence of fat tails. Johnston and Scott (1999) analyse this problem, without finding any better alternative that would hold for every currency and time frame. Some studies even find that trading strategies based on the assumption of log-normality do in fact maximise profit (Sarpong, 2019) . The presence of fat tails will cause the significance level for the individual conditional independence tests within the PC-Algorithm to be empirical slightly higher than the nominal value. This section will present results of applying the methods from Section 2 to the Forex returns data described above. Figure 2 We estimate our model with a time window of one year (250 business days), rolled over every three months. This allows us to analyse the development of contagion on the Forex from a macro-economic point of view. For each contagion map, we estimate the NECOF at each time period. Figure 3(a) shows the evolution of the mean NECOF over time. The contagion rises sharply at the beginning of the 2000s, and then oscillates between 20% and 35%. The rise at the beginning is caused by some of the currencies that were formerly pegged to the USD becoming more free and hence more connected to the other currencies on the Forex. This initial rise is interrupted by a peak around sovereign debt crises of low and middle-income countries that began in 2002 as defined by Laeven and Valencia (2018) . period is driven by the many currencies that were pegged to the USD during the 2000s, whose exchange rates over the USD remained nearly constant. If a currency does not show any variation it will by definition be counted as its own cluster, hence increasing the overall number of clusters detected. As the currencies became more freely traded, in a similar way as the market NECOF rose, so did the number of clusters drop. This clustering effect during a crisis has been reported in many studies on the Forex topology (Wang et al., 2012; Keskin et al., 2011; Kwapień et al., 2009; Wang et al., 2014) . Figure 3 suggest a tendency for the Forex market participants to cluster during a crisis (and so the number of clusters goes down) and for the market contagion to increase. From the previous section we know that there seems to be a tendency for the clustering to increase during a period of economic upheaval. In this section we will examine this dynamic in more detail. In Figure 4 we show the evolution of the clustering through the 21 years of data. The structure of these clusterplots is similar to that of an adjacency matrix and shows the rows and columns labelled by the different currencies. Instead of showing links or link weights, however the matrix shows how often pairs of currencies belong to the same cluster. The more often two currencies are assigned to the same community by the Louvain algorithm during the specified time frame, the darker and larger the dot connecting the pair gets. If the dot connecting two currencies is a solid dark blue, it means that the pair of currencies were within the same cluster 100% of the time within the considered period. The only pair that shows such perfect 100% connection is the Euro (EUR) with the Danish Krone (DKK). Empty cells indicate that the corresponding currencies were never placed in the same cluster within the specified time period The classically assumed geographically based clusters can be roughly identified within these clusterplots -but the structure is not so obvious and, more importantly, it changes in reaction to economic events. The main clusters can be roughly divided into a European cluster, an Commonwealth cluster, an Emerging Economies cluster and finally an Asian cluster. Within the European clusters we have some clear oddities. The British Pound (GBP) switches between the European cluster and the Commonwealth cluster. The Japanese Yen (JPY) is often more connected to the European cluster and specifically the Swiss Franc (CHF), especially so during a crisis. The behaviour of CHF and JPY during a financial crisis is very interesting and will be described in more depth in Section 3.2.3. As mentioned in Section 3.2.1 most studies find higher clustering during a crisis. However, from Figure 3 we know that the number of clusters did not go down immediately during the During the crisis several of the Asian currencies find more connection with currencies outside of the Asian cluster. The Chinese Yuan Renminbi (CNY), for example, interacts much more with other currencies than in the previous periods. Also, interesting is the behaviour of the Swiss Franc (CHF) during this crisis -it completely leaves the Euro-centred community and has only connections with Asian currencies, probably due to its traditional role of a safe-haven currency (Henderson, 2006; De Bock and de Carvalho Filho, 2015; Jäggi et al., 2019) . The period from March 2016 until February 2020 is a period of relative calm, and the clustering resembles the first plot of similar calm, apart of course from the European cluster. One other interesting mention is the Japanese Yen (JPY) that finally moves away from the Asian cluster almost completely. In March 2020 the Covid Pandemic becomes a global crisis, and the Covid Recession officially starts. We see from Figure 3 that the market contagion increased immediately at the beginning of the pandemic, but the number of clusters did not change very much. What changed, as in the previous crisis, is the redistribution of the currencies within the clusters themselves -but in a different and more dramatic fashion. Figure 5 shows this redistribution. The network is much more compact and in fact the density does sharply go down, i.e. the network has fewer links. This means we have new clustering with a lower number of links, but more significant links that lead to a much higher contagion on the markets. The CNY and the INR join the European cluster, whereas the GBP, SEK and NOK move together to join the Commonwealth cluster. That the impact of the Covid Pandemic on the contagion map and clustering within the Forex would be somewhat different from the previous financial crisis was to be expected -even the markets reacted very differently. The stock markets fell faster than ever before 3 and the impact of the Covid-19 recession seems Red and orange vertical lines represent the same events as in Figure 3 . In this section we will look in more detail at some interesting behaviour of individual currencies. In Figure 6 we show how the NECOF contagion factors evolve for the Euro (EUR), the Danish Krone (DKK), the British Punds (GBP), the Swiss Franc (CHF) and the Malaysian We previously discussed the pair EUR and DKK and their very high correlation. Considering the causality links, we additionally see that it is the EUR that influences the DKK and not vice versa, as shown in Figure 7 and 2(b). This unsurprising fact shows that the NECOF measure is much more meaningful than a correlation analysis in describing the risk of contagion of a financial asset. Two currencies can have a very high correlation and yet completely opposite NECOFs. In fact, the DKK shows a NECOF of almost 100% most of the time, while the NECOF of the EUR is usually at 0% -increasing significantly only once at the beginning of the Financial Crisis in 2007. This causal relationship between the EUR and the DKK holds throughout the considered 21 years. The next interesting example of a NECOF path is that of the GBP. In the previous section we saw that the GBP has a tendency to switch clusters between Europe and the Commonwealth cluster. It usually is a currency that influences others and generally has a low NECOF around 0% -this is in line with what Giudici and Parisi (2018) find for the United Kingdom based on Corporate Default Swap spreads (CDS). In our study however, we find that the GBP's NECOF has a tendency to rise sharply during turbulent times like the Financial Crisis. Curiously, the GBP was hardly ever under the influence, from a contagion point of view, of the EUR -unless, again, there was a crisis. The GBP experienced contagion from the EUR in 2007, during the financial crisis, and then during Brexit, around the time when the first draft withdrawal agreement was negotiated and endorsed by the EU members at the end of 2019, as seen in Figure 7 . The CHF is traditionally considered a safe-haven currency (Henderson, 2006; De Bock and de Carvalho Filho, 2015; Jäggi et al., 2019) . The CHF presents a relatively volatile and often high NECOF. This is in contrast to the assumed safety of the CHF, but on the other hand the NECOF of the CHF has a tendency to go down precisely in times of crisis, which again speaks for the safe haven status. The low NECOFs during the European Sovereign Debt Crisis are an example of this behaviour. The sharp fall of the NECOF at the end of 2014 is due to the intervention of the Swiss central bank, which tried to peg the currency to the EUR to prevent the increase in value of CHF. This attempt was however scrapped in January of 2015. And after the Chinese market crash passed, the NECOF shot up again. In the past, the JPY was seen more "as a low interest rate or funding currency" (Henderson, 2006) , but most recent studies classify it a safe-haven currency (Botman et al., 2013; Jäggi et al., 2019) . As with the CHF, the JPY seems to appreciate in value during a crisis and during high volatility periods (Ranaldo and Söderlind, 2010 ). As Figure 6 shows, the JPY presents a very low NECOF for most of the time, and this would seem to validate the consideration of the JPY as a safe-haven currency. We further find a dependency of the CHF on the JPY, illustrated in Figure 7 . The arrow goes from the JPY to the CHF in 75% of the networks (never in the opposite direction), which indicates that there is contagion that goes form the JPY to the CHF. The causal effect from the JPY to the CHF and the lower NECOF of the JPY in general would suggest that the JPY could be even considered a better safe haven than the CHF. This is exactly what Fatum and Yamamoto (2016) and De Bock and de Carvalho Filho (2015) find when comparing these two currencies in terms of safe-haven characteristics. The last currency we will consider in detail is the MYR. The MYR shows the NECOF evolution of an Asian currency that was pegged to the USD until the 2005. The NECOF falls in 2008 and after the 2015 Chines stock market crash, mainly because of the intervention by the Bank Negara (the Central Bank of Malaysia) to prevent the exchange rate over the USD from plummeting. At times of important intervention by a central bank the contagion from other currencies clearly decreases. The Malaysian economy and financial sector have grown during the 20 years considered here, and it is interesting how resilient to contagion it seems to be, unlike the other south Asian currencies. Financial contagion measures have always had causal aspirations. In this work we have unified this concept of causality with a defined measure that allows for a quantifiable causal interpretation of contagion relationships on the Forex market. We corroborate and extend results from different studies within one unifying framework and are able to answer very practical questions like how contagion spreads on the Forex Market and which currencies are at the highest risk of contagion at any given time. We have recreated a series of causal networks based on 23 exchange rates over the USD, spanning over 21 years, and present both the overall development of contagion on the Forex as well as individual network contagion dynamics. We have shown how to read these causal networks as contagion maps to pinpoint sources of contagion and how the contagion paths on the Forex evolve through time. We were able to identify a new promising group of financial indicators that take contagion and systemic risk directly into account. The newly identified measure of network contagion (NECO) seems to be of value for both a market level evaluation and the analysis of single financial instruments alike. We discussed the network contagion factors' (NECOF) evolution for a subset of currencies, to demonstrate how this metric can be used to identify and evaluate a financial instrument from an investment and hedging point of view. In contrast to the correlation networks, we obtain causal directions. Because they are inherently spares, causal networks do not have to be filtered, e.g. via Minimum Spanning Tree (MST) methods (Mantegna, 1999) , and can be easily analysed and evaluated. Kazemilari and Djauhari (2013) compare the use of different centrality measures in constructing MSTs for the Forex, (including degree, betweenness, closeness and eigenvector). Filtering is found to be important, but results are sensitive to the exact measure of correlation used as well as the distance measure. There are other filtering methods and so the choice of the method itself will also affect results (Soramäki and Cook, 2016; Tumminello et al., 2005; Serrano et al., 2009; Marcaccioli and Livan, 2019) . The application of causal graphical models to financial data is in its infancy and there are still interesting challenges. In our case we assumed normality for log-returns and found our sample to be stationary, but a model that could deal automatically with non-normality, fattails, heteroskedasticity and non-stationarity of the data would be advantageous for further applications in finance. The trading on the Forex is active 24 hours a day (Goodhart and Hesse, 1993) and so we were able to use prices for all currencies at the same time instant. This is not the case for most other markets and assets being traded, and hence the impact of asynchronously observed returns on the analysis would have to be taken into account (Burns et al., 1998) . Whereas the contemporaneous contagion is the most significant in a fast moving and liquid market, it could also be of interest to consider economic cycles and longer time delays. Lastly, any measurable confounder can be added into our model, should we want to see how other variables, e.g. interest rates or inflation, impact the Forex contagion. For unmeasured confounders and latent variables the The Fast Causal Inference algorithm (FCI) (Spirtes et al., 1995 (Spirtes et al., , 2000 can be used. A PC Stable Algorithm STEP 1 -Finding the Skeleton. We begin the procedure by linking all nodes of interest X and link all of them to create a complete graph, as in Figure 8 . X N X 4 X 3 X 2 X 1 Figure 9 : The skeleton obtained from the complete graph using STEP 1. Once we have the complete graph, we eliminate links between nodes X i and X j that are independent or conditionally independent, conditioning iteratively on a growing subset of the other nodes X C in the graph. The algorithm considers all possible separating subsets X C for each pair of nodes to test the hypothesis H 0 that nodes X i and X j are independent. If there is any subset X C for which H 0 is not rejected at the specified significance level (often set at α = 0.05), the link between the two nodes is removed from the network. Whatever is left at the end of the process is the so-called skeleton, an undirected graph G such that nodes (X i , X j ) are connected with a link if and only if no set X C can be found to make them conditionally independent. See an example of a skeleton in Figure 9 . STEP 2 -Applying causal orientation rules. First, for each pair of nodes X i and X j that are not connected by a link, but both connecting to a common neighbour X k , we check whether X k belongs to the subset of links X C from the previous step. Since we do not have a link between X i and X j , we know that a subset X C exists such that these two are Figure 10 : Example of a collider. Knowing that X k is not a parent node for X i and/or X j , only one direction for the links is logical possible. Figure 11 : Example of a consistency rule -avoiding a cycle. conditionally independent. If X k does not belong to the subset X C and yet we still have a link between these three nodes, we know that X i and X j influence X k and not vice versa. This means we add directions X i → X k and X j → X k as seen in Figure 10 . This primary orientation is often referred to as a collider or inverted fork or V orientation. We can think of colliders as nodes that stop a path unless the analysis is conditioned on them -colliders are random variables that appear on the left-hand side in a structural equation model with multiple variables on the right-hand side. Once we have established all colliders within the graph, the PC algorithm tries to orient as many of the remaining links as possible by a set of consistency rules, as in Meek (1995) . The rules ensure that no newly directed link disrupts the previously established structure and no cycle is created. An example of such a rule is shown in Figure 11 . Not all links can always be successfully oriented at the end of this step. If the graph we obtain after implementing the orientation rules is not fully directed, it is referred to as a Completed Partially Directed Acyclic Graph (CPDAG). In that case a CPDAG is the best Figure 12 : Example of a CPDAG. (B),(C) and (D) are Markov equivalent DAGs, or CPDAGs, under the assumption that X k belongs to the subset of X C that made X i and X j independent and so a collider solution as in Figure 10 was not possible. possible outcome we can obtain. It describes an equivalence class of DAGs that cannot be distinguished even with infinite amount of data. An example of a CPDAG can be seen in Figure 12 . Unlike in Figure 10 , we cannot find a collider, and so all three DAGs (B),(C) and (D) can equally explain the skeleton in (A). The more nodes or variables we have in a network, and therefore the more connectivity we have, the easier it is for the PC Algorithm to detect directions. This is in contrast to the curse of dimensionality that most models have. A trivial example would be a network with just two nodes: In such a situation no amount of observational data on these two nodes would allow the PC Algorithm to orient the graph and decide on the direction of the arrow between the two nodes. Measuring contagion risk in international banking Triennial central bank survey A network analysis of the volatility of high dimensional financial series Time-varying general dynamic factor models and the measurement of financial connectedness Financial networks and stress testing: Challenges and new research avenues for systemic risk analysis and financial stability implications Fast unfolding of communities in large networks Eight myths about causality and structural equation models. In Handbook of causal analysis for social research The curious case of the yen as a safe haven currency: a forensic analysis Correlations and volatilities of asynchronous data Capital flows to latin america: is there evidence of contagion effects? What coronavirus could mean for the global economy International financial contagion Contagion: a fear for african equity markets? Order-independent constraint-based causal structure learning Vcausality and graphical models for time series The behavior of currencies during risk-off episodes On the network topology of variance decompositions: Measuring the connectedness of financial firms Granger causality and path diagrams for multivariate time series Financial networks and contagion Intra-safe haven currency behavior during the global financial crisis Dynamical clustering of exchange rates No contagion, only interdependence: measuring stock market comovements Complexity, concentration and contagion Corisk: Credit risk contagion with correlation network models How likely is contagion in financial networks Central bank forex internvention assessed in continous time Financial contagion: problems of proximity and connectivity in financial markets Currency strategy: The practitioner's guide to currency investing, hedging and forecasting Influence diagrams Macroeconomic surprises, market environment, and safe-haven currencies The statistical distribution of daily exchange rate price changes: dependent vs independent models An overview of the pcalg package for r Does international financial contagion really exist Analysis of a correlation network in world currency exchange market Topology of the correlation networks among major currencies using hierarchical structure methods Analysis of a network structure of the foreign currency exchange market Systemic banking crises revisited Community detection algorithms: a comparative analysis Causal inference from graphical models. Complex stochastic systems Estimating high-dimensional intervention effects from observational data Hierarchical structure in financial markets A pólya urn approach to information filtering in complex networks Causal inference and causal explanation with background knowledge Network models and financial stability Covid-19 spending helped to lift foreign aid to an all-time high in 2020 but more effort needed ProbabiIistic Reasoning in Intelligent Systems: Networks of Plausible Inference Causality Safe haven currencies Timeline -china's reforms of the yuan exchange rate Contagion, spillover, and interdependence Measuring financial contagion: A copula approach Coronavirus pandemic has delivered the fastest, deepest economic shock in history Estimating the probability distribution of the exchange rate between ghana cedi and american dollar Who learns better bayesian network structures: Constraint-based, score-based or hybrid algorithms Extracting the multiscale backbone of complex weighted networks Network theory and financial risk An algorithm for fast recovery of sparse causal graphs Causation, prediction, and search Causal inference in the presence of latent variables and selection bias Causality networks of financial assets Contagion, liberalization, and the optimal structure of globalization Detecting causality in complex ecosystems Covid-19 pandemic; recession, virtual revolution leading to de-globalization A tool for filtering information in complex systems Sources of contagion: is it finance or trade Similarity measure and topology evolution of foreign exchange markets using dynamic time warping method: Evidence from minimal spanning tree Dynamics of foreign exchange networks: a time-varying copula approach Measuring contagion between energy market and stock market during financial crisis: A copula approach Practical data analysis for designed experiments