This functions allows for the calculation of loss functions for the selection of models.
lossfunc(obj = list(Loss =NULL, ES =NULL), beta =1e-04)
Arguments
obj: a list that contains the following elements:
Loss: a numeric vector that contains the values of a loss series ordered from past to present; is set to NULL by default
ES: a numeric vector that contains the estimated values of the ES for the same time points of the loss series Loss; is set to NULL by default
Please note that a list returned by the varcast function can be directly passed to lossfunc.
beta: a single numeric value; a measure for the opportunity cost of capital; default is 1e-04.
Returns
an S3 class object, which is a list of
loss.func1: Regulatory loss function.
loss.func2: Firm's loss function following Sarma et al. (2003).
loss.func3: Loss function following Abad et al. (2015).
loss.func4: Feng's loss function. A compromise of regulatory and firm's loss function.
Details
Given a negative return series obj$Loss, the corresponding Expected Shortfall (ES) estimates obj$ES and a parameter beta that defines the opportunity cost of capital, four different definitions of loss functions are considered.
Let K be the number of observations and rt the observed return series. Following Sarma et al. (2003)
lt,1={ESt(α)+rt}2,
if −rt>ESt(α)
lt,1=β∗ESt(α),
otherwise,
is a suitable loss function (firm's loss function), where β is the opportunity cost of capital. The regulatory loss function is identical to the firm's loss function with the exception of lt,1=0 for −rt≤ESt(α).
Abad et al. (2015) proposed another loss function
lt,a={ESt(α)+rt}2,
if −rt>ESt(α)
lt,a=β∗(ESt(α)+rt),
otherwise,
that, however, also considers opportunity costs for rt>0. An adjustment has been proposed by Feng. Following his idea,
lt,2={ESt(α)+rt}2,
if −rt>ESt(α)
lt,2=β∗min{ESt(α)+rt,ESt(α)},
otherwise,
should be considered as a compromise of the regulatory and the firm's loss functions. Note that instead of the ES, also a series of Value-at-Risk values can be inserted for the argument obj$ES. However this is not possible if a list returned by the varcast function is directly passed to lossfunc.
Examples
# Example for Walmart Inc. (WMT)prices <- WMT$price.close
output <- varcast(prices)Loss <--output$ret.out
ES <- output$ES
loss.data <- list(Loss = Loss, ES = ES)lossfunc(loss.data)# directly passing an output object of 'varcast()' to 'lossfunc()'x <- WMT$price.close
output <- varcast(prices)lossfunc(output)
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.
Sarma, M., Thomas, S., & Shah, A. (2003). Selection of Value-at-Risk models. Journal of Forecasting, 22(4), 337-358.
Author(s)
Sebastian Letmathe (Scientific Employee) (Department of Economics, Paderborn University)
Dominik Schulz (Scientific Employee) (Department of Economics, Paderborn University),