Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

quarks (version 1.0.2)

vwhs: Volatility weighted historical simulation

Description

Calculates univariate Value at Risk and Expected Shortfall by means of volatility weighted historical simulation. Volatility is estimated with an exponentially weighted moving average.

Usage

vwhs(x, p = 0.95, lambda = 0.94)

Arguments

x

a numeric vector of asset returns

p

confidence level for VaR calculation; default is 0.95%

lambda

decay factor for the calculation of weights; default is 0.94

Value

Returns a list with the following elements:

VaR

Calculated Value at Risk

ES

Calculated Expected Shortfall

Examples

Run this code
# 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