hs | R Documentation |
Computes Value at Risk and Expected Shortfall (Conditional Value at Risk) by means of plain and age-weighted historical simulation.
hs(x, p = 0.975, method = c("age", "plain"), lambda = 0.98)
x |
a numeric vector of asset returns |
p |
confidence level for VaR calculation; default is |
method |
method to be used for calculation; default is |
lambda |
decay factor for the calculation of weights; default is |
Returns a list with the following elements:
Calculated Value at Risk
Calculated Expected Shortfall (Conditional Value at Risk)
Confidence level for VaR calculation
prices <- DAX$price_close
returns <- diff(log(prices))
hs(x = returns, p = 0.975, method = 'plain')
hs(x = returns, p = 0.975, method = 'age', lambda = 0.98)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.