Hi everyone,

As a followup on my three fitted garch questions;

Yes indeed, if I give the estimated coefficients of fgarch.fitted as initial
values to garch() the results are much more inline with each other:

> coef(garch(na.omit(r), order = c(1,1),
control=garch.control(start=c(1.3705e-06,8.1789e-02,9.0995e-01))))

 ***** ESTIMATION WITH ANALYTICAL GRADIENT *****


     I     INITIAL X(I)        D(I)

     1     1.370500e-06     1.000e+00
     2     8.178900e-02     1.000e+00
     3     9.099500e-01     1.000e+00

    IT   NF      F         RELDF    PRELDF    RELDX   STPPAR   D*STEP
NPRELDF
     0    1 -1.093e+04
     1   13 -1.093e+04  4.54e-09  1.67e-08  1.1e-09  4.3e+13  2.1e-09
 3.63e+05
     2   24 -1.093e+04 -1.30e-14  2.64e-14  8.1e-15  1.6e+00  1.5e-14
-1.22e-03

 ***** FALSE CONVERGENCE *****

 FUNCTION    -1.093479e+04   RELDX        8.076e-15
 FUNC. EVALS      24         GRAD. EVALS       2
 PRELDF       2.641e-14      NPRELDF     -1.222e-03

     I      FINAL X(I)        D(I)          G(I)

     1    1.372553e-06     1.000e+00    -1.965e+04
     2    8.178900e-02     1.000e+00     2.046e+00
     3    9.099500e-01     1.000e+00    -1.478e+01

          a0           a1           b1
1.372553e-06 8.178900e-02 9.099500e-01

Very nice, thank you!

Now only question 2 and 3 remain a mystery to me.

Kind regards,

-Mark-

2010/11/4 Patrick Burns <patrick@burns-stat.com>

> Taking Alexios' advice will probably
> help, but I wouldn't be surprised if
> they are still not the same.  The
> garch likelihood is extremely tricky
> to optimize -- specialized optimizers
> would be the ideal.
>
> Assuming you can give starting values
> to the optimizer in both cases, you can
> give the other's answer to each and see
> what happens.
>
>
> On 04/11/2010 21:02, alexios wrote:
>
>> The default for fGarch::garchFit is to estimate the mean, assuming a
>> non-zero mean dataset is passed, as can be seen from the returned "mu"
>> parameter ( a call to 'args(garchFit)' should highlight the
>> 'include.mean' argument ). The default for tseries garch is to assume
>> zero mean data.
>>
>> Demean the data before passing to tseries garch by the estimated 'mu'
>> value from 'fgarch.fitted' and you should obtain closer results.
>>
>> -Alexios
>>
>>
>>
>> On 11/4/2010 8:44 PM, Mark Breman wrote:
>>
>>> Hi everyone,
>>>
>>> I'm trying to predict volatility using a garch(1,1) model and I'm running
>>> into some interesting issues I cannot find an answer for.
>>>
>>> Suppose I have the following code:
>>>
>>> library(quantmod)
>>> library(tseries)
>>> library(fGarch)
>>>
>>> # get some returns
>>> r = dailyReturn(Ad(getSymbols("SPY", from="2000-01-01", to="2010-11-04",
>>> auto.assign=F)))
>>>
>>> # fit models
>>> garch.fitted = garch(na.omit(r), order = c(1,1))
>>> fgarch.fitted = fGarch::garchFit(~ garch(1,1), data = as.zoo(na.omit(r)),
>>> trace = FALSE)
>>>
>>> Now if I look at the values of the coefficients for both fitted models
>>> they
>>> are not the same:
>>>
>>>  coef(garch.fitted)
>>>>
>>>           a0           a1           b1
>>> 1.339912e-06 8.165689e-02 9.101754e-01
>>>
>>>> coef(fgarch.fitted)
>>>>
>>>           mu        omega       alpha1        beta1
>>> 4.990616e-04 1.370880e-06 8.307080e-02 9.086447e-01
>>>
>>> Q1) Why are they different? What do I have to change to make the
>>> coefficient
>>> values of fgarch.fitted the same as garch.fitted?
>>>
>>> If I try to predict the volatility with: predict(garch.fitted) I get the
>>> "conditional standard deviation predictions" (an interval) for every
>>> period
>>> return in r.
>>>
>>> Q2) Is this a 1 period prediction (i.e. the volatility prediction for the
>>> next day)? How do I get a prediction for let's say 2 periods in the
>>> future?
>>>
>>>
>>> If I use predict(fgarch.fitted) I get:
>>>
>>>  predict(fgarch.fitted)
>>>>
>>>    meanForecast   meanError standardDeviation
>>> 1  0.0004990616 0.006677350       0.006677350
>>> 2  0.0004990616 0.006751925       0.006751925
>>> 3  0.0004990616 0.006825079       0.006825079
>>> 4  0.0004990616 0.006896859       0.006896859
>>> 5  0.0004990616 0.006967315       0.006967315
>>> 6  0.0004990616 0.007036491       0.007036491
>>> 7  0.0004990616 0.007104428       0.007104428
>>> 8  0.0004990616 0.007171167       0.007171167
>>> 9  0.0004990616 0.007236745       0.007236745
>>> 10 0.0004990616 0.007301198       0.007301198
>>>
>>> Q3) Why is the meanForecast for all 10 future periods the same?
>>>
>>> Thanks,
>>>
>>> -Mark-
>>>
>>>
>>>
>>> predict(garch)
>>>
>>>        [[alternative HTML version deleted]]
>>>
>>> _______________________________________________
>>> R-SIG-Finance@stat.math.ethz.ch mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>>> -- 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 go.
>>>
>>>
>>>
>> _______________________________________________
>> R-SIG-Finance@stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- 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 go.
>>
>>
> --
> Patrick Burns
> patrick@burns-stat.com
> http://www.burns-stat.com
> http://www.portfolioprobe.com/blog
>
>
> _______________________________________________
> R-SIG-Finance@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- 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 go.
>

	[[alternative HTML version deleted]]

