View source: R/backtest_functions.R
esr_backtest | R Documentation |
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)
)
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) \Sexpr[results=rd]{tools:::Rd_expr_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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.