SystemicRisk
A framework for financial systemic risk valuation and analysis.
Install / Use
/learn @TommasoBelluzzo/SystemicRiskREADME
Systemic Risk
This framework calculates, analyses and compares the following systemic risk measures:
- BUBBLES DETECTION MEASURES
BUB (Bubbles Flag)BMPH (Boom Phases Flag)BRPH (Burst Phases Flag)BC (Bubbling Capitalization)BCP (Bubbling Capitalization Percentage)- References: Phillips et al. (2015), Phillips & Shi (2018), Phillips & Shi (2019), Brunnermeier et al. (2020)
- COMPONENT MEASURES
AR (Absorption Ratio)by Kritzman et al. (2010)CATFINby Allen et al. (2012)CS (Correlation Surprise)by Kinlaw & Turkington (2012)TI (Turbulence Index)by Kritzman & Li (2010)Principal Component Analysis
- CONNECTEDNESS MEASURES
DCI (Dynamic Causality Index)CIO ("In & Out" Connections)CIOO ("In & Out - Other" Connections)Network Centralities: Betweenness, Degree, Closeness, Clustering, Eigenvector & Katz- References: Billio et al. (2011)
- CROSS-ENTROPY MEASURES
JPoD (Joint Probability of Default)FSI (Financial Stability Index)PCE (Probability of Cascade Effects)DiDe (Distress Dependency)SI (Systemic Importance)SV (Systemic Vulnerability)CoJPoDs (Conditional Joint Probabilities of Default)- References: Segoviano & Goodhart (2009), Radev (2012), Segoviano & Espinoza (2017), Cortes et al. (2018)
- CROSS-QUANTILOGRAM MEASURES
Full Cross-QuantilogramsPartial Cross-Quantilograms- References: Han et al. (2016)
- CROSS-SECTIONAL MEASURES
Idiosyncratic Metrics: Beta, Value-at-Risk & Expected ShortfallCAViaR (Conditional Autoregressive Value-at-Risk)by White et al. (2015)CoVaR & Delta CoVaR (Conditional Value-at-Risk)by Adrian & Brunnermeier (2008)MES (Marginal Expected Shortfall)by Acharya et al. (2010)SES (Systemic Expected Shortfall)by Acharya et al. (2010)SRISK (Conditional Capital Shortfall Index)by Brownlees & Engle (2010)
- DEFAULT MEASURES
D2C (Distance To Capital)by Chan-Lau & Sy (2007)D2D (Distance To Default)by Vassalou & Xing (2004)DIP (Distress Insurance Premium)by Black et al. (2012)SCCA (Systemic Contingent Claims Analysis)by Jobst & Gray (2013)
- LIQUIDITY MEASURES
ILLIQ (Illiquidity Measure)by Amihud (2002)RIS (Roll Implicit Spread)by Hasbrouck (2009)Classic Indicators: Hui-Heubel Liquidity Ratio, Turnover Ratio & Variance Ratio
- REGIME-SWITCHING MEASURES
2-States Model: High & Low Volatility3-States Model: High, Medium & Low Volatility4-States Model: High & Low Volatility With CorrectionsAP (Average Probability of High Volatility)JP (Joint Probability of High Volatility)- References: Billio et al. (2010), Abdymomunov (2011)
- SPILLOVER MEASURES
SI (Spillover Index)Spillovers From & ToNet Spillovers- References: Diebold & Yilmaz (2008), Diebold & Yilmaz (2012), Diebold & Yilmaz (2014)
- TAIL DEPENDENCE MEASURES
ACHI (Average Chi)by Balla et al. (2014)ADR (Asymptotic Dependence Rate)by Balla et al. (2014)FRM (Financial Risk Meter)by Mihoci et al. (2020)
Some of the aforementioned models have been improved or extended according to the methodologies described in the V-Lab Documentation, which represents a great source of systemic risk measurement.
The project has been published in "MATLAB Digest | Financial Services | May 2019".
If you found it useful to you, please consider making a donation to support its maintenance and development:
Requirements
The minimum required MATLAB version is R2014b. In addition, the following products and toolboxes must be installed in order to properly execute the script:
- Computer Vision System Toolbox
- Curve Fitting Toolbox
- Econometrics Toolbox
- Financial Toolbox
- Image Processing Toolbox
- Optimization Toolbox
- Parallel Computing Toolbox
- Statistics and Machine Learning Toolbox
- System Identification Toolbox
Usage
- Create a properly structured database (see the section below).
- Execute one of the following scripts (they can be edited following your needs and criteria):
run.mto perform the computation of systemic risk measures;analyze.mto analyze previously computed systemic risk measures.
Dataset
Datasets must be built following the structure of default ones included in every release of the framework (see Datasets folder). Below a list of the supported Excel sheets and their respective content:
-
Shares: prices or returns expressed in logarithmic scale of the benchmark index (the column can be labeled with any desired name and must be placed just after observation dates) and the firms, with daily frequency.
-
Volumes: trading volume of the firms expressed in currency amount, with daily frequency.
-
Capitalizations: market capitalization of the firms, with daily frequency.
-
CDS: the risk-free rate expressed in decimals (the column must be called
RFand must be placed just after observation dates) and the credit default swap spreads of the firms expressed in basis points, with daily frequency. -
Balance Sheet Components: the balance sheet components of the firms expressed in omogeneous observations frequency, currency and scale, structured as below:
- Assets: the book value of assets.
- Equity: the book value of equity.
- Separate Accounts: the separate accounts of insurance firms.
-
State Variables: systemic state variables, with daily frequency.
-
Groups: group definitions are based on three-value tuples where the
Namefield represents the group names, theShort Namefield represents the group acronyms and theCountfield represents the number of firms to include in the group. The sum of theCountfields must be equal to the number of firms. For example, the following groups definition:Firms in the Shares Sheet: A, B, C, D, E, F, G, H
Insurance Companies: 2
Investment Banks: 2
Commercial Banks: 3
Government-sponsored Enterprises: 1produces the following outcome:
"Insurance Companies" contains A and B
"Investment Banks" contains C and D
"Commercial Banks" contains E, F and G
"Government-sponsored Enterprises" contains H -
Crises: crises can be defined using two different approaches:
- By Events: based on two-value tuples where the
Datefield represents the event dates and theNamefield represents the event names; every dataset observation matching an event date is considered to be associated to a distress occurrence. - By Ranges: based on three-value tuples where the
Namefield represents the crisis names, theStart Datefield represents the crisis start dates and theEnd Datefield represents the crisis end dates; every dataset observation falling inside a crisis range is considered to be part of a distress period.
- By Events: based on two-value tuples where the
Notes
-
The minimum allowed dataset must include the
Sharessheet with a benchmark index and at least3firms. Observations must have a daily frequency and, in order to run consistent calculations, their minimum required amount is253for prices (which translates into a full business year plus an additional observation at the beginning of the time series, lost during the computation of returns) or252for logarithmic returns. They must have been previously validated and preprocessed by:- discarding illiquid series (unless necessary);
- detecting and removing outliers;
- removing rows with NaNs or filling the gaps through interpolation.
-
It is not mandatory to include financial time series used by unwanted measures. Optional financial time series used by included measures can be omitted, as long as their contribution isn't necessary. Below a list of required and optional time series for each category of measures:
- Bubbles Detection Measures:
- Required: shares (prices).
- Optional: none.
- Component Measures:
- Required: shares (any).
- Optional: none.
- Connectedness Measures:
- Required: shares (any).
- Optional: groups.
- Cross-Entropy Measures:
- Required: shares (any), cds.
- Optional:
- Bubbles Detection Measures:

