I am interested in forecasting the mean of an intraday financial variable. There are 12 regularly spaced (timed) observations per day over a one year period (4380obs), which show strong intra-day seasonality, an autoregressive component and heteroskedacticity.
My approach was to model this as an ARMA process with GARCH errors.
I adopted the code of the Enders programming manual page 45/46 as below, but hit a wall in forecasting as the FORECAST command uses EQUATIONS and not FRMLs.
Code: Select all
CALENDAR(PERDAY=12)
ALL 365//12
DATA(FORMAT=XLS,ORG=COLUMNS) 1//1 365//12 High Low Volume Range LDRange Daytrend Mon Tue Wed Thu Fri one $
two three four five six seven eight nine ten eleven twelve Intratrend Timetrend
******* one two three etc….are intraday dummies for 12 half-hour time periods *****
set temp1 =0. ; set temp2 = 0.
nonlin a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 beta b0 b1 c1 b0.ge.0. $
b1.ge.0. c1.ge.0. b1+c1==1.
frml e = range - a1*one - a2*two - a3*three - a4*four - a5*five - a6*six $
- a7*seven - a8*eight - a9*nine - a10*ten - a11*eleven - a12*twelve $
- a13*range{1} - beta*temp1{1}
frml h = b0 + b1*e{1}**2 + c1*temp2{1}
frml L = (temp1 = e), (temp2 = h), -log(temp2) - (temp1)**2/h
box(regressors,noconstant,ar=1,ma=1) range
# one two three four five six seven eight nine ten eleven twelve
com a1=%beta(3), a2=%beta(4), a3=%beta(5), a4=%beta(6), a5=%beta(7), a6=%beta(8), a7=%beta(9), $
a8=%beta(10), a9=%beta(11), a10=%beta(12), a11=%beta(13), a12=%beta(14), a13=%beta(1), $
beta=%beta(2), b0=%seesq, b1=0.2, c1=0.5
max(method=simplex,iters=5) L 15 *
max(iters=200) L 15 * values
Have also tried a second approach as outlined on page 411 of the User Guide – the EQUATION option as below:
Code: Select all
boxjenk(noconstant,ar=1,ma=1,regressors,define=armaagain) range
# one two three four five six seven eight nine ten eleven twelve
garch(p=1,q=1,equation=armaagain)
Variable Coeff Std Error T-Stat Signif
*******************************************************************************
1. RANGE{1} 0.990059426 0.004321752 229.08750 0.00000000
2. ONE 0.334367013 0.132619229 2.52126 0.01169368
3. ONE{1} -0.542543241 0.279467085 -1.94135 0.05221592
4. TWO -0.542543883 0.279467076 -1.94135 0.05221563
5. TWO{1} -0.002221093 0.248567117 -0.00894 0.99287053
6. THREE -0.002220630 0.248567121 -0.00893 0.99287201
7. THREE{1} -0.030846180 0.246439705 -0.12517 0.90039114
etc etc