{'fraction_non_alphanumeric': 0.047850390156062426, 'fraction_numerical': 0.018419867947178873, 'mean_word_length': 3.910924834193073, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 35, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Contagion in financial systems: A Bayesian network approach

We develop a structural default model for interconnected financial institutions in a probabilistic framework. For all possible network structures we characterize the joint default distribution of the system using Bayesian network methodologies. Particular emphasis is given to the treatment and consequences of cyclic financial linkages. We further demonstrate how Bayesian network theory can be applied to detect contagion channels within the financial network, to measure the systemic importance of selected entities on others, and to compute conditional or unconditional probabilities of default for single or multiple institutions.


Introduction
The 2007-08 financial crisis has unmistakably revealed on which fragile grounds the global financial system was built at that time. Contrary to the usual perception that diversification reduces risk, it was precisely the interconnectedness of the system that made the spread of shocks across large scales possible. Henceforth, a lot of effort has been put into understanding the origin, the mechanisms and the consequences of financial contagion. It is still a matter of current research to analyze the complex effects of financial interconnection and whether it is a blessing or a curse for the stability of the overall financial system. For example, while the classical papers by Allen and Gale (2000) and Freixas et al. (2000) argue that interconnection strengthens the resilience of financial systems, recent work by Acemoglu et al. (2015) and Elliott et al. (2014) demonstrate the robust-yet-fragile nature of financial systems: Densely connected systems can prove to be more robust, but also to be more vulnerable to shocks, depending on the actual network structure. Therefore, a profound understanding of interconnectedness and the risk of financial contagion is inevitable for bankers, regulators and other decision makers in order to set up effective detection and prevention mechanisms for possible future crises.
In the literature on balance sheet contagion, one of the most prominent default cascade models is that of Eisenberg and Noe (2001). Under mild assumptions on the operative cash flows the financial institutions generate, the authors use a fixed-point argument to establish the existence of a unique clearing payment vector, which can be explicitly computed via a fictitious default algorithm. Extending the model by introducing bankruptcy costs, Rogers and Veraart (2013) show that the clearing vector is no longer uniquely determined in general. Instead, the fictitious default algorithm can be modified to produce the greatest and the least clearing vector. Although Eisenberg and Noe (2001) also discuss qualitative implications of stochastic operative cash flows, the core analysis of these two papers remains deterministic.
Imposing maximal bankruptcy costs (i.e., creditors lose the total value of a claim upon default of the counterparty), Gai and Kapadia (2010) show that the relationship between connectedness and stability in financial systems exhibits a phase transition: Interconnection can both absorb and amplify shocks. Analytical results, however, are only obtained on homogeneous random graphs where exposures are evenly distributed among all counterparties. We refer to Hurd (2016) for extensions and comparisons between the Eisenberg-Noe and the Gai-Kapadia model.
A nonmonotonic effect of interconnection on stability is also confirmed by Acemoglu et al. (2015). Drawing on a variant of Eisenberg and Noe's model, they show that for small shocks, highly diversified systems are less susceptible to contagion than sparsely connected networks, but that the opposite is true for big shocks. Methodologically, the authors impose a two-state evolution for the firms and identify the optimal network for the small as well as the big shock regime. Assuming that interconnection arises through asset cross-holdings rather than mutual liabilities, Elliott et al. (2014) derive the same qualitative result on various random graph models.
Another interesting development of the Eisenberg-Noe model is carried out by Gouriéroux et al. (2012). The authors first extend the existence and uniqueness of a clearing vector to the situation where interfirm share holdings are included in the model. Additional to these (again purely deterministic) considerations, they further discuss the consequences for the financial system when random shocks occur, giving two quantitative results: First, they compute the conditional distribution of the firm values when it is known which firms default and which not. Second, they provide an enumeration type formula for the probability of default for a given firm in the network. However, they do not reveal how the terms in their expansion (which are the probabilities of joint default configurations) can be computed. Furthermore, it is unclear how to determine which institutions default or not at first place because this in turn depends on the firm values. Finally, let us also mention Glasserman and Young (2015) who give quantitative estimates on the probability of default in various contagion models.
In addition to the mainly theoretical contributions mentioned above, a lot of empirical work has been carried out, see e.g. Elsinger et al. (2006), Cont et al. (2013), Craig and von Peter (2014) and Langfield et al. (2014) for applications to central bank data from the Austrian, Brazilian, German and UK banking system, respectively. Furthermore, apart from work based on variations of the Eisenberg and Noe (2001) model, there are also other network-based approaches to systemic risk. We refer to Castiglionesi and Eboli (2015) for the usage of flow network techniques, to Fouque and Sun (2013), Kley et al. (2015) and Chong and Klüppelberg (2017) for models relying on stochastic differential equations, and to Amini et al. (2016) and Detering et al. (2017) for contagion analyses on large random graphs. While the analysis in Castiglionesi and Eboli (2015) is again deterministic, the other papers rely on probabilistic approaches that only apply to stylized or limiting networks.
Even though some of the aforementioned works discuss stochastic effects in the context of financial contagion, the full structure of the default probabilities within a given (not necessarily stylized) financial system remains unknown when future returns are random. And this is exactly the problem we want to address in the present paper. For all possible network structures of a financial system subjected to stochastic shocks, we give a complete characterization of the joint default probability distribution of the system, in a way that the probability of default for a single or a group of institutions can be computed efficiently. Moreover, our analysis will also allow for identifying possible channels of financial contagion and measuring the systemic importance of institutions.
Our approach will draw upon methods from the theory of Bayesian networks, also known as directed graphical models, see e.g. Lauritzen (1996) and Koller and Friedman (2009). These models are a priori defined on directed acyclic graphs (DAGs), but it is widely aknowledged that mutual dependencies and directed cycles are omnipresent in financial systems. Therefore, for the purposes of this paper, we have to extend the theory of Bayesian networks to graphs with directed cycles, and we will do so by interpreting a cyclic model as the margin of an acyclic model on a suitably enlarged graph. This methodology for treating cyclic graphical models or, more generally, systems with feedback cycles, is of independent interest and may be useful for other applications as well.
The remaining article is organized as follows. In Section 2, we introduce a probabilistic structural default model for interconnected financial institutions. As in Gai and Kapadia (2010), Rogers and Veraart (2013) and Elliott et al. (2014), our model takes bankruptcy costs into account so that the standard balance sheet equations may no longer have a unique solution. Apart from specific examples, a general characterization of uniqueness of solutions seems to be absent in the literature. So this leads to our first main result, Theorem 2.4, which states that uniqueness holds if and only if the underlying liability network corresponds to a DAG.
If the interfirm liabilities exhibit a DAG structure, we further prove in Section 3, Theorem 3.2, that the default variables of the institutions form a Bayesian network on this DAG. In other words, if we fix an institution i and assume knowledge about the state of all its debtors (its parents in the language of graph theory), its default probability is independent of all other firms that have not lent (directly or indirectly via other firms) to i (the non-descendants of i).
If there are directed lending cycles, which is most likely the case in practice, the previously identified non-uniqueness problem requires further specification of the sets of defaulting and surviving firms. For the two extremal cases, the mild and the strict default rule, we recover in Theorems 3.10 and 3.12 the Bayesian network structure of the default variables on a suitably enlarged liability graph. So for all financial networks-no matter with or without directed cycles-the joint default distribution of the system can be efficiently structured in terms of a Bayesian network.
In Section 4 we discuss the practical consequences and advantages of having a Bayesian network structure. We first reveal how to decide on a graphical basis whether the default of two (or two groups of) firms is stochastically dependent or not. Second, we highlight in a numerical study how established algorithms can be used to compute conditional or unconditional default probabilities, either exactly or approximatively. Finally, we define and analyze two measures of systemic risk that follow from our Bayesian network analysis. In contrast to many already existing measures, ours are probabilistic in nature and follow from a structural default cascade model. Section 5 concludes and points at further research directions.

Default risk model for interconnected firms
We consider N firms labeled i = 1, . . . , N within an economy for a single period. At time t = 0, each firm i has some operating assets X i and some cash K i that yields a riskless continuous interest at a rate of r 0 . The same firm also has some external liabilities F i that are to be redeemed at time t = T , the end of the period, with a continuous interest rate of r 0 . In addition to that, at t = 0, each firm i has lent firm j an amount of L ij (possibly 0) which is to be repaid by j at time t = T with a continuous interest rate of r ij . In other words, firm i holds a bond of firm j with face value L ij and a single coupon payment at maturity T . Apart from that, no other financial involvement exists between the N firms.
During the period from t = 0 to t = T every company i uses its operating assets X i to run a firm-specific business. Following the classical work of Merton (1974), this is assumed to evolve according to a geometric Brownian motion with drift µ i and volatility σ 2 i . The driving Brownian motions B 1 , . . . , B N are considered to be independent. We shall comment on possible relaxations of this assumption in Section 5.
In order to simplify the subsequent exposition, the values K i , F i and L ij are assumed to be nonnegative, the asset drifts µ i as well as the interest rates r ij , r 0 and r 0 may take positive or negative values, and X i , σ i and T are strictly positive. Moreover, for each i ∈ {1, . . . , N } we suppose that (2.1) Firms that have more cash reserves than the bound on the right-hand side of (2.1) will never experience default at time t = T . Even if they do not receive payments from the other institutions and lose all their operating assets, they still have enough money to meet all their obligations. Since we are interested in the default probabilities within the financial network, there is no loss of generality if we exclude such institutions from our analysis. Let us also point out that we take a "central bank" perspective in this paper. All parameters and quantities introduced above are assumed to be known or have been estimated before. We refer to Anand et al. (2015), Gandy and Veraart (2016) and Upper (2011) for various methods to estimate interfirm exposures.
Based on the previously described set-up, the balance sheet of firm i at time t = 0 has the form depicted on the left-hand side of Figure 1. In essence, the situation at time t = 0 is a variant of the classical model by Eisenberg and Noe (2001). At the time of maturity, however, ours differs in two important aspects from that of Eisenberg and Noe (2001).
First, the value of firm i's operating assets at t = T , which is given by Operating assets Liabilities -external Assets at t = 0 Liabilities and equity at t = 0 Operating assets Liabilities -external Assets at t = T Liabilities and equity at t = T is random, whereas the operating cash flows in Eisenberg and Noe (2001) are assumed to be deterministic. Second, in contrast to a linear or proportional recovery, we impose a zero recovery rate in the default scenario; that is, if a firm is not able to meet all of its obligations, none of its creditors receives any payment. As Gai and Kapadia (2010) argue, "this assumption is likely to be realisitic in the midst of a crisis: In the immediate aftermath of a default, the recovery rate and the timing of recovery will be highly uncertain and banks' funders are likely to assume the worst-case scenario" (p. 2407). We also refer to Battiston et al. (2012) and Cont et al. (2013) for a similar reasoning and Memmel et al. (2012) for empirical evidence for the frequent occurrence of a recovery rate close to zero.
Standard balance sheet considerations lead us to the following definition (we do not distinguish between the terms bankruptcy, default and insolvency in this paper).

Definition 2.1 A company defaults (survives) at time t = T if it belongs to the set
where E i (T ) is the equity of firm i at time T given by Moreover, we define The resulting balance sheets at time t = T are depicted on the right-hand side of Figure 1. As a consequence of the stochasticity of the asset values X i (T ), also the equity values E i (T ), the sets D and S and the variables D i and S i are random. The natural question arises whether the knowledge of X 1 (T ), . . . , X N (T ) at time T fully determines D, S and E i (T ) through equations (2.2) and (2.3). In the model of Eisenberg and Noe (2001) the existence and uniqueness of solutions to (2.2) and (2.3) would immediately follow from the strict positivity of all X i (T ). This condition, however, is no longer sufficient for uniqueness under the zero recovery assumption as the following simple counterexample demonstrates.
The emergence of multiple solutions in the previous example highlights the remaining point of indeterminancy in our model: To what extent is clearing between distressed firms, or more precisely, the netting of mutual claims allowed? In the first solution of Example 2.2, netting is forbidden and both firms default because neither of them is able to initiate the promised payment to the other one. In the second solution, netting is permitted, so both firms abandon their claims and survive with $5 each. Of course, the degree to which netting of claims occurs depends on many external factors such as the availability of short-term fundings or the degree of counterparty anonymity. However, as we shall see in Section 3, it is always possible to find and characterize the solution to (2.2) and (2.3) with the maximal or the minimal number of surviving firms, corresponding to the situation where netting is always permitted or prohibited.
The non-uniqueness issue as encountered in Example 2.2 is common to cascade models with bankruptcy costs, cf. Rogers and Veraart (2013), Elliott et al. (2014) and Hurd (2016). A general criterion for uniqueness versus non-uniqueness seems to be missing in the literature, and hopeless if it is required to hold ω-wise for all possible outcomes of X 1 (T )(ω), . . . , X N (T )(ω).
However, we will show that it is possible to characterize all models where uniqueness holds almost surely. The most efficient way to do so is to represent the interfirm liabilities by a graphical structure. In this article, we only consider directed graphs The following graphical representation of the interfirm liabilities plays a crucial role in the default analysis of the firm network described above.
Thus, there is an edge from i to j precisely when i has borrowed money from j at time t = 0 and has to repay the latter at time t = T . In graphical terms, this is denoted by i → G j or i ∈ pa G (j), and we say that i is a parent of j in G. A whole sequence i 1 → G . . . → G i n with n ≥ 2 is then called a (directed) path from i 1 to i n , and a (directed) cycle if i 1 = i n . If G contains no directed cycles, G is called a directed acyclic graph (DAG).
For future reference, let us also introduce some further terminology. A vertex i is called an ancestor of j, and j a descendant of i, in short i ∈ an G (j) and j ∈ de G (i), if there exists a directed path from i to j in G. Nodes in nd G (i) := V \ ({i} ∪ de G (i)) are called the nondescendants of i. Given an additional sequence (x i ) i∈V , we also write pa G (x i ) := (x j : j ∈ pa G (i)), and define an G (x i ), de G (x i ) and nd G (x i ) analogously. If I ⊆ V, we set pa G (I) := i∈I pa G (i), de G (I) := i∈I de G (i), nd G (I) := i∈I nd G (i) and x I := (x i : i ∈ I).
Returning to the question of uniqueness of solutions to (2.2) and (2.3), our first main result asserts that the decision can be made by sole inspection of the redemption graph.
Theorem 2.4. Let G be the redemption graph underlying the considered financial network.
(1) If G is a DAG, there exists a unique solution to (2.2) and (2.3) with probability 1, so D, S and E 1 (T ), . . . , E N (T ) are uniquely determined for almost all realizations of X 1 (T ), . . . , X N (T ).
(2) If G is not a DAG but contains a directed cycle, there is a strictly positive probability that the realizations X 1 (T ), . . . , X N (T ) are such that (2.2) and (2.3) have multiple solutions.

Default probabilities for interconnected firms
As shown in Theorem 2.4, directed cycles in the financial system (as observed in Example 2.2) impose the only hindrance to the uniqueness of solutions to (2.2) and (2.3). So if the redemption graph G is a DAG, the random variables D 1 , . . . , D N are well defined, and in this case, their joint distribution has a particularly convenient structure.

Definition 3.1 Given a DAG
For a detailed treatment of Bayesian networks we refer to the monographs Lauritzen (1996) and Koller and Friedman (2009). An equivalent characterization is this (see Theorem 3.27 in Lauritzen (1996)): {X i : i ∈ V} forms a Bayesian network over G if and only if for every i ∈ V, the variable X i is conditionally independent of X nd G (i) given X pa G (i) . Thus, a Bayesian network structure can be understood as a collection of conditional independence statements among variables.

In particular, for all Σ ⊆ [N ] we have that
Let us give an informal explanation why an acyclic redemption graph leads to a Bayesian network structure of D 1 , . . . , D N . Indeed, every DAG G induces a partial order G on its vertex set via the relation Therefore, starting with institutions that are minimal with respect to G (i.e., institutions that have not lent money to anybody else), we can determine the values of D 1 , . . . , D N iteratively along the partial order G . The Bayesian network structure follows now from the observation that this iteration procedure is "Markovian" with respect to G : For each i ∈ [N ], the variable D i is independent of (D j : j G i) given (D j : j ∈ pa G (i)), or equivalently, in order to determine the default behavior of i, it suffices to know whether its debtors are solvent or not. The formal proof of Theorem 3.2 can be found in the Appendix. When the redemption graph has directed cycles, additional rules to (2.2) and (2.3) have to be set up for D 1 , . . . , D N to be well defined. These rules may be different for each cycle or vary from firm to firm. The following result, however, holds for all consistent extensions of (2.2) and (2.3) (i.e., measurable mappings of the values In the general case, (3.6) still holds with a "≤"-sign instead of equality.
Apart from Proposition 3.3, there is not much more that can be said about a particularly chosen solution to (2.2) and (2.3). However, further structural results can be obtained for the two "extreme" cases, that is, where the set of surviving firms is maximal or minimal, respectively.

Definition 3.4
The mild default rule specifies the sets S and D in the following way.
• If the operating assets and cash holdings of some firm i are so low that it cannot meet its obligations at time t = T even if it is paid back by all its debtors, then i defaults and is called a defaulting firm of the first round. In this case we write i ∈ D 1 . If no firm falls into this category, all firms survive and D = ∅ and S = [N ].
Definition 3.5 Under the strict default rule the sets S and D are determined as follows.
• Every firm i whose operating assets and cash holdings at time t = T are large enough to repay its creditors (regardless whether it receives payments from the other firms) survives.
In this case, we call i a surviving firm of the first round and write i ∈ S 1 . If no firm meets this criterion, all firms default: S = ∅ and D = [N ].
• For every n ∈ {2, . . . , N } we call i ∈ [N ] \ n−1 m=1 S m a surviving firm of the n-th round, denoted i ∈ S n , if at time t = T its operating assets, its cash holdings and the payments it receives from firms in n−1 m=1 S m are high enough to redeem its debts.
Both the mild and the strict default rules are variants of the fictitious default algorithm of Eisenberg and Noe (2001) and Rogers and Veraart (2013), the loss cascades described in Cont et al. (2013), the cascade hierarchies of Elliott et al. (2014), or the clearing algorithms of Kusnetsov and Veraart (2016).
Proposition 3.6. We state some immediate consequences of Definitions 3.4 and 3.5.
(1) The sets S and D specified by the mild or the strict default rule are consistent extensions of (2.2) and (2.3).
(2) For every consistent extension of (2.2) and ( Apart from the special cases discussed in the previous results, the presence of cycles in G prevents us from a concise description of the joint probability distribution of D 1 , . . . , D N using Bayesian network methods. However, under the mild or the strict default rule, the Bayesian network structure can be recovered if we "blow up" the redemption graph in a suitable way. The idea here is to explicitly incorporate the cascade mechanism behind the mild or the strict default rule into the graphical structure. Instead of a single variable D i that determines whether firm i defaults or not, we keep track of a whole tuple of variables D in , n ∈ [N ], that depend on whether i defaults in the n-th round. In fact, to reduce the number of new variables as far as possible, it suffices to consider this separately for the strongly connected components of the redemption graph G. These are the equivalence classes induced by the equivalence relation or in economic terms, these are the maximal subsets of firms where any two of them have a direct or an indirect lender-borrower relationship via intermediate firms. Definition 3.7 Let C 1 , . . . , C m be the strongly connected components in G and N i the size of the strongly connected component firm i belongs to. The acyclic augmentation of G is the graphḠ := (V,Ē) with the vertex set and the edge set In words, we first create N i vertex copies inḠ for each firm i ∈ [N ], numbered from (i, 1) to (i, N i ). Then the first type of edges in (3.9) connects two directly linked firms i and j in G that belong to different strongly connected components: Namely, if j has to repay i at time T , the last copy of j is connected to each copy of i. The second type of linkages connects consecutive copies of a fixed firm. The third (resp. fourth) type of edges joins consecutive (resp. next-but-one) copies of two firms that are directly linked to each other in G and belong to the same strongly connected component.  Figure 2 shows an example of a cyclic graph and its acyclic augmentation. As we can see, although G has a directed cycle (the vertices {1, 2, 3, 4} form a strongly connected component), its augmentationḠ has no cycles. Of course, this holds in general.
Lemma 3.8. The acyclic augmentationḠ of the redemption graph G is a DAG.
Next we associate random variables to the vertices ofḠ, in such a way that they contain our variables of interest D 1 , . . . , D N as subsets and form a Bayesian network onḠ. We first assume the mild default rule; for the strict default rule, all definitions and results are analogous and will be provided afterwards.
and D in = 0 otherwise.
To paraphrase, we first order the strongly connected components of G in such a way that firms in a given component have no borrowings from firms in previous components. Then, starting with those components that have no borrowings from any other component, we assign the value 1 to D in exactly when firm i defaults assuming it only receives payments from surviving firms of previous strongly connected components and from firms j in the same component that have not defaulted up to the (n − 1)-st step, that is, where D j,n−1 = 0.
Although the variable D in does not explicitly depend on D i,n−2 in Definition 3.9, we have to form the next-but-one edges inḠ (i.e., the last of the four types of edges in (3.9)). The reason behind is that on the event D i,n−1 = 0, the values D j,n−2 of parents j belonging to the same strongly connected component as i contain important information about X i (T ). For example, if D j,n−2 = 1 for many such parents (so i survives in round n − 1 even though many of its parents have defaulted in round n − 2), the value X i (T ) has to exceed a higher threshold compared to a situation where D j,n−2 = 0 for many j. Furthermore, the differences D j,n−1 −D j,n−2 influence the likelihood whether D i,n−1 = D in = 0 or 0 = D i,n−1 < D in = 1. In fact, if D j,n−1 − D j,n−2 = 0 for all parents j, then necessarily the first alternative occurs. By contrast, the likelihood for the second alternative increases with the frequency that D j,n−1 − D j,n−2 = 1 occurs. These considerations are reflected in formula (3.10) via the dependence on Σ m i,n−1 , which involves the variables (D j,n−2 : j ∈ pa G (i) ∩ de G (i)).
Next we present analogous statements for the strict default rule, which are simpler to formulate in terms of survival variables.
The quintessence of this section is that the default variables D 1 , . . . , D N associated to the financial institutions form a Bayesian network in the case of an acyclic redemption graph, and that they can be embedded as margins into a larger random vector with a Bayesian network structure in the cyclic case. But of course, these results are obtained under the hypotheses on the financial system made in Section 2. The question how modifications of these assumptions affect the Bayesian network structure will be addressed in Section 5.

Implications of the Bayesian network structure
We have proved in Theorems 3.2, 3.10 and 3.12 that the default and survival random variables associated to firms with mutual liabilities form a Bayesian network over the redemption graph or a suitable augmentation thereof. In this section, we elaborate the benefits of this Bayesian network structure for systemic risk analysis.

Independence detection
It is important for both the involved institutions and regulatory authorities to determine whether the default of different firms depends on each other or not, and how this relationship is affected by the state of other firms. The underlying Bayesian network structure permits us to reduce this question to a graph-theoretic analysis. More precisely, given the evidence of D k , k ∈ K, for some subset K ⊆ [N ], one can determine by sole inspection ofḠ, the augmentation of the redemption graph G from Definition 3.7, whether {D i : i ∈ I} and {D j : j ∈ J} for two further subsets I, J ⊆ [N ] depend on each other or not.
The key concept here is called d-separation, see p. 48 in Lauritzen (1996): (1) We call i 1 G . . . G i n a chain between i 1 and i n if for every j ∈ [n−1] we have i j → G i j+1 or i j+1 → G i j (or both).
(2) For three pairwise disjoint subsets V 0 , V 1 , V 2 of V, the sets V 1 and V 2 are called d-separated in G given V 0 (or simply d-separated if V 0 = ∅) if every chain i 1 G . . . G i n in G from some i 1 ∈ V 1 to some i n ∈ V 2 is blocked by V 0 , that is, for some j = 2, . . . , n − 1 we have For example, if G is a DAG, then for every i ∈ V the sets {i} and nd G (i) are d-separated in G given pa G (i). If random variables {X i : i ∈ V} form a Bayesian network on G, the fundamental result is the following, see Corollary 3.23 together with Proposition 3.25 in Lauritzen (1996): If V 1 and V 2 are d-separated in G given V 0 , then the two collections of random variables {X i : i ∈ V 1 } and {X i : i ∈ V 2 } are conditionally independent given {X i : i ∈ V 0 }. Numerical algorithms for checking d-separation are well established and efficient, see Section 3.3 of Koller and Friedman (2009).
Applied to the acyclic augmentationḠ = (V,Ē) of the redemption graph, the d-separation criterion provides a graphical tool for detecting independence between different groups of firms regarding their default behavior. In fact, d-separation is "almost" necessary for independence (see Theorem 7 of Meek (1995)): If V 0 , V 1 and V 2 are subsets ofV, and V 1 and V 2 are not dseparated given V 0 , then for almost all volatility parameters σ i the random variables

Measures of systemic impact
In the systemic risk literature several measures of systemic importance for interconnected firms have been proposed. While some approaches like in Acemoglu et al. (2015), Battiston et al. (2012) and Diebold and Yilmaz (2014) are purely based on the underlying network structure and parameters, others explicitly take the probabilistic nature of contagion into account. Examples for the latter category include the contagion index of Cont et al. (2013), the CoVaR measure of Adrian and Brunnermeier (2016), the SES and SRISK measures of Acharya et al. (2016) and Brownlees and Engle (2017), and the general systemic risk measures of Biagini et al. (2015) and Feinstein et al. (2016). Based on the structural cascade model analyzed in Sections 2 and 3, we contribute two further probabilisitic measures of systemic risk that are flexible (one can measure the impact of a single firm or a group of firms, unconditionally or conditionally on different stress scenarios), feasible (they can be computed by the methods described in the next subsection) and robust (they depend continuously on the underlying model parameters). In the following, if not otherwise stated, any consistent extension of (2.2) and (2.3) can be considered, in particular both the mild and the strict default rule. respectively. In (4.2), we set log 2 0 = −∞, and 0/0 = 1 in case the denominator, and, as a consequence, also the numerator is zero.
The ASI of I on J equals the total variation distance between the distribution of D J and its conditional distribution given D I = 1. Moreover, the RSI of I on J is the Rényi divergence of order +∞ between the same pair of distributions. Of course, instead of taking the maximum in (4.1) and (4.2), also L p -type measures can be investigated. For example, one can define L 1analogues of the ASI and the RSI measures based on mutual information and the Kullback-Leibler divergence. We do not go into details at this point but only refer to van Erven and Harremoës (2014) for more information on distances between probability measures.
Turning to the literature on Bayesian networks, we found, to our surprise, only little research where measures of importance for vertices in a network are investigated. Most notably, in Chapter 4 of Pinto (1986) (cf. Pearl (1988, Chapter 6.4), the author proposes quantifying the relevance of a vertex Y for another vertex X by a function depending on the distribution of X and its conditional distribution given Y . They give a version of the ASI measure as an example. Furthermore, Chan and Darwiche (2005) employ a symmetric version of the RSI measure in the context of sensitivity analysis for Bayesian networks.
(3) An explicit formula for (4.1) is One would also expect ASI(I 1 , J) ≤ ASI(I, J) and RSI(I 1 , J) ≤ RSI(I, J) to hold for I 1 ⊆ I since the knowledge of default of a larger set of firms ought to be worse, or at least not better, for the survival of another firm in the network. However, a simple counterexample demonstrates that this intuition is wrong.

Example 4.5
We consider a network of N = 5 institutions with redemption graph as in Figure 3 and zero interest rates. Further suppose that F 3 = F 4 = K 3 = K 4 = $0, that is, both firm 3 and firm 4 have neither cash nor external liabilities at time t = T . Moreover, we make the following assumptions on the firms' operative performance.
• X 1 = X 2 such that X 1 (T ) and X 2 (T ) are independent with the same distribution. As a consequence of the first hypothesis, the probabilities of default for firms 1 and 2 are very small but strictly positive. Moreover, by the second assumption, without repayment from firms 1 and 2, firms 3 and 4 have almost no chance to survive and pay back firm 5. However, as soon as firm 1 survives, also firm 4 survives, and as soon as both firm 1 and firm 2 are solvent, also firm 3 is so. Hence we obtain: • P[D 4 = 1] ≈ 0 because firm 1 has a very high chance of survival such that also firm 4 is most likely to survive.
• P[D 4 = 1 | D 3 = 1] ≈ 1/2 because conditional on the default of firm 3, the event of exactly one failure among 1 and 2 is almost one (the probability of both firms surviving is zero because otherwise 3 would not have defaulted, and the probability of a joint default of 1 and 2 is still comparatively small). Since only the failure of firm 1 triggers the default of 4, and X 1 (T ) and X 2 (T ) are identically distributed, the conditional default probability of 4 given the default of 3 is around 1/2.

Computation of default probabilities
In addition to finding the dependence relations among interconnected networks, another central objective of risk management is to determine the default probabilities of firms or the impact of a firm's default on other firms, measured, for example, in terms of the ASI and RSI of the previous subsection. Known as the probabilistic inference problem in the artificial intelligence community, this topic has been extensively studied in the literature of Bayesian networks, where various exact or approximative algorithms have been developed for this purpose (see Koller and Friedman (2009) for an in-depth treatment on this subject). In order to illustrate the results and concepts of the previous sections, we demonstrate in a numerical example how these inference algorithms can be applied to our setting. All numerical computations in the following are made using the junction tree algorithm within the open-source Bayes Net Toolbox for Matlab (Murphy, 2001).
We consider a financial network with N = 100 banks in total where the redemption graph is depicted in Figure 4. The network has a core-periphery structure in the sense that the first five banks form a complete network where all possible lending relationships are present, and each of these core banks has further borrowed money from 19 different periphery banks. We refer to the papers Elsinger et al. (2006), Cont et al. (2013), Craig and von Peter (2014) and Langfield et al. (2014) for empirical evidence of such structures in real banking networks. The time horizon in our example is T = 1 year, all interest rates are zero, and we assume statistical equality among all core banks and among all periphery banks: The subscript C (P) here represents an arbitrary core (periphery) banks. Figure 5 displays the probability distribution of the number of defaults in the resulting financial systems under the mild and the strict default rule. While the shape of the default distribution is the same for both the mild and the strict default rule, the actual probabilities are very different. No default occurs under the mild rule with a probability of 99.39%, but this probability decreases to 31.15% when the strict rule applies. This discrepancy is due to the fact that a core bank only has a 11.13% chance to survive without the repayment of the other core banks, but a 99.90% chance if it receives full repayment. As a consequence, in the considered example, the possibility of netting mutual claims is decisive whether the contagion cascade becomes unleashed or not. From Figure 5 we can observe several prominent qualitative features of the default distribution. First of all, the distribution is multimodal, corresponding to the number of core banks in default. Indeed, conditional on the default of a core bank, each periphery bank with lendings to this core bank defaults (independently) with a probability of 76.66%. Thus, whenever a core bank defaults, it triggers the default of 19 × 76.66% = 14.57 periphery banks on average, which explains why for both the mild and the strict rule the default distribution has modes at distances of 15 or 16 (one core bank plus 14 or 15 periphery banks).
Furthermore, we observe that also the probabilities at the modes are not monotone. This is caused by contagious effects among the core banks. When enough core banks default, it is rather likely that even more core banks default: The probability function of the number of defaulting core banks is not monotone as Figure 6 reveals.
Last but not least, the probabilities beyond the last mode with 78 defaults fall into the large deviation regime and decrease exponentially fast.
The measures of systemic impact introduced in the previous subsection can also be calculated in our example. For simplicity, we only report figures for the mild default rule; the computations under the strict default rule are completely analogous. To this end, let C and C be two arbitrary core banks and P and P be two periphery banks that are creditors of C and C , respectively. Concering the ASI and RSI of periphery banks, we fix another periphery bank P that is, like As both the ASI and RSI reveal, even banks that are not direct counterparties may be systemically important for each other. For instance, if a core bank defaults, the default probability of a periphery bank increases by 27.65% (or by a factor of 2 7.96 ≈ 248) even if it has no lendings to that defaulted core bank. Another observation is that also periphery banks have a high systemic impact although they have no borrowings from other banks in the system. The reason behind is simply that periphery banks that are repaid by their core bank counterparty survive with a probability larger than 99.99%. So if a periphery bank defaults, this is very likely caused by the default of its core bank counterparty.

Conclusion and outlook
In this paper we analyzed a financial contagion model in which the joint default probability distribution of the system can be characterized in terms of a Bayesian network on a graph determined by the interfirm liabilities. We further explained how this graphical structure can be employed to detect systemic dependencies within the network, to define measures of systemic importance for institutions and to compute their conditional or unconditional default probabilities. Since the involved methodologies apply to all possible networks, this work provides a useful device to analyze and monitor the systemic risk in financial systems. Naturally, we did impose various conditions on the financial network, so let us comment on possible generalizations. First of all, regarding probabilistic assumptions, the log-normal hypothesis on the evolution of the operating firm assets is merely for simplicity. The Bayesian network structure of the default variables is preserved if we assume another distribution for the asset returns. Only the conditional probabilities stated in Theorems 3.2, 3.10 and 3.12 have to be adapted.
The situation is different if we allow for dependent asset returns of the financial institutions. Of course, if one is only interested in computing default probabilities using Monte Carlo techniques, this is still feasible as long as the joint asset return distribution can be simulated from. However, the Bayesian network structure of the default variables D 1 , . . . , D N will be lost in general because observations of non-descendant institutions (with respect to the redemption graph) may reveal additional information about the driving noise. But let us suppose that each institution i is driven by a finite number of common market noises W 1 , . . . , W K plus its own idiosyncratic noise B i , assuming that the B i 's are still independent and also independent of the W j 's. Then conditional on the W j 's, the variables D 1 , . . . , D N will have a Bayesian network structure. Hence, our approach permits default risk analysis under various market situations, which is useful for stress testing, for instance.
Other generalizations may concern the assumptions on the financial system itself and the way institutions are interconnected. In our model, all mutual exposures are loans with two possible values at the end of the period (depending on whether the counterparty fails or not). It would be more realistic to include other types of exposures: For example, exposures with continuously varying values like asset cross-holdings (cf. Gouriéroux et al. (2012) and Elliott et al. (2014)), exposures with different seniorities, exposures with a non-zero recovery rate in the case of counterparty default, or exposures with different maturity dates. These considerations clearly go beyond the scope of the current paper and are left to future research.

Appendix: Proofs
Proof of Theorem 2.4. (1) If G is a DAG, the relation G defined in (3.7) induces a partial order on {1, . . . , N } with a non-empty set V 1 of minimal nodes with respect to G , which precisely contains those firms that have not lent money to any other firm. For such a firm i ∈ V 1 , the equation for E i (T ) in (2.3) is explicit: It does not depend on any other j = i because L ij = 0. Next, we consider the minimal nodes in V \ V 1 with respect to G V\V 1 , that is, those firms that have only lent money to firms in V 1 . Their values E i (T ) are given by an expression involving E j (T ) only for j ∈ V 1 . Iterating this at most N times, we obtain an explicit formula for all E i (T ) in terms of X 1 (T ), . . . , X N (T ) and the model parameters.
(2) Now we suppose that G has a directed cycle, say, involving the firms 1, . . . , N 0 in that order. By assumption (2.1), for each firm i ∈ {N 0 +1, . . . , N } there exists a range [x i such that i necessarily defaults whenever X i (T ) falls into this interval. For the N 0 firms within the cycle we first define L 0 to be the smallest amount a firm in {1, . . . , N 0 } has to repay to its creditor within the cycle. An inspection of (2.3) reveals that there exists a rectangle (2) i and the following property: When (X 1 (T ), . . . , X N 0 (T )) lies in that rectangle, then each firm in [N 0 ] is able to repay the external liabilities and all its creditors except the one in the cycle, but the remaining asset value is larger than the debt owed to this cycle creditor minus L 0 . As a result, if (X 1 (T ), . . . , i ), which is an event with strictly positive probability, then one solution would be that all firms default, and another would be that the firms in the cycle survive while all other firms default. 2 Proof of Theorem 3.2. This theorem is a special case of Theorem 3.12. 2 Proof of Proposition 3.3. That (3.6) holds with "≤" is immediate: If S = Σ, equation (2.3) becomes an explicit expression in terms of X i (T ) and the model parameters for each i ∈ [N ]. The independence of X 1 (T ), . . . , X N (T ) together with their log-normal distributions yields (3.6) with "≤". In order to prove equality when both G Σ and G [N ]\Σ are DAGs, we consider the situation where X 1 (T ), . . . , X N (T ) satisfy (2.2) and (2.3) with S = Σ. We have to show that all other choices S = Σ with Σ = Σ would violate (2.2) and (2.3). Since G Σ is a DAG, the relation G Σ induces a partial order on Σ. The minimal nodes in Σ with respect to that partial order, denoted by Σ 1 , correspond to firms that survive without receiving any payment from other firms in the network at time T . So they must belong to Σ whenever S = Σ is supposed to satisfy (2.2) and (2.3). Next, we consider the minimal nodes in Σ \ Σ 1 . Again, they must belong to Σ because they survive regardless of the solvency of all other firms except for the minimal nodes, which, however, are already known to survive. Proof of Proposition 3.6. We assume the strict default rule; for the mild default rule, the proof is completely analogous.
(1) It is obvious that the strict default rule maps X 1 (T ), . . . , X N (T ) in a measurable way to S 1 , . . . , S N . So we are left to prove that for i ∈ [N ] the term in (2.3) is nonnegative if and only if i ∈ S. By Definition 3.5, the expression (2.3) for i ∈ S n is already nonnegative when we take the indicator 1 S n−1 (for n = 1 we set S 0 := ∅), which is always less or equal to the original indicator 1 S . Since S = S 1 ∪ . . . ∪ S N , this proves that (2.3) is nonnegative for all i ∈ S. By contrast, for all i ∈ D equation (2.3) must take a strictly negative value because otherwise i belongs to S 1 ∪ . . . ∪ S N 0 +1 according to the strict default rule where N 0 is the smallest number in [N ] such that S = S 1 ∪ . . . ∪ S N 0 , which is obviously a contradiction.
(2) Denote by S 1 , . . . , S N the surviving firms of the n-th round under the strict default rule. As in (1), a simple induction argument shows that S n ⊆ S holds for all n ∈ [N ] whenever S and D satisfy (2.2) and (2.3).
(3) We have already shown in Proposition 3.3 that (3.6) always holds with "≤". For the reverse inequality, suppose that X 1 (T ), . . . , X N (T ) satisfy (2.2) and (2.3) with Σ instead of S. Under the strict default rule, the proof of the same proposition reveals that, because of the DAG structure of G Σ , we necessarily have Σ ⊆ S, so part (2) of the current proposition completes the proof. 2 Proof of Lemma 3.8. Suppose thatḠ does have a cycle, say, of the form (i 1 , n 1 ) →Ḡ . . . →Ḡ (i k , n k ) →Ḡ (i 1 , n 1 ).
Then at least one of the edges must belong to the first of the four collections of edges in (3.9) because otherwise we would have n 1 < n 2 < . . . < n k < n 1 , which is absurd. But if the cycle has an edge of the form ((i l , N i l ), (i l+1 , n l+1 )) with i l ∈ pa G (i l+1 ) ∩ nd G (i l+1 ), there cannot exist a path inḠ that connects (i l+1 , n l+1 ) to (i l , N i l ) because, by (3.9), this would give rise to a path in G from i l+1 to i l and contradict the fact that i l ∈ nd G (i l+1 ). However, this in turn produces a contradiction to the assumption that (i 1 , n 1 ), . . . , (i k , n k ) form a cycle inḠ. 2 Proof of Theorem 3.10.
(1) The first statement follows immediately from the definition in (3.10). For the second statement we number the strongly connected components of G in such a way that no vertex in C k has parents in C k+1 , . . . , C m . By induction on k we may assume that D i = D iN i holds under the mild default rule for all i ∈ C 1 ∪ . . . ∪ C k−1 . We must prove that D i = D iN i is true for i ∈ C k . We first show that D i = 1 holds as soon as D in = 1 for some n ∈ [N i ]. To this end, we proceed with another induction on n, and assume that we already know that D j,n−1 = 1 implies D j = 1 for all j ∈ C k . Then firms i ∈ C k with D in = 1 cannot repay their debts if they only receive payments from j ∈ pa G (i) \ C k with D jN j = 0 and j ∈ pa G (i) ∩ C k with D j,n−1 = 0. Indeed, all other firms default under the mild default rule: Firms j ∈ pa G (i) \ C k with D jN j = 1 by the first, and firms j ∈ pa G (i) ∩ C k with D j,n−1 = 1 by the second induction hypothesis. Thus, also i must default according to the mild default rule. For the converse direction that D i = 1 implies D iN i = 1 for all i ∈ C k , we recall that D = N n=1 D n , where D n contains the defaulting firms of the n-th round. By induction on n ∈ [N ], let us assume that those i ∈ C k that belong to D 1 ∪ . . . ∪ D n−1 satisfy D iN i = 1. Then every i ∈ D n has a negative equity value at time T if it does not receive money back from j ∈ pa G (i) ∩ (D 1 ∪ . . . ∪ D n−1 ). If such a firm j belongs to pa G (i) \ C k , we have D jN j = 1 by the first induction hypothesis, while if it belongs to pa G (i) ∩ C k , we have D jN j = 1 by the second hypothesis, and consequently D j,N j −1 = 1 (because the event that D j,N j −1 = 0 and D jN j = 1 happens only if j defaults in a later round than all firms in C k , which, however, is not possible because j ∈ D 1 ∪ . . . ∪ D n−1 and i ∈ D n ). Therefore, we conclude that D iN i = 1, which ends the • for all i ∈ [N ] with n i = 1 we have • for all i ∈ [N ] with n i = N i + 1 we have • and for all i ∈ [N ] with 2 ≤ n i ≤ N i we have and Thus, using the independence of X 1 (T ), . . . , X N (T ) and their log-normal distribution, we obtain on the one hand whereΣ m in := {j ∈ pa G (i) ∩ nd G (i) : e jN j = 0} ∪ {j ∈ pa G (i) ∩ de G (i) : e j,n−1 = 0}. On the other hand, if we assume for a moment that formula (3.13) is valid, we deduce that for all i ∈ [N ] with n i = 1 we have Comparing with (.1), we conclude that It remains to demonstrate the correctness of the conditional probabilities stated in (3.13). We only carry out the proof for N i > 1 and n > 1; the case n = 1 is simpler and can be achieved by a straightforward modification of the following arguments. It is evident by the monotonicity statement in (1) that e i,n−1 = 1 immediately implies so only the case e i,n−1 = e i,n−2 = . . . = e i1 = 0 needs to be considered further. Conditional on D i,n−1 = 0, we can now represent the parents of D in as paḠ(D in ) = F n (X j (T ) : j ∈ an G (i) \ {i}) with some function F n whose explicit form can be derived from (3.10). Thus, abbreviating (1) We first assume that V 1 and V 2 are d-separated in G and pick a chain between some (i 1 , N i 1 ) and (i k , N i k ) with i 1 ∈ V 1 and i k ∈ V 2 . Observing that (i, n) →Ḡ (i , n ) implies i = i or i → G i , it follows that the chain under consideration cannot be a path (otherwise also i 1 and i k would be connected through a path in G, which contradicts d-separation). It can neither be of the form as this would entail a chain in G of the same form, which would again violate the d-separation assumption. As a result, the chain inḠ must contain a type IV structure and is therefore blocked. The other direction follows similarly, we omit the details.
(2) Every chain (i 1 , n 1 ) Ḡ . . . Ḡ (i k , n k ) with i 1 ∈ V 1 and i k ∈ V 2 induces a chain i 1 G . . . G i k in G, where consecutive copies of a vertex are understood as merged to a single vertex. By assumption, this chain in G must be blocked by V 0 and therefore contain at least one blocking structure of type I-IV. If a blocking structure of type I, II or III is present, say, with middle vertex i j , then i j ∈ V 0 and the corresponding sequence in the original chain inḠ must contain a structure of the same type with some middle vertex (i j , n) and some n ∈ [N i j ], hence blocking the chain inḠ. Similarly, for the last remaining case, if the chain in G has a blocking structure of type IV, say, again with middle node i j , then V 0 neither contains i j nor any of its descendants. Since this immediately implies that {(i, n) : i ∈ V 0 , n ∈ [N i ]} and {(i, n) : i = i j or i ∈ de G (i j ), n ∈ [N i ]} are disjoint, and the original chain inḠ necessarily has a type IV structure with some middle vertex (i j , n) and some n ∈ [N i j ], it is blocked by Proof of Proposition 4.4.
(1) is obviously true. In (2) the statement for the absolute systemic impact follows from the definition, while it follows from (4) for the relative systemic impact.
(3) is a well-known result, see Proposition 4.2 and the following remark in Levin et al. (2009). Next, (4) is a consequence of an elementary inequality: If a/b and c/d are bounded by M , then also (a + c)/(b + d). Therefore, the maximum in (4.4) is attained on J. Finally, for (5) we notice that if I 2 and J are d-separated in G given I 1 , then {(i, N i ) : i ∈ I 2 } and {(j, N j ) : j ∈ J} are d-separated inḠ given {(i, n) : i ∈ I 1 , n ∈ [N i ]}. Since observing S I 1 = 0 means S in = 0 for all i ∈ I 1 and n ∈ [N i ], the claim follows from the fact that d-separation entails independence in Bayesian networks. 2