Learn R Programming

riskR (version 1.1)

risk.roll: Computes risk measures through rolling scheme

Description

Computes risk measures (StD, VaR, EL, ELD, ES, SDR, EVaR, DEVaR, ENT, DENT, ML) from empirical data using a rolling estimation window.

Usage

risk.roll(x, N = length(x) - 1, alpha = c(0.05), beta = 1, p = 2)

Arguments

x
a vector of observations.
N
an integer representing estimation window size. Very small values are not recommended.
alpha
a vector of probabilities for significance level.
beta
a positive risk aversion parameter.
p
a positive value for the power of deviation terms.

Value

An array with values for each risk measure at all probabilities of interest for every point of the rolling scheme.

Examples

Run this code
## computes risk measures for SP500 using one year of daily data.

data(returns)
s <- returns[, 2]
risk.roll(s, 250, c(0.01, 0.05))

Run the code above in your browser using DataLab