Learn R Programming

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:

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)

Copy Link

Version

Install

install.packages('esback')

Monthly Downloads

258

Version

0.3.1

License

GPL-3

Maintainer

Sebastian Bayer

Last Published

September 3rd, 2023

Functions in esback (0.3.1)

esback

esback: A package for backtesting expected shortfall forecasts
er_backtest

Exceedance Residuals Backtest
cc_backtest

Conditional Calibration Backtest
risk_forecasts

Returns and risk forecasts for the S&P 500 index
esr_backtest

Expected Shortfall Regression Backtest
parameter_definition

Parameter Definitions