Skip to content

Commit

Permalink
* Fix typo in parameter documentation.
Browse files Browse the repository at this point in the history
* Don't require parameter "q" in esr_backtest when backtest version is 1 or 3.
  • Loading branch information
BayerSe committed May 1, 2020
1 parent dfca3b2 commit 356cd03
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 31 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: esback
Type: Package
Title: Expected Shortfall Backtesting
Version: 0.2.1
Date: 2020-01-20
Version: 0.2.2
Date: 2020-05-01
Authors@R: c(person('Sebastian', 'Bayer', email='[email protected]', role=c('aut', 'cre')),
person('Timo', 'Dimitriadis', email='[email protected]', role='aut'))
Description: Backtests forecasts of the expected shortfall risk measure, see Bayer and Dimitriadis (2019) <arXiv:1801.04112>.
Expand All @@ -11,4 +11,4 @@ Encoding: UTF-8
LazyData: true
Depends: R(>= 2.10.0)
Imports: esreg
RoxygenNote: 7.0.2
RoxygenNote: 7.1.0
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.2.2 [2020-05-01]
* Fix typo in parameter documentation.
* Don't require parameter "q" in esr_backtest when backtest version is 1 or 3.

# 0.2.1
* Adjust estimation of the intercept ESR backtest

Expand Down
10 changes: 9 additions & 1 deletion R/backtest_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,15 @@ cc_backtest <- function(r, q, e, s=NULL, alpha, hommel=TRUE) {
#' @md
esr_backtest <- function(r, q, e, alpha, version, B = 0,
cov_config=list(sparsity='nid', sigma_est='scl_sp', misspec=TRUE)) {
data <- data.frame(r = r, q = q, e = e)
if (missing(q) & version %in% c(2)) {
stop('You need to supply VaR forecast `q` for backtest version ', version)
}

if (missing(q)) {
data <- data.frame(r = r, e = e)
} else {
data <- data.frame(r = r, q = q, e = e)
}

# Set the details for the selected version of the backtest
if (version == 1) {
Expand Down
10 changes: 5 additions & 5 deletions R/utility_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#'
#' Defines commonly used parameters.
#'
#' @param r A vector of returns
#' @param q A vector of expected shortfall forecasts
#' @param e A vector of Value-at-Risk forecasts
#' @param s A vector of volatility forecasts
#' @param alpha Scalar probability level in (0, 1)
#' @param r A vector of returns.
#' @param q A vector of Value-at-Risk forecasts.
#' @param e A vector of Expected Shortfall forecasts.
#' @param s A vector of volatility forecasts.
#' @param alpha Scalar probability level in (0, 1).
#' @param B Number of bootstrap samples. Set to 0 to disable bootstrapping.
#' @keywords internal
parameter_definition <- function(r, q, e, s, alpha) {}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# esback

The esback can be used to [backtest](https://en.wikipedia.org/wiki/Backtesting)
[expected shortfall](https://en.wikipedia.org/wiki/Expected_shortfall) forecasts.
The esback can be used to [backtest](https://en.wikipedia.org/wiki/Backtesting) forecasts of the
[expected shortfall](https://en.wikipedia.org/wiki/Expected_shortfall) risk measure.

## Installation

Expand All @@ -19,7 +19,7 @@ You can install the development version using these commands:

## Implemented Backtests

These backtests are implemented:
This packahed implements the following backtests:

* Expected Shortfall Regression Backtest ([Bayer & Dimitriadis, 2019])
* Exceedance Residuals Backtest ([McNeil & Frey, 2000])
Expand Down
10 changes: 5 additions & 5 deletions man/cc_backtest.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/er_backtest.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/esr_backtest.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions man/parameter_definition.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/risk_forecasts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 356cd03

Please sign in to comment.