Calculates univariate Value at Risk and Expected Shortfall by means of volatility weighted historical simulation. Volatility is estimated with an exponentially weighted moving average.
vwhs(x, p = 0.95, lambda = 0.94)
a numeric vector of asset returns
confidence level for VaR calculation; default is 0.95%
decay factor for the calculation of weights; default is 0.94
Returns a list with the following elements:
Calculated Value at Risk
Calculated Expected Shortfall
# NOT RUN {
prices <- DAX30$price.close
returns <- diff(log(prices))
vwhs(x = returns, p = 0.95, lambda = 0.94)
# }
Run the code above in your browser using DataLab