Package 'SystemicR'

Title: Monitoring Systemic Risk
Description: The past decade has demonstrated an increased need to better understand risks leading to systemic crises. This framework offers scholars, practitioners and policymakers a useful toolbox to explore such risks in financial systems. Specifically, this framework provides popular econometric and network measures to monitor systemic risk and to measure the consequences of regulatory decisions. These systemic risk measures are based on the frameworks of Adrian and Brunnermeier (2016) <doi:10.1257/aer.20120555> and Billio, Getmansky, Lo and Pelizzon (2012) <doi:10.1016/j.jfineco.2011.12.010>.
Authors: Jean-Baptiste Hasse [aut, cre]
Maintainer: Jean-Baptiste Hasse <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2024-11-17 03:39:35 UTC
Source: https://github.com/cran/SystemicR

Help Index


State variables

Description

This dataset includes state variables data extracted from the FRED. Specifically, it includes data on credit spread, liquidity spread, yield spread, 3M Treasury bill and VIX.

Usage

data("data_state_variables")

Format

A data frame with 5030 observations on the following 7 variables.

Date

a date vector

CRESPR

a numeric vector

LIQSPR

a numeric vector

YIESPR

a numeric vector

TBR3M

a numeric vector

RESI

a numeric vector

VIX

a numeric vector

Source

Federal Reserve Economic Data (FRED) St. Louis Fed

References

Hasse, Jean-Baptiste. "Systemic Risk: a Network Approach". AMSE Working Paper (2020) Hasse, Jean-Baptiste, and Quentin Lajaunie. "Does the Yield Curve Signal Recessions? New Evidence from an International Panel Data Analysis." AMSE Working Paper (2020).

Examples

data("data_state_variables")
head(data_state_variables)

Financial institutions (banks, insurers and asset managers) stock returns

Description

This dataset includes state variables data extracted from the FRED and Yahoo Finance. Specifically, it includes dates, MSCI STOXX Europe 600 Index returns and banks, insurers and asset managers stock returns.

Usage

data("data_stock_returns")

Format

A data frame with 5030 observations on the following 74 variables.

ACKB.BB.Equity

a numeric vector

AGN.NA.Equity

a numeric vector

AGS.BB.Equity

a numeric vector

AIBG.ID.Equity

a numeric vector

ALV.GY.Equity

a numeric vector

AV..LN.Equity

a numeric vector

BALN.SE.Equity

a numeric vector

BARC.LN.Equity

a numeric vector

BBVA.SQ.Equity

a numeric vector

BIRG.ID.Equity

a numeric vector

BKT.SQ.Equity

a numeric vector

BNP.FP.Equity

a numeric vector

BPE.IM.Equity

a numeric vector

CBG.LN.Equity

a numeric vector

CBK.GY.Equity

a numeric vector

CNP.FP.Equity

a numeric vector

CS.FP.Equity

a numeric vector

CSGN.SE.Equity

a numeric vector

DANSKE.DC.Equity

a numeric vector

DBK.GY.Equity

a numeric vector

DNB.NO.Equity

a numeric vector

Date

a date vector

EBS.AV.Equity

a numeric vector

EMG.LN.Equity

a numeric vector

G.IM.Equity

a numeric vector

GBLB.BB.Equity

a numeric vector

GLE.FP.Equity

a numeric vector

HELN.SE.Equity

a numeric vector

HNR1.GY.Equity

a numeric vector

HSBA.LN.Equity

a numeric vector

HSX.LN.Equity

a numeric vector

ICP.LN.Equity

a numeric vector

III.LN.Equity

a numeric vector

INDUA.SS.Equity

a numeric vector

INGA.NA.Equity

a numeric vector

INVEB.SS.Equity

a numeric vector

ISP.IM.Equity

a numeric vector

JYSK.DC.Equity

a numeric vector

KBC.BB.Equity

a numeric vector

KINVB.SS.Equity

a numeric vector

KN.FP.Equity

a numeric vector

KOMB.CK.Equity

a numeric vector

LGEN.LN.Equity

a numeric vector

LLOY.LN.Equity

a numeric vector

LUNDB.SS.Equity

a numeric vector

MAP.SQ.Equity

a numeric vector

MB.IM.Equity

a numeric vector

MF.FP.Equity

a numeric vector

MUV2.GY.Equity

a numeric vector

NDA.SS.Equity

a numeric vector

NXG.LN.Equity

a numeric vector

OML.LN.Equity

a numeric vector

PARG.SE.Equity

a numeric vector

PRU.LN.Equity

a numeric vector

RBS.LN.Equity

a numeric vector

RF.FP.Equity

a numeric vector

RSA.LN.Equity

a numeric vector

SAMPO.FH.Equity

a numeric vector

SAN.SQ.Equity

a numeric vector

SCR.FP.Equity

a numeric vector

SDR.LN.Equity

a numeric vector

SEBA.SS.Equity

a numeric vector

SHBA.SS.Equity

a numeric vector

SLHN.SE.Equity

a numeric vector

SREN.SE.Equity

a numeric vector

STAN.LN.Equity

a numeric vector

STB.NO.Equity

a numeric vector

STJ.LN.Equity

a numeric vector

SWEDA.SS.Equity

