FZLoss: Fissler and Ziegel (2016) (FZ) joint loss function for Value...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/BackTest.R

Description

This function implements Fissler and Ziegel (2016) (FZ) joint loss function for Value at Risk and Expected Shortfall.

Usage

1
FZLoss(data, VaR, ES, alpha)

Arguments

data

numeric Vector of observations.

VaR

numeric Vector containing the VaR series.

ES

numeric Vector containing the ES series.

alpha

numeric The VaR and ES confidence level.

Details

This function implements Fissler and Ziegel (2016) (FZ) joint loss function for Value at Risk and Expected Shortfall. The parameterization used is that of Patton et al. (2017) and is given by:

\frac{1}{α ES_t^α}I_t^α(y_t - VaR_t^α) + \frac{VaR_t^α}{ES_t^α} + \log{-ES_t^α} - 1.

See also Fissler et al. (2015).

Value

A numeric vector containing the joing VaR and ES loss values.

Author(s)

Leopoldo Catania

References

Fissler, T., Ziegel, J.F., (2016). "Higher order elicitability and Osband's principle." The Annals of Statistics 44, 1680-1707.
Fissler, T., Ziegel, J.F., Tilmann, G. (2015). "Expected Shortfall is jointly elicitable with Value at Risk - Implications for backtesting." arXiv preprint arXiv:1507.00244.
Patton, A. J., Ziegel, J.F., Chen, R. (2017). "Dynamic semiparametric models for expected shortfall (and Value-at-Risk)." arXiv preprint arXiv:1707.05108.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
data("StockIndices")

GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity",
                     GASPar = list(location = FALSE, scale = TRUE,
                                   shape = FALSE))

FTSEMIB = StockIndices[, "FTSEMIB"]

InSampleData  = FTSEMIB[1:1500]
OutSampleData = FTSEMIB[1501:2404]

Fit = UniGASFit(GASSpec, InSampleData)

Forecast = UniGASFor(Fit, Roll = TRUE, out = OutSampleData)

alpha = 0.05

vVaR = quantile(Forecast, alpha)
vES  = ES(Forecast, alpha)

FZ = FZLoss(OutSampleData, vVaR, vES, alpha)

GAS documentation built on Feb. 4, 2022, 5:12 p.m.