powered by
Computes Value at Risk and Expected Shortfall by means of plain and age- weighted historical simulation
hs(x, p = 0.95, method = c("age", "plain"), lambda = 0.98)
a numeric vector of asset returns
confidence level for VaR calculation; default is 0.95%
method to be used for calculation; default is 'plain'
decay factor for the calculation of weights; default is 0.98
Returns a list with the following elements:
Calculated Value at Risk
Calculated Expected Shortfall
# NOT RUN { prices <- DAX30$price.close returns <- diff(log(prices)) hs(x = returns, p = 0.95, method = 'plain') hs(x = returns, p = 0.95, method = 'age', lambda = 0.98) # }
Run the code above in your browser using DataLab