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:

- VaR
Calculated Value at Risk

- ES
Calculated Expected Shortfall (Conditional Value at Risk)

- p
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)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.