a numeric vector

SXXP.Index

a numeric vector

SYDB.DC.Equity

a numeric vector

UBSG.SE.Equity

a numeric vector

UCG.IM.Equity

a numeric vector

ZURN.SE.Equity

a numeric vector

Source

Federal Reserve Economic Data (FRED) St. Louis Fed and Yahoo Finance

References

Hasse, Jean-Baptiste. "Systemic Risk: a Network Approach". AMSE Working Paper (2020)

Examples

data("data_stock_returns")
head(data_stock_returns)

Dynamic systemic risk measures from correlation-based networks.

Description

This function provides methods to compute dynamic systemic risk measures from correlation-based networks.

Usage

f_correlation_network_measures(df_data_returns)

Arguments

df_data_returns

A dataframe including dates and stock returns

Value

Degree

xts vector

Closeness_Centrality

xts vector

Eigenvector_Centrality

xts vector

SR

xts vector

Volatility

xts vector

Author(s)

Jean-Baptiste Hasse

References

Hasse, Jean-Baptiste. "Systemic Risk: a Network Approach". AMSE Working Paper (2020)

Examples

# Scale the entries of a vector to the interval [0,1]

# NOT RUN {


  # Load data
  data("data_stock_returns")

  # Compute topological risk measures from correlation-based financial networks
  l_result <- f_correlation_network_measures(data_stock_returns)

  # Plot SR_t
  f_plot(l_result$SR)



# }

Computing static CoVaR and Delta CoVaR

Description

This function computes the CoVaR and the Delta CoVaR of a given financial institution i for a given quantile q.

Usage

f_CoVaR_Delta_CoVaR_i_q(df_data_returns)

Arguments

df_data_returns

A dataframe including data: dates and stock returns

Value

CoVaR_i_q

A numeric matrix

Delta_CoVaR_i_q

A numeric vector

Author(s)

Jean-Baptiste Hasse

References

Adrian, Tobias, and Markus K. Brunnermeier. "CoVaR". American Economic Review 106.7 (2016): , 106, 7, 1705-1741.

Examples

# Scale the entries of a vector to the interval [0,1]

# NOT RUN {


  # Load data
  data("data_stock_returns")

  # Compute CoVaR_i_q and Delta_CoVaR_i_q
  f_CoVaR_Delta_CoVaR_i_q(data_stock_returns)



# }

Computing dynamic CoVaR and Delta CoVaR

Description

This function computes the dynamic CoVaR and the Delta CoVaR of a given financial institution i for a given quantile q at time t. The dynamic and aggregate Delta CoVaR is also computed.

Usage

f_CoVaR_Delta_CoVaR_i_q_t(df_data_returns, df_data_state_variables)

Arguments

df_data_returns

A dataframe including data: dates and stock returns

df_data_state_variables

A dataframe including data: dates and macroeconomic variables

Value

CoVaR_i_q_t

A xts matrix

Delta_CoVaR_i_q_t

A xts matrix

Delta_CoVaR_t

A xts vector

Author(s)

Jean-Baptiste Hasse

References

Adrian, Tobias, and Markus K. Brunnermeier. "CoVaR". American Economic Review 106.7 (2016): , 106, 7, 1705-1741.

Examples

# Scale the entries of a vector to the interval [0,1]

# NOT RUN {


  # Load data
  data("data_stock_returns")
  data("data_state_variables")


  # Compute CoVaR_i_q_t , Delta_CoVaR_i_q_t and Delta_CoVaR_t
  l_result <- f_CoVaR_Delta_CoVaR_i_q_t(data_stock_returns, data_state_variables)

  # Plot Delta_CoVaR_t
  f_plot(l_result$Delta_CoVaR_t)



# }

Plot dynamic risk measures

Description

This function provides a framework to plot xts time series.

Usage

f_plot(xts_index_returns)

Arguments

xts_index_returns

A xts vector

Value

No return value, called for side effects

Author(s)

Jean-Baptiste Hasse

Examples

# Plot a xts vector

# NOT RUN {


  # Generate data returns
  v_returns <- numeric(10)
  v_returns <- rnorm(10, 0, 0.01)
  v_date <- seq(from = as.Date("2019-01-01"), to = as.Date("2019-10-01"), by = "month")
  xts_returns <- xts(v_returns, order.by = v_date)

  # Plot the xts vector of simulated returns
  f_plot(xts_returns)


# }

Rescale

Description

This function normalizes data to 0-1 range. Specifically, this function computes linearly rescaled values from a vector of numeric values.

Usage

f_scale(v_time_series)

Arguments

v_time_series

Vector of numeric values

Value

A vector of numeric normalized values

Author(s)

Jean-Baptiste Hasse

References

Hasse, Jean-Baptiste. "Systemic Risk: a Network Approach". AMSE Working Paper (2020)

Examples

# Scale the entries of a vector to the interval [0,1]

# NOT RUN {


  # Generate data
  v_data <- numeric(10)
  v_data <- c(1, 5, 3, 2, 15, 12, 9, 11, 7, 13)

  # Rescale data
  v_rescaled_data <- numeric(10)
  v_rescaled_data <- f_scale(v_data)

  # print rescaled data
  print(v_rescaled_data)


# }