Learn R Programming

fEGarch (version 1.0.1)

loss_functions,fEGarch_risk-method: Loss Function Calculation

Description

Compute loss function values given log-returns and corresponding value at risk (VaR) and expected shortfall (ES) series.

Usage

# S4 method for fEGarch_risk
loss_functions(object, penalty = 1e-04, ...)

Value

Returns a list with the four elements rlf, flf, alf and clf, each lists with numeric vector elements VaR and ES. The four elements correspond to the regulatory loss function, the firm's loss function, the adjusted loss function and the corrected loss function.

Arguments

object

an object of class "fEGarch_risk" as returned by the model fitting functions of this package, for example fEGarch.

penalty

the penalty term to use in the opportunity cost terms.

...

currently without use.

Details

Let \(n \in \mathbb{N}\) be the number of observations of a (log-)return series \(\{r_t\}\), \(t=1,\dots,n\), and let \(\text{VaR}_t\) and \(\text{ES}_t\) be the estimated or forecasted VaR and ES (at some confidence level \(\alpha\)) at time \(t\), respectively. Such series are included in an object of class "fEGarch_risk". In the following, a risk measure at time \(t\) is simply denoted by \(\text{RM}_t\) and can either mean \(\text{VaR}_t\) or \(\text{ES}_t\).

Based on a calculated VaR and / or expected shortfall (ES), capital needs to be held back following regulatory rules. Commonly, among many models used for forecasting risk measures that fulfill regulatory conditions, loss functions are computed that also consider opportunity costs in to assess, what model that fulfills regulatory rules minimizes such loss functions. Let \(\Omega \geq 0\) be the penalty term.

For all loss functions we have $$\text{LF}_i = \sum_{t=1}^{n} l_{t,i}, \hspace{3mm} i = 0,1,2,3,$$ as the loss function with $$l_{t,i} = (\text{RM}_t - r_t)^2, \hspace{3mm} i = 0,1,2,3,$$ for \(r_t < \text{RM}_t\). They differ in how the case \(r_t \geq \text{RM}_t\) is treated.

The regulatory loss function (rlf) uses \(l_{t,0} = 0\).

The firm's loss function (Sarma et al., 2003) (flf) considers \(l_{t,1}=\Omega |\text{RM}_t|\).

The adjusted loss function (Abad et al., 2015) (alf) makes use of \(l_{t,2} = \Omega |\text{RM}_t - r_t|\).

The corrected loss function (Feng, forthcoming) (clf) has \(l_{t,3} = \Omega \text{min}\left(|\text{RM}_t - r_t|, |\text{RM}_t|\right)\).

References

  • Abad, P., Muela, S. B., & Martín, C. L. (2015). The role of the loss function in value-at-risk comparisons. The Journal of Risk Model Validation, 9(1): 1-19. DOI: 10.21314/JRMV.2015.132.

  • Sarma, M., Thomas, S., & Shah, A. (2003). Selection of Value-at-Risk models. Journal of Forecasting, 22(4): 337-358. DOI: 10.1002/for.868.

Examples

Run this code
window.zoo <- get("window.zoo", envir = asNamespace("zoo"))
rt <- window.zoo(SP500, end = "2002-12-31")
model <- fEGarch(egarch_spec(), rt, n_test = 250)
fcast <- predict_roll(model)
risk <- measure_risk(fcast, measure = c("VaR", "ES"), level = c(0.95, 0.975, 0.99))
loss_functions(risk)

Run the code above in your browser using DataLab