*
* GARCHFLUX.RPF
* Example of use of fluctuation test for GARCH model
*
* RATS User's Guide, Example from Section 11.1.
*
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