Examples / GARCHM_UV_DUMMY.RPF |
GARCHM_UV_DUMMY.RPF is an example of a univariate GARCH-M model with a dummy shift in the "M" effect and the variance.
It is based upon a model from Sun and Tong(2010), with a (very) different data set. This is for illustration—the January effect isn't present in this data set.
The regressors (that is, explanatory variables for the mean of the process) are constant, one lag of the dependent variable, the shift dummy, the GARCH generated variance (standard "M" effect, which is handled by using the %GARCHV variable) and the interaction between the variance and the dummy. The only complication here is the interaction term. That's included in the regressor list as the series HDUMMY, which is generated as part of the function evaluation using the HADJUST option on GARCH. This HADJUST formula multiplies DUMMY(T) times the saved variance (HH(T)) and puts the result into entry T of HDUMMY. HADJUST gets done first in an evaluation (since the variance depends upon previous period's information), so the correct value of HDUMMY is available for evaluating the mean model.
The XREGRESSORS option is used to allow the shift dummy to be included in the variance calculation as well.
set hdummy = 0.0
*
garch(p=1,q=1,reg,xreg,hseries=hh,hadjust=%(hdummy=dummy(t)*hh(t))) / dlogdm
# constant dlogdm{1} dummy %garchv hdummy
# dummy
Full Program
open data garch.asc
data(format=free,org=columns) 1 1867 bp cd dm jy sf
*
set dlogdm = 100*log(dm/dm{1})
*
* This is for illustration
*
* This is the dummy which governs the shift
*
set dummy = %clock(t,260)<=22
*
* This is the interaction "M" term (variance x dummy), which is
* generated on the fly using the HADJUST option.
*
set hdummy = 0.0
*
garch(p=1,q=1,reg,xreg,hseries=hh,hadjust=%(hdummy=dummy(t)*hh(t))) / dlogdm
# constant dlogdm{1} dummy %garchv hdummy
# dummy
Output
Note that this isn't from the original paper, and, with this data set, none of the three dummy coefficients is significant.
GARCH Model - Estimation by BFGS
Convergence in 29 Iterations. Final criterion was 0.0000003 <= 0.0000100
Dependent Variable DLOGDM
Usable Observations 1865
Log Likelihood -2058.7076
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant -0.101411134 0.031975677 -3.17151 0.00151649
2. DLOGDM{1} -0.084791658 0.025317356 -3.34915 0.00081059
3. DUMMY 0.034260676 0.113320096 0.30234 0.76239640
4. GARCH-V 0.166074438 0.058141241 2.85640 0.00428480
5. HDUMMY -0.096286935 0.209371139 -0.45989 0.64559778
6. C 0.014909481 0.004625889 3.22305 0.00126833
7. A 0.108194679 0.015150361 7.14139 0.00000000
8. B 0.872653560 0.017050119 51.18167 0.00000000
9. DUMMY -0.002780460 0.008792508 -0.31623 0.75182745
Copyright © 2025 Thomas A. Doan