Description
Expected Shortfall Backtesting.
Description
Implementations of the expected shortfall backtests of Bayer and Dimitriadis (2020) <doi:10.1093/jjfinec/nbaa013> as well as other well known backtests from the literature. Can be used to assess the correctness of forecasts of the expected shortfall risk measure which is e.g. used in the banking and finance industry for quantifying the market risk of investments. A special feature of the backtests of Bayer and Dimitriadis (2020) <doi:10.1093/jjfinec/nbaa013> is that they only require forecasts of the expected shortfall, which is in striking contrast to all other existing backtests, making them particularly attractive for practitioners.
README.md
esback
The esback can be used to backtest forecasts of the expected shortfall risk measure.
Installation
CRAN (stable release)
You can install the released version from CRAN via:
install.packages("esback")
GitHub (development)
The latest version of the package is under development at GitHub. You can install the development version using these commands:
install.packages("devtools")
devtools::install_github("BayerSe/esback", ref = "master")
Implemented Backtests
This package implements the following backtests:
- Expected Shortfall Regression Backtest (Bayer & Dimitriadis, 2020)
- Exceedance Residuals Backtest (McNeil & Frey, 2000)
- Conditional Calibration Backtest (Nolde & Ziegel, 2017)
Examples
# Load the esback package
library(esback)
# Load the data
data(risk_forecasts)
# Plot the returns and expected shortfall forecasts
plot(risk_forecasts$r, xlab = "Observation Number", ylab = "Return and ES forecasts")
lines(risk_forecasts$e, col = "red", lwd = 2)
# Backtest the forecast using the ESR test
esr_backtest(r = risk_forecasts$r, e = risk_forecasts$e, alpha = 0.025, version = 1)