[R] garch in tseries
Spencer Graves
spencer.graves at pdf.com
Wed May 3 18:19:11 CEST 2006
Dear Erin:
The documentation for my currently installed version of
garchFit{fSeries} indicates that the default include.mean = TRUE.
How do you know "it didn't work"? With the default include.mean =
TRUE, the following took just under a minute on my IBM T-30 notebook:
library(fSeries)
# Load Time Series:
data(sp500dge)
# Vector of Compounded Returns:
x <- diff(sp500dge[,1])
# Vector of Percentage Compounded Returns:
X = 100*x
fit = garchFit(~arma(0,1), ~garch(1,1), series = X)
Moreover, print(fit) included a parameter 'mu' whose names suggests
that it is a mean that might not bre estimated if 'include.mean = FALSE'.
However, when I tried it, it went into an apparent infinite loop,
which I killed after ~15-20 minutes:
fit0 = garchFit(~arma(0,1), ~garch(1,1), series = X,
include.mean=FALSE)
I got a similar potentially infinite loop from the following:
fit2 = garchFit(~arma(0,1), ~garch(1,1), series = X+100)
However, the following converged and estimated mu at 0.1000, as
simulated:
fit.1 = garchFit(~arma(0,1), ~garch(1,1), series = X+0.1)
Conclusion: The code seems to work as documented, sometimes.
Unfortunately, it appears to have a disturbing affinity for an apparent
infinite loop, and I don't have the time now to diagnose it further.
hope this helps.
spencer graves
Erin Hodgess wrote:
> Hello again!
>
> Is there a way to include a mean in the garch function in the
> library(tseries), please?
>
> I tried include.mean=T in the function statement but it didn't work
>
> thanks in advance!
>
> R Version 2.2.1 Windows
> Sincerely,
> Erin
> mailto: hodgess at gator.uhd.edu
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
More information about the R-help
mailing list