I would like to put you the other question that I have about how to use
loops for in R. The first is entitled “Loop For – ARMA model estimation
and selection”. If you take a look and try to give me an answer to the
first, I would be extremely thankful. I am an R beginner and I need R
technical experts’ judgement to conduct my empirical analysis as
efficiently as I can.
My second question is on how to loop over six variables (a,b,c,d,e) for
an ARMA+GARCH model estimation.
Here is the function to loop.
modelfit<-ugarchfit(spec=model, data=USDlogreturns, solver="hybrid")
Here is a description of the variables from a to f to be looped.
·ARMA orders (a,b). Both orders should be allowed to vary between 0 and 10.
·GARCH version (c). The versions should be allowed to switch from GARCH
to AVGARCH, GJRGARCH, TGARCH, NGARCH, NAGARCH, APARCH and EGARCH. Note
that the EGARCH version must be passed directly as “model” to the
·GARCH orders (d,e). The d order should be allowed to vary between 1 and
2. The e order should be allowed to vary between 0 and 2.
·Error distribution (f). The error distribution should be allowed to
switch from Normal Gaussian to Student-T and GED.
The objects to be returned from the loop are the model Akaike
Information Criterion indicators, the p-values of the ADF test for
standardized (stz) residual stationarity, the p-values of the Box-Ljung
tests for stz residual serial uncorrelation and independence and the
p-values of the Jarque-Bera test for stz residual normality. Here is the
full list of the objects.
P.S. How do you tell R to set (d+e) (i.e. the sum of ARCH and GARCH
orders) as fitdf in the Box-Ljung test command? Is it right as I typed?
If you also believe that I should run the same model estimation in a
simpler and efficient way, let me know on how to do that.
Thank you in advance.
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
[[alternative HTML version deleted]]
R-SIG-Finance@r-project.org mailing list
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should