[R-SIG-Finance] Problem with garch (tseries)

michael mathews muckjail at yahoo.com
Thu Aug 17 16:52:22 CEST 2006


Hi folks,
I have been playing with garch models to model the volatility in
physical natural prices. 
Here is the issue I have a dataset of 801 daily returns (attached).
If I run

garchall<-garch(hsc)

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


> summary(garchall)

Call:
garch(x = hsc)

Model:
GARCH(1,1)

Residuals:
    Min      1Q  Median      3Q     Max 
-4.3424 -0.5734  0.0000  0.6037  4.0501 

Coefficient(s):
    Estimate  Std. Error  t value Pr(>|t|)    
a0 2.507e-05   9.200e-06    2.726  0.00642 ** 
a1 1.218e-01   2.085e-02    5.840 5.21e-09 ***
b1 8.759e-01   1.937e-02   45.212  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

Diagnostic Tests:
        Jarque Bera Test

data:  Residuals 
X-squared = 62.7291, df = 2, p-value = 2.387e-14


        Box-Ljung test

data:  Squared.Residuals 
X-squared = 0.0384, df = 1, p-value = 0.8447

Now if we run the same model on a subset say the last 351 days we get
> garch351<-garch(tail(hsc,351))

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


> summary(garch351)

Call:
garch(x = tail(hsc, 351))

Model:
GARCH(1,1)

Residuals:
      Min        1Q    Median        3Q       Max 
-4.171521 -0.424628  0.008727  0.532158  3.962116 

Coefficient(s):
    Estimate  Std. Error  t value Pr(>|t|)    
a0 2.511e-05   1.589e-05    1.580 0.114167    
a1 1.043e-01   2.950e-02    3.536 0.000406 ***
b1 8.957e-01   2.567e-02   34.896  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

Diagnostic Tests:
        Jarque Bera Test

data:  Residuals 
X-squared = 76.3704, df = 2, p-value < 2.2e-16


        Box-Ljung test

data:  Squared.Residuals 
X-squared = 1.2806, df = 1, p-value = 0.2578

still ok. Now finally we get t the point of this email lets look at 352
days of data:

garch352<-garch(tail(hsc,352))

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


Warning message:
NaNs produced in: sqrt(pred$e) 
> summary(garch352)

Call:
garch(x = tail(hsc, 352))

Model:
GARCH(1,1)

Residuals:
     Min       1Q   Median       3Q      Max 
-4.16377 -0.58155  0.01454  0.70886 12.41242 

Coefficient(s):
    Estimate  Std. Error  t value Pr(>|t|)    
a0 2.428e-05   1.556e-05    1.561 0.118632    
a1 1.043e-01   2.947e-02    3.540 0.000400 ***
b1 8.962e-01   2.556e-02   35.058  < 2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 

Diagnostic Tests:
        Jarque Bera Test

data:  Residuals 
X-squared = 10993.57, df = 2, p-value < 2.2e-16


        Box-Ljung test

data:  Squared.Residuals 
X-squared = 0.1831, df = 1, p-value = 0.6687

whats up? Any Ideas. 
I have also tried using garchFit from the fSeries package but it locks
up completely left it running last night and it was still spinning this
morning when I got back to the office.

thanks in advance

michael



More information about the R-SIG-Finance mailing list