hs {quarks} | R Documentation |
Nonparametric calculation of univariate Value at Risk and Expected Shortfall
Description
Computes Value at Risk and Expected Shortfall (Conditional Value at Risk) by means of plain and age-weighted historical simulation.
Usage
hs(x, p = 0.975, method = c("age", "plain"), lambda = 0.98)
Arguments
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 |
Value
Returns a list with the following elements:
- VaR
Calculated Value at Risk
- ES
Calculated Expected Shortfall (Conditional Value at Risk)
- p
Confidence level for VaR calculation
Examples
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)
[Package quarks version 1.1.4 Index]