# Research Discussion Paper – RDP 2018-01 A Density-based Estimator of Core/Periphery Network Structures: Analysing the Australian Interbank Market

February 2018

## Supplementary Information

### Read me file

#### Description:

This ‘read me’ file contains details of the Matlab scripts used to generate the results reported in RDP 2018-01, and instructions on how to use the scripts.

Each of the scripts contains comments describing what the script does, what each part of the code does, the parameters that can be changed to suit different scenarios, any warnings with regards to these parameter changes, and descriptions of the data formats required when running the scripts with user-supplied data. We do not replicate these details in this document.

The two main scripts (RUN_stats.m and RUN_data.m) are designed to be run on arrays of unweighted-directed networks. So they can be run with any suitably-formatted Matlab data files containing unweighted-directed networks.

#### Data:

rdp-2018-01-graph-data.xls contains the publically available data used to plot the figures in this RDP. Only the data for Figures 6, 7 and C1 are available for public distribution.

RDP 2018-01 uses a loan-level dataset of interbank overnight cash market loans between 2005 and 2016. This dataset was constructed in Brassil, Hughson and McManus (2016). Since the dataset is constructed from a confidential data source, the resulting loan-level data are also confidential. Therefore, no data are provided with the replication codes.

#### Matlab scripts:

In this ‘read me’ document, the Matlab scripts are split into three groups: RUN scripts, figure plotting scripts, and functions. Matlab version R2017a was used to generate the results in the paper.

*RUN scripts:*

These are the scripts that are run by the user to replicate the analyses in RDP 2018-01. These scripts also contain the parameters that can be changed by the user, and the formats required for the data files if the user wants to run the analysis on their own data. Any Matlab toolboxes required by the scripts are detailed below.

- RUN_set_up_data.m – This script aggregates a loan-level dataset into a chosen frequency (quarterly, monthly, weekly, or daily). These aggregated data are used in later scripts. If your data is already aggregated, this script is not necessary. This script requires the ‘Finance’ and ‘Statistics and Machine Learning’ toolboxes.
- RUN_stats.m – This script calculates the summary statistics reported in Figure 1 and calls the script to plot Figure 1. This script requires the ‘Statistics and Machine Learning’ toolbox.
- RUN_data.m – This script estimates the core/periphery structures of an array of networks and reproduces figures 2, 3, 8, 9, 10, and 11. This script contains comments detailing the required format of the data files used by this script (so users can supply their own data). This script does not require any additional toolboxes.
- RUN_check_intermediation.m – This script is designed to be run on loan-level data. This script calculates the share of days in which each bank both lends and borrows in the market. This script replicates Figure F1. RUN_set_up_data.m and RUN_data.m must be run before running this script (this script will base its analysis on whichever frequency was used in RUN_set_up_data.m).

*Plotting scripts:*

These are the scripts that plot the figures in RDP 2018-01. Unless otherwise specified, these scripts are called by the RUN scripts.

- plot_figure_1.m
- plot_figures_2_3.m
- plot_figures_6_7.m – This script is not called by any of the RUN scripts and does not require any data files. This script runs numerical simulations to determine the accuracy of the estimators. Included in the script are multiple parameters the user can change to suit their circumstances.
- plot_figure_8.m
- plot_figure_9.m
- plot_figure_10.m
- plot_figure_11.m
- plot_figure_C1.m – This script is not called by any of the RUN scripts and does not require any data files. This script runs numerical simulations to determine the accuracy of the Density-based estimator relative to the Cucuringu et al (2016) estimator. Included in the script are multiple parameters the user can change to suit their circumstances.
- plot_figure_F1.m

*Functions:*

These are the scripts containing the functions used by the RUN scripts and plotting scripts.

- aggregateLoans.m – This function aggregates loan-level data. Available aggregation frequencies are quarterly, monthly, weekly, and daily.
- coreEst.m – This function estimates the core and periphery structures of a series of networks.
- DensIndex.m – This function computes density indices to analyse the changing relationships between the core and periphery (accounting for changes in the core and periphery).
- errorfn.m – This function constructs the error value of a given core/periphery split. This function has the ability to construct the error function values of four estimators: the Correlation estimator, Maximum Likelihood estimator, Density-based estimator, and Craig and von Peter (2014) estimator.
- getDegs.m – This function computes the degrees, normalised degrees, and log probabilities of a series of networks.
- getNetwork.m – This function constructs an adjacency matrix for each of the networks in the data.
- getNodes.m – This function classifies nodes as active/inactive. For any network, a node is active if it has at least one edge.
- getVols.m – This function constructs an array of aggregate loan values along each directional edge in each network.
- IntOptGlob.m – This function implements a greedy algorithm to find the minimum error function value. The algorithm starts from multiple randomly chosen starting points, finds the local optimum from each starting point, and picks the minimum from among these local optima.
- mrandi.m – This function constructs an m*n matrix of 1's and 0's. The 1's and 0's are placed randomly, with the number of 1's in the matrix equal to d*m*n.

#### Instructions for replication of RDP 2018-01:

*Formatting of data files*

If starting from a loan-level dataset, put the loan-level data in the format described in RUN_set_up_data.m and then run the RUN_set_up_data.m script.

Alternatively, if the data is already aggregated into an array of networks, put the aggregated data into the format described in RUN_data.m. Then run the RUN_stats.m and RUN_data.m scripts without running the RUN_set_up_data.m script.

*Initial statistics*

Run the RUN_stats.m script to produce Figure 1.

*Simulations*

Run the scripts below to replicate Figures 6, 7, and C1 in the paper:

- plot_figures_6_7.m (set ‘flag_dC=1’ to produce the top panel of the figures, ‘flag_dC=0’ to produce the bottom panel).
- plot_figure_C1.m

*Estimate core/periphery structure of networks*

Run the RUN_data.m script to produce Figures 2, 3, 8-11 (and associated statistics).

*Robustness checks (appendices E and F)*

Run the RUN_check_intermediation.m script to produce Figure F1. This script will base its analysis on whichever frequency was used in RUN_set_up_data.m. To ensure the correct frequency is used, run this script before replicating Figure E1.

To produce Figure E1:

- Set the ‘Flag’ parameter in RUN_data.m to zero.
- Set the ‘frequency’ parameter in RUN_set_up_data.m to ‘2’ for monthly.
- Run RUN_set_up_data.m then RUN_data.m.
- Save the third columns of the ‘coreSize_max’ and ‘coreSize_min’ matrices. These produce the ‘monthly’ lines in Figure E1. The corresponding dates (at the beginning of each month) can be found by running unique(loans_aggreg(:,1)).
- Set the ‘frequency’ parameter in RUN_set_up_data.m to ‘3’ for weekly.
- Run RUN_set_up_data.m then RUN_data.m.
- Save the third columns of the ‘coreSize_max’ and ‘coreSize_min’ matrices. These produce the ‘weekly’ lines in Figure E1. The corresponding dates (at the beginning of each week) can be found by running unique(loans_aggreg(:,1)).

- Supplementary information

- Download 324KB