Estimating and Validating GARCH-Based Value at Risk
Summary
The document reviews an R workflow for fitting an ARMA mean and a GARCH(1,1) volatility model with a skewed Student distribution, then calculating value at risk for two return series. Its response clarifies that the quantile of fitted model results represents VaR associated with observed data rather than a forecast intended for predictive evaluation. Forecasting requires producing volatility forecasts, and the sign or tail must match the loss convention: for a lower-tail return VaR, the relevant quantile is the lower rather than upper tail.
For assessment, the response recommends plotting returns alongside their VaR estimates and measuring how often returns breach the threshold. The observed failure frequency should be near the selected tail probability, while formal checks can include conditional and unconditional coverage tests and dynamic quantile tests. Loss functions offer another way to compare models. These are practical diagnostic suggestions, not a worked validation: the document supplies no fitted results, backtest period, or evidence that the chosen model is adequate. VaR quality depends on the forecast setup, tail definition, and evaluation sample.
Key ideas
- A quantile computed from fitted observations is not by itself a forecast evaluation.
- Use the lower return tail when estimating downside VaR under the usual loss convention.
- Plot returns with their VaR series to inspect breaches over time.
- Compare the observed VaR breach frequency with the targeted tail probability.
- Coverage tests, dynamic quantile tests, and loss functions provide additional model checks.
Tags
Full text
# Issues in estimating VaR with GARCH
# Issues in estimating VaR with GARCH
I am currently trying to figure out how to estimate the value at risk using the rugarch package in R. I've come to a result, but it seems a bit excessive. Here's my code:
```
install.packages("PerformanceAnalytics")
install.packages("fGarch")
install.packages("rugarch")
library(fGarch)
library(PerformanceAnalytics)
library(rugarch)
#Daten runterladen
db<- get.hist.quote(instrument = "DB", start = "2005-11-21",
quote = "AdjClose")
sys<- get.hist.quote(instrument = "^STOXX50E", start = "2005-11-21",
quote = "AdjClose")
#Returns
retdb<-diff(log(db))
retsys<-diff(log(sys))
#GARCH-Modell spezifizieren
spec2 = ugarchspec(variance.model = list(model = "sGARCH", garchOrder = c(1, 1),
submodel = NULL,
external.regressors = NULL,
variance.targeting = FALSE),
mean.model=list(armaOrder=c(1,0)),
distribution.model="sstd"
)
#GARCH-Modell fitten
fit<-ugarchfit(spec=spec2,
data=retdb)
fit2<-ugarchfit(spec=spec2,
data=retsys)
#var berechnen
var1<-quantile(fit,0.99)
var1sys<-quantile(fit2,0.99)
#plot var
plot(var1)
lines(var1sys,col="red")
```
And this the image I'm getting (red-->Eurostoxx VaR, black--> DB VaR):
And, to be honest, I'm lacking the experience if this reasonable or not...
Thanks in advance, Richard
## Answer by simmy (score 3, accepted)
https://quant.stackexchange.com/a/25947
1) You are computing the "actual" VaR, in the sense that you are not forecasting it to see if your VaR model is able to estimate it, but you are just computing the VaR that "has taken place". To obtain a volatility forecast (either in-sample or out-of-sample) you can use the "ugarchforecast" function.
2) I think you are estimating the VaR on the wrong side of the distribution: you take the 0.99 quantile instead of the 0.01 one.
3) A more meaningful plot is the one with your returns series together with the respective VaRs: there, you can see with your eyes how it behaves.
4) Count the number of failures of your VaR (number of times the return process exceeds you VaR) and divide it by the number of observations, to get the Failure Rate: it should be near 0.01 (more generally, near the desired coverage level, such as your 0.01; other common levels are 0.005, 0.05 or 0.1)
5) There are a lot of other tests to check if your model is good in VaR estimation: Dynamic Quantile Test, Conditional and Unconditional coverage tests; other measures are various Loss Functions, (for example, the firm Loss Function), to compare various models performances. In This working paper you can find a comparison between various techniques to compute VaR (GARCH too) and numerous tests and comparison methods.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.