RATS 10.1
RATS 10.1

GARCHFLUX.RPF is an example of the Nyblom fluctuations test (@FLUX procedure) for a GARCH model.
 

The data set is a long set of daily exchange rate data. The series being looked at in particular is the return on USD/Yen exchange rate (in US cents per yen).
 

all 6237

open data g10xrate.xls

data(format=xls,org=columns) / usxjpn

set x = 100.0*log(usxjpn/usxjpn{1})

 

This estimates a simple GARCH(1,1) model and saves the SERIES[VECT] of derivatives with respect to the four parameters into DD.

 

garch(p=1,q=1,derives=dd) / x

 

The fluctuations test is done with

 

@flux(title="Full Sample Fluctuations Test")

# dd

 

The test rejects stability of the model with strong signs of problems with the 2nd (C, the variance constant) and the 4th (B, the "GARCH" recursion parameter).

 

The following takes a closer look at the cumulated gradient for the C parameter (parameter #2, thus the DD(2) as the series being accumulated).

 

acc dd(2) / fluxstat

graph(footer="Cumulated Gradient for Variance Intercept")

# fluxstat

 

If there are no breaks, this should be (when rescaled) a "Brownian Bridge" (Brownian motion tied to zero at both ends), which should wander around zero. The fact that the graph drops rather sharply for the first 1200 or so observations, then climbs back to zero indicates that the gradient is consistently negative at the start of the sample and consistently positive after that, suggesting that the first (roughly 20%) of the data needs a much lower value for this parameter than the remainder.

 

A possible fix for this could be to put a dummy "x" regressor for the first part of the sample. In this case (since the data series is so long anyway), we simply re-estimated with the last roughly 5000 data points. The estimates over that range pass the stability test.

 

garch(p=1,q=1,derives=ddx) 1200 * x

@flux(title="Partial Sample Fluctuations Test")

# ddx

Full Program


all 6237
open data g10xrate.xls
data(format=xls,org=columns) / usxjpn
*
* Convert to percent daily returns
*
set x = 100.0*log(usxjpn/usxjpn{1})
*
* Estimate the GARCH model and save the derivatives.
*
garch(p=1,q=1,derives=dd) / x
*
*
@flux(title="Full Sample Fluctuations Test")
# dd
*
* Closer examination of the variance intercept (coefficient 2). If there
* are no breaks, this should be (when rescaled) a "Brownian Bridge"
* (Brownian motion tied to zero at both ends),  which should wander
* around zero. The fact that it drops rather sharply for the first 1200
* or so observations, then climbs back to zero indicates that the
* gradient is consistently negative at the start of the sample and
* consistently positive after that, suggesting that the first (roughly
* 20%) of the data needs a much lower value for this parameter than the
* remainder.
*
acc dd(2) / fluxstat
graph(footer="Cumulated Gradient for Variance Intercept")
# fluxstat
*
* While it would be possible to adjust the model to add an XREG dummy
* for the first part of the sample, given the size of the data set,
* simply dropping those first data points probably makes more sense.
*
* The estimation is redone, as is the fluctuation test, which this time
* passes.
*
garch(p=1,q=1,derives=ddx) 1200 * x
@flux(title="Partial Sample Fluctuations Test")
# ddx
 

Output

GARCH Model - Estimation by BFGS

Convergence in    21 Iterations. Final criterion was  0.0000073 <=  0.0000100
 

Dependent Variable X

Usable Observations                      6236

Log Likelihood                     -5395.4384

 

    Variable                        Coeff      Std Error      T-Stat      Signif

************************************************************************************

1.  Mean(X)                      0.0001874860 0.0064882445      0.02890  0.97694733

2.  C                            0.0074286000 0.0011069601      6.71081  0.00000000

3.  A                            0.1762880839 0.0118295404     14.90236  0.00000000

4.  B                            0.8372689759 0.0095560716     87.61644  0.00000000


 

Test  Statistic  P-Value

Joint 4.09116676    0.00
 

    1 0.24517082    0.19

    2 1.66136406    0.00

    3 0.04668753    0.89

    4 1.58874753    0.00


 

GARCH Model - Estimation by BFGS

Convergence in    20 Iterations. Final criterion was  0.0000056 <=  0.0000100

 

Dependent Variable X

Usable Observations                      5038

Log Likelihood                     -4904.5992
 

    Variable                        Coeff      Std Error      T-Stat      Signif

************************************************************************************

1.  Mean(X)                      0.0061185000 0.0089472787      0.68384  0.49407671

2.  C                            0.0203813644 0.0038910711      5.23798  0.00000016

3.  A                            0.0709745019 0.0086000641      8.25279  0.00000000

4.  B                            0.8840516487 0.0153647353     57.53771  0.00000000


 

Test  Statistic  P-Value

Joint 0.89561642    0.19

 

    1 0.17863166    0.30

    2 0.06327809    0.78

    3 0.09359658    0.60

    4 0.05819142    0.82

Graphs


 


Copyright © 2024 Thomas A. Doan