Skip to content

Rewove/financial-contagion-in-R

Repository files navigation

financial-contagion-in-R

This folder rebuild the model in the paper: Contagion in Financial Networks by Prasanna Gai.

License

Even this work is open to evryone, some rights are reserved. For any other usage please contact the author.

Create Network

This script can create certain networks and initialize it to let it suitable for analyses. It can build:

  1. ER network;
  2. BA network;
  3. SBM network under the condition that pcc = pcp;
  4. SBM network under the condition that ppp = pcp;
  5. 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.

Judge Bankrupt

This script can test the nodes whether bankrupt. There have two types of bankrupt:

  1. Directly bankrupt due to the point neighbor (the neighbor have links point to this node) bankrupt;

  2. Indirectly bankrupt that recieve liabilities from more than one bankrupt banks that exceed the capital buffer.

Simultate Bankrupt

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.

Plot the Figure

This script contains the functions to make simple plot, or the raw code to plot the beautiful figure.

Other Names is the Network Models

These scripts will do the test on a certain type of network models to do some various analyses. The results are shown below here:

Releases

No releases published

Packages

 
 
 

Languages