3

I am somewhat new to R and am currently stuck with the following problem:

I have two variables, $X$ and $Y$.

In the first step I do a GARCH(1,1) fit on $Y$. In the second step I would like to input $X$ as an exogenous variable into the model. Afterwards it would be useful if I could compare both models (the goodness of the respective fit) by AIC and BIC, and if possible save the residuals for both models.

As far as I know rugarch would be the correct package to use. Could anybody perhaps be so kind to help me with the code - please :) This way I would have a working example and could build on it and learn from it.

Glen_b
  • 257,508
  • 32
  • 553
  • 939
Probabilitnator
  • 131
  • 1
  • 2
  • You might need to program your own. I don't think rugarch allows for exogeneous variables. Not sure if any of the other packages do. – John Apr 16 '13 at 19:43
  • hmm I found this: ?? [link]http://stats.stackexchange.com/questions/45482/how-to-estimate-garch-in-r-exogenous-variables-in-mean-equation?rq=1 – Probabilitnator Apr 16 '13 at 19:55
  • still due to lack of coding experience in R i have no idea whether this is what I am looking for and how to read the code :( – Probabilitnator Apr 16 '13 at 19:55
  • It depends on what you really want. I was referring to exoegenous variables in conditional volatility equation, but most packages allow for exogeneous variables in the conditional mean. You need to spend more time thinking about what you actually want to model and if the basic packages are sufficient. – John Apr 16 '13 at 20:00
  • thank you very much jon - I am interested in the conditional mean ... at least right now later on I might want to get more sophisticated – Probabilitnator Apr 16 '13 at 20:11
  • Maybe just look at some R tutorials? I reckon it's a waste of time waiting for someone to tutor you here because I doubt anyone would. Get your hands dirty, there's lots of info on the net... – sashkello Apr 16 '13 at 23:28

1 Answers1

3

The package rugarch DOES allow exogenous variables in both the conditional mean AND conditional variance equations. There are numerous examples in the source package under the 'rugarch.tests' folder (specifically look at the rugarch.tests3.R file for this example, extracting information criteria etc).

For future reference, please post questions about rugarch to the R-SIG-FINANCE mailing list which is the appropriate forum for this package.

Glen_b
  • 257,508
  • 32
  • 553
  • 939
  • @user24608 If you want your posts to be signed, you need to register with the name you want to sign them with (presumably, "Alexios"). Then your name appears at the bottom right of your message (instead of a useless number like 'user24608'). – Glen_b Jun 20 '13 at 02:27