Package fGarch
Pierre Chaussé
pierre.chausse at uqam.ca
Wed Apr 22 05:24:35 CEST 2009
Hi,
I am writing a guide for my financial econometrics class and I found a
mistake in the method predict() that comes with the package fGarch. It
does not predict correctly because it does not use the predict.Arima
method correctly. In arima() the constant term is not an intercept but a
mean. For exemple, if we have the following AR(1) process:
X(t) = 6 + 0,9 X(t-1) + e(t)
What arima() calls "intercept" is not the 6 but the mean of X which is
6/(1-0,9)=60. So if we know the model and want to predict it, we can,
as it is done in methods-predict.R that comes in fGarch, create an arima
object and use predict() on it. But we have to provide the mean and not
the intercept. For our exemple we can do:
ARIMA = arima(x,order=c(1,0,0),init=(0,9,60),optim.control=list(maxit=0))
and
predict(ARIMA,n.ahead)
The problem is that garchFit() computes the intercept and not the mean
(which I thing it is better) and when we apply predict() on the object
that it creates, it provides the intercept to arima() instead of the mean.
In line 128 of methods-predict.R, you should replace mu by the mean
which is mu/(1-sum_of_ar_coef).
One more thing. Since fGarch computes conditional variance, why the
predict() method does not compute the conditional mean square errors of
the prediction instead of the unconditional ones. In finance, the former
would be more appropriate.
Thank you
Pierre Chaussé
Université du Québec à Montréal
http://www.er.uqam.ca/nobel/k34115/
More information about the Rmetrics-core
mailing list