This folder rebuild the model in the paper: Contagion in Financial Networks by Prasanna Gai.
Even this work is open to evryone, some rights are reserved. For any other usage please contact the author.
This script can create certain networks and initialize it to let it suitable for analyses. It can build:
- ER network;
- BA network;
- SBM network under the condition that pcc = pcp;
- SBM network under the condition that ppp = pcp;
- Build from the file.
The initialization of a network will give the edges a weight, depends on the number of nieghbors and the setting of interbank liabilities.
This script can test the nodes whether bankrupt. There have two types of bankrupt:
-
Directly bankrupt due to the point neighbor (the neighbor have links point to this node) bankrupt;
-
Indirectly bankrupt that recieve liabilities from more than one bankrupt banks that exceed the capital buffer.
This scipt contains functions to simulate the bankrupt with one randomly initally credit event. The initial bankrupt point will be randomly chosen or choose the biggest connectted bank.
The loops is stopped when there is no more bank bankrupt in the system.
This script contains the functions to make simple plot, or the raw code to plot the beautiful figure.
These scripts will do the test on a certain type of network models to do some various analyses. The results are shown below here: