Title: | 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. |
Authors: | Sebastian Bayer [aut, cre], Timo Dimitriadis [aut] |
Maintainer: | Sebastian Bayer <[email protected]> |
License: | GPL-3 |
Version: | 0.3.1 |
Built: | 2025-02-24 03:01:25 UTC |
Source: | https://github.com/bayerse/esback |
The simple and general conditional calibration backtests of Nolde & Ziegel (2007).
cc_backtest(r, q, e, s = NULL, alpha, hommel = TRUE)
cc_backtest(r, q, e, s = NULL, alpha, hommel = TRUE)
r |
A vector of returns. |
q |
A vector of Value-at-Risk forecasts. |
e |
A vector of Expected Shortfall forecasts. |
s |
A vector of volatility forecasts. |
alpha |
Scalar probability level in (0, 1). |
hommel |
If TRUE, use Hommels correction, otherwise use the classical Bonferroni correction. |
Returns a list with the following components:
pvalue_twosided_simple
pvalue_onesided_simple
pvalue_twosided_general
pvalue_onesided_general
Nolde & Ziegel (2007) doi:10.1214/17-AOAS1041
data(risk_forecasts) r <- risk_forecasts$r q <- risk_forecasts$q e <- risk_forecasts$e s <- risk_forecasts$s cc_backtest(r = r, q = q, e = e, s = s, alpha = 0.025)
data(risk_forecasts) r <- risk_forecasts$r q <- risk_forecasts$q e <- risk_forecasts$e s <- risk_forecasts$s cc_backtest(r = r, q = q, e = e, s = s, alpha = 0.025)
Tests whether the mean of the exceedance residuals, respectively the mean of the standardized exceedance residuals is zero.
er_backtest(r, q, e, s = NULL, B = 1000)
er_backtest(r, q, e, s = NULL, B = 1000)
r |
A vector of returns. |
q |
A vector of Value-at-Risk forecasts. |
e |
A vector of Expected Shortfall forecasts. |
s |
A vector of volatility forecasts. |
B |
Number of bootstrap iterations |
Returns a list with the following components:
pvalue_twosided_simple
pvalue_onesided_simple
pvalue_twosided_standardized
pvalue_onesided_standardized
McNeil & Frey (2000) doi:10.1016/S0927-5398(00)00012-8
data(risk_forecasts) r <- risk_forecasts$r q <- risk_forecasts$q e <- risk_forecasts$e s <- risk_forecasts$s er_backtest(r = r, q = q, e = e, s = s)
data(risk_forecasts) r <- risk_forecasts$r q <- risk_forecasts$q e <- risk_forecasts$e s <- risk_forecasts$s er_backtest(r = r, q = q, e = e, s = s)
The esback package contains functions for backtesting expected shortfall forecasts.
Maintainer: Sebastian Bayer [email protected]
Authors:
Timo Dimitriadis [email protected]
This function implements multiple expected shortfall regression (esreg)
based backtests.
Using the version
argument, the following backtests are available:
("Strict ESR") Regresses the returns on the expected shortfall forecasts and tests the ES coefficients for (0, 1).
("Auxiliary ESR") Regresses the returns on the quantile and the expected shortfall forecasts and tests the ES coefficients for (0, 1).
("Strict Intercept") Tests whether the expected shortfall of the forecast error r - e is zero.
esr_backtest( r, q, e, alpha, version, B = 0, cov_config = list(sparsity = "nid", sigma_est = "scl_sp", misspec = TRUE) )
esr_backtest( r, q, e, alpha, version, B = 0, cov_config = list(sparsity = "nid", sigma_est = "scl_sp", misspec = TRUE) )
r |
A vector of returns. |
q |
A vector of Value-at-Risk forecasts. |
e |
A vector of Expected Shortfall forecasts. |
alpha |
Scalar probability level in (0, 1). |
version |
Version of the backtest to be used |
B |
Number of bootstrap samples. Set to 0 to disable bootstrapping. |
cov_config |
a list with three components: sparsity, sigma_est, and misspec, see vcovA |
Returns a list with the following components:
pvalue_two_sided_asymptotic
pvalue_one_sided_asymptotic (for version 3)
pvalue_two_sided_bootstrap
pvalue_one_sided_bootstrap (for version 3)
Bayer & Dimitriadis (2020) doi:10.1093/jjfinec/nbaa013
data(risk_forecasts) r <- risk_forecasts$r q <- risk_forecasts$q e <- risk_forecasts$e esr_backtest(r = r, q = q, e = e, alpha = 0.025, version = 1)
data(risk_forecasts) r <- risk_forecasts$r q <- risk_forecasts$q e <- risk_forecasts$e esr_backtest(r = r, q = q, e = e, alpha = 0.025, version = 1)
A dataset containing the daily log returns and risk forecasts for the S&P 500 index. The quantile and expected shortfall forecasts are for the probability level 2.5%.
data(risk_forecasts)
data(risk_forecasts)
A data.frame with 4396 rows and 4 variables
Description of the variables:
Daily log returns from January 3, 2000 to September 29, 2017 (4465 days)
Value-at-Risk forecasts of the Historical Simulation approach
Expected shortfall forecasts of the Historical Simulation approach
Volatility forecasts of the Historical Simulation approach