value_at_risk: Value at Risk

Description Usage Arguments Examples

Description

Estimate a various parameteric and non-parametric value at risk measures

Usage

1

Arguments

data

a dataframe of returns

...

unquoted column names to use in computation

alpha

1 - confidence level

method

the method for computing VAR

weighting

a function for weighting returns

params

a list of named parameters for specific methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# compute 5% VaR for the corporate portfolio
portfolio_returns %>%
  filter(portfolio == "corporate") %>%
  value_at_risk(
    returns,
    alpha = 0.05,
    method = "historical simulation"
  )

# Compute 1% VaR for each portfolio
portfolio_returns %>%
  group_by(portfolio) %>%
  value_at_risk(
    returns,
    alpha = 0.01,
    method = "historical simulation",
    weighting = weight_vol(decay = 0.01)
  )

dandermotj/mmr documentation built on June 4, 2019, 9:26 p.m.