VaR.gpd {VaR} | R Documentation |
Estimation of Value at Risk from log-likelihood fit of GPD.
VaR.gpd(ydat, p = 0.01, p.tr = 0.97, drift.appx = FALSE, init = c(1, 0.3), cflevel = 0.95)
ydat |
Numeric vector of data for which VaR is to be calculated. |
p |
Confidence level for VaR calculation. |
p.tr |
Threshold for GPD fit. |
drift.appx |
Logical; if TRUE VaR is calculated in non-zero drift approximation. |
init |
Initial values for log-likelihood fit of GPD. |
cflevel |
Confidence level for estimation of VaR and ES intervals. |
This function estimates Value at Risk and Expected Shortfall of a single risk factor with a given confidence by using a fit of Generalized
Pareto Distribution to the part of data exceeding a given threshold (Peak over Threshold (POT) Method). The input data transformed
to procentual daily return. Then, transformed data is sorted and only part exceeding a given threshold is hold. Threshold is calculated
according an expression p.tr*std
. Log-likelihood fit is then applied to get values of VaR and ES. After that, confidence
intervals for this values are calculated (see reference for details).
A list containing following components:
VaR |
Value at Risk for input data. |
VaR.interval |
Lower and higher bounds of VaR estimation with confidence given by parameter cflevel . |
ES |
Expected shortfall. |
ES.interval |
Lower and higher bounds of ES estimation with confidence given by parameter cflevel . |
data |
Same as ydat . |
cdata |
Vector of data used for GPD fit. |
conf.level |
Same as p . |
tr |
Same as p.tr . |
mean |
Mean value of cdata . |
std |
Standard deviation of cdata . |
gfit |
Best fit values of GPD. |
int.conf.level |
Same as cflevel . |
T. Daniyarov
Embrechts, P., Kluepelberg, C., and Mikosch, T. (1999) Modelling Extremal Events for Insurance and Finance. Application of Mathematics. Springer. 2nd ed. (1st ed., 1997)
data(exchange.rates) attach(exchange.rates) y <- USDJPY[!is.na(USDJPY)] z <- VaR.gpd(y) z$VaR z$VaR.interval z$ES z$ES.interval detach(exchange.rates)