HEGY Seasonal Unit Root Testing for Monthly Series

For posting your own programs to share with others

Moderators: EViews Gareth, EViews Moderator

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

HEGY Seasonal Unit Root Testing for Monthly Series

Postby trubador » Mon Jan 05, 2009 8:05 am

Below you can find HEGY test as a subroutine in EViews. Copy and paste the code into your program window to execute. Please feel free to modify and/or improve it...


Code: Select all

'HEGY test for unit roots and seasonal unit roots of MONTHLY series

call hegy(name of your series)

subroutine hegy(series y)
'generate auxiliary polynomials
series Z1 =   y + y(-1) + y(-2) + y(-3) + y(-4) + y(-5) + y(-6) + y(-7) + y(-8) + y(-9) + y(-10) + y(-11)
series Z2 = - y + y(-1) - y(-2) + y(-3) - y(-4) + y(-5) - y(-6) + y(-7) - y(-8) + y(-9) - y(-10) + y(-11)
series Z3 = - y + y(-2) - y(-4) + y(-6) - y(-8) + y(-10)
series Z4 = - y + @sqrt(3)*y(-1) - 2*y(-2) + @sqrt(3)*y(-3) - y(-4) + y(-6) - @sqrt(3)*y(-7) + 2*y(-8) - @sqrt(3)*y(-9) + y(-10)
series Z5 = - y - @sqrt(3)*y(-1) - 2*y(-2) - @sqrt(3)*y(-3) - y(-4) + y(-6) + @sqrt(3)*y(-7) + 2*y(-8) + @sqrt(3)*y(-9) + y(-10)
series Z6 = - y + y(-1) - y(-3) + y(-4) - y(-6) + y(-7) - y(-9) + y(-10)
series Z7 = - y - y(-1) + y(-3) + y(-4) - y(-6) - y(-7) + y(-9) + y(-10)
series Z8 = y - y(-12)

'create seasonal dummies
for !i=1 to 11
series s!i = @seas(!i) - @seas(12)
next

'estimate the equation
equation eq1.ls(showopts,c=1e-5,m=1000) Z8 c s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 Z1(-1) Z2(-1) Z3(-1) Z3(-2) Z4(-1) Z4(-2) Z5(-1) Z5(-2) Z6(-1) Z6(-2) Z7(-1) Z7(-2) Z8(-1 to -12)
show eq1.output

'generate the test statistics that are not given in the equation output (Warning: critical values are different from those of EViews'. You should find true values for accurate hypothesis testing!)
freeze eq1.wald c(15)=0, c(16)=0
freeze eq1.wald c(17)=0, c(18)=0
freeze eq1.wald c(19)=0, c(20)=0
freeze eq1.wald c(21)=0, c(22)=0
freeze eq1.wald c(23)=0, c(24)=0
freeze eq1.wald c(14)=0, c(15)=0, c(16)=0, c(17)=0, c(18)=0, c(19)=0, c(20)=0, c(21)=0, c(22)=0, c(23)=0, c(24)=0
freeze eq1.wald c(13)=0, c(14)=0, c(15)=0, c(16)=0, c(17)=0, c(18)=0, c(19)=0, c(20)=0, c(21)=0, c(22)=0, c(23)=0, c(24)=0

'delete auxiliary series and seasonal dummies
delete z* s*
endsub

romiromero
Posts: 7
Joined: Tue Sep 01, 2009 9:08 am

Re: HEGY Seasonal Unit Root Testing for Monthly Series

Postby romiromero » Wed Sep 02, 2009 7:19 am

Hello,

Thank you for the program, but I do not know how to interpret the results. Please, can you give me any reference to understand the results of this test?
Thank you very much in advance.
Best regards,

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: HEGY Seasonal Unit Root Testing for Monthly Series

Postby trubador » Wed Sep 02, 2009 7:46 am

Hylleberg, S., Engle, R. F., Granger, C. W. J. and Yoo, B. S., 1990. "Seasonal integration and cointegration," Journal of Econometrics, Elsevier, vol. 44(1-2), pp 215-238.
Joseph Beaulieu, J. and Miron, Jeffrey A., 1993. "Seasonal unit roots in aggregate U.S. data," Journal of Econometrics, Elsevier, vol. 55(1-2), pp 305-328.

You can find plenty of other studies, if you search journal/working paper databases...

romiromero
Posts: 7
Joined: Tue Sep 01, 2009 9:08 am

Re: HEGY Seasonal Unit Root Testing for Monthly Series

Postby romiromero » Wed Sep 02, 2009 10:59 am

Hello,

Thank you again for your answer; another question: the test you developed is based on the derivation of Franses (1990) or Beaulieu and Miron?

Best regards,

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: HEGY Seasonal Unit Root Testing for Monthly Series

Postby trubador » Wed Sep 02, 2009 11:10 am

Please see the following discussion for more details: viewtopic.php?f=5&t=843

romiromero
Posts: 7
Joined: Tue Sep 01, 2009 9:08 am

Re: HEGY Seasonal Unit Root Testing for Monthly Series

Postby romiromero » Wed Sep 02, 2009 3:22 pm

Your test follows the developments of Franses (1991); however, according to Franses' methodology, we should check the statistical significance of:

1) phi 3, phi 4
2) phi 5, phi 6
3) phi 7, phi 8
4) phi 9, phi 10
5) phi 11, phi 12
6) phi 3... phi 12

but in the program you modified step 6 and added a step 7 as follows:

6) phi 2... phi 12
7) phi 1... phi 12
Why is that? I am confused.

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: HEGY Seasonal Unit Root Testing for Monthly Series

Postby trubador » Wed Sep 02, 2009 11:16 pm

I had written the code long before I posted it into the forum. Therefore, I do not remember why such a difference occurs in the hypothesis testing stage. Anyway, general structure of the code will remain more or less the same in different HEGY specifications and you can make all the necessary modifications easily.

Krishna Reddy Ch
Posts: 4
Joined: Sun Jul 05, 2009 9:26 am

Re: HEGY Seasonal Unit Root Testing for daily Series

Postby Krishna Reddy Ch » Wed Feb 17, 2010 10:40 am

HEGY Seasonal Unit Root Testing , co integrqtion nd VECM for daily stock indices,

am working for PhD on world stock prices indice (eight major counitres), Plz can you help how to do this test in Eviews, i do not anything about command programming in eviews.

plz give me advice.

i am looking forward for your warm response.

thanking you,

yours
krishna

omerzeybek
Posts: 3
Joined: Fri Sep 23, 2011 7:56 am

Re: HEGY Seasonal Unit Root Testing for Monthly Series

Postby omerzeybek » Mon Sep 26, 2011 5:53 am

Hi,

i need an confirmation...

I have problem while interpreting HEGY results for my monthly data. My test variable indicates that there is no unit root in 2phi/3 and 5phi/6 interval but there is one between phi/2, phi/3 and phi/6 intervals. Am i sure this only shows characteristics of seasonal stochastic trend of my series... it is because there is a unit root in other phi intervals then my data has seasonal unit root and it need to be seasonal differenced to properly modelled in an ARIMA model...

Thank you very much

selin1000
Posts: 40
Joined: Tue Mar 06, 2012 1:56 pm

Re: HEGY Seasonal Unit Root Testing for Monthly Series

Postby selin1000 » Sun Jun 17, 2012 11:57 pm

Hello!

I am running the subroutine code proposed above but I get the error message near singular matrix error, regressors may be perfectly collinear. Do you know how I can solve this problem? I need to test for seasonal unit roots in my monthly series.

Thank you! :)


Return to “Program Repository”

Who is online

Users browsing this forum: No registered users and 1 guest