View source: R/gets-base-source.R
ES | R Documentation |
Extract the in-sample conditional Value-at-Risk, or the in-sample conditional Expected Shortfall for the chosen risk level(s).
ES(object, level=0.99, type=7, ...)
VaR(object, level=0.99, type=7, ...)
object |
an |
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) |
A vector or matrix containing either the conditional Value-at-Risk (VaR) or the conditional Expected Shortfall (ES) for the chosen risk level(s).
Genaro Sucarrat, http://www.sucarrat.net/
arx
, getsm
, getsv
##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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.