Skip to content
Prev 11581 / 15274 Next

rugarch VaR calculation "manually"

Thanks a lot for your help, ok, I added the signature in my mail and
the r sig list accout.

But to be honest neither I am not really understanding you nor are
your hints helping me. From someone other, I was told to use the
following code to get what I want:

(I add my model here specification again, so you do not have to search
in my posts before)

-----------------------------------------------------------------------------------
library(rugarch)
alvdatemod<-alvdate[-1]
alvgarchdata<-data.frame(alvlloss,row.names=alvdatemod)

alvnomodel<-ugarchspec(variance.model = list(model = "sGARCH",
garchOrder = c(1, 1)),
mean.model = list(armaOrder = c(0, 0), include.mean = FALSE),
distribution.model = "norm")

alvnomodelgarch<-ugarchfit(spec=alvnomodel,data=alvgarchdata)
#plot(alvnomodelgarch)
-------------------------------------------------------------------------------------


and here comes the relevant part:


spec = getspec(alvnomodelgarch);
setfixed(spec) <- as.list(coef(alvnomodelgarch));
forecast = ugarchforecast(spec, n.ahead = 1, n.roll = 2579, data =
alvgarchdata[1:2580, ,drop=FALSE], out.sample = 2579);
sigma(forecast);
fitted(forecast)


I get the (german) error message after the sigma command:
Fehler in UseMethod("sigma") :
  nicht anwendbare Methode f?r 'sigma' auf Objekt der Klasse
"c('uGARCHforecast', 'GARCHforecast', 'rGARCH')" angewendet

And the forecast specification is also not what I want, if you just
look at forecast, you will see, that again I just got one value, this
is NOT what I want!

Also, I am not understanding why I have to use this n.roll number and
this out.sample number. Also, why can't I just use my dataset, but
instead use [1:2580, ,drop=FALSE] ? But these are just some smaller
unimportant questions.



Later on, I want to calculate the VaR and compare it to the quantile
method, therefore I would continue with the following idea, first,
calculate VaR:

VaR=fitted(forecast)+sigma(forecast)*qnorm(0.99)

and then compare it to the quantile method:

quantile(forecast,probs=0.99)

but it seemed, that I also did a syntax error here.


2013/5/8 alexios ghalanos <alexios at 4dscape.com>:
--
Neumann, Conrad