Learn R Programming

gets (version 0.38)

ES: Conditional Value-at-Risk (VaR) and Expected Shortfall (ES)

Description

Extract the in-sample conditional Value-at-Risk, or the in-sample conditional Expected Shortfall for the chosen risk level(s).

Usage

ES(object, level=0.99, type=7, ...)
VaR(object, level=0.99, type=7, ...)

Value

A vector or matrix containing either the conditional Value-at-Risk (VaR) or the conditional Expected Shortfall (ES) for the chosen risk level(s).

Arguments

object

an arx or gets object

level

the risk level(s), must be between 0 and 1

type

the method used to compute the empirical quantiles of the standardised residuals

...

arguments passed on (currently not used)

Author

Genaro Sucarrat, http://www.sucarrat.net/

See Also

arx, getsm, getsv

Examples

Run this code
##generate random variates, estimate model:
y <- rnorm(50)
mymodel <- arx(y, arch=1)

##extract 99% expected shortfall:
ES(mymodel)

##extract 99%, 95% and 90% expected shortfalls:
ES(mymodel, level=c(0.99, 0.95, 0.9))

##extract 99% value-at-risk:
VaR(mymodel)

##extract 99%, 95% and 90% values-at-risk:
VaR(mymodel, level=c(0.99, 0.95, 0.9))

Run the code above in your browser using DataLab