Problem on GARCH(1,1) programming

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

jasmine_cam
Posts: 9
Joined: Sat Jun 04, 2016 4:31 am

Problem on GARCH(1,1) programming

Postby jasmine_cam » Sat Jun 04, 2016 4:43 am

Hi all,

I have been using Eviews for a very long time- though have not used programming at all. One friend obtained me a code for a multiple step procedure. However, I cannot make it work. The part of it as follows:

Code: Select all

for !a=1 to N equation eq1{!a}.arch y{!a} c y{!a}(-1) eq1{!a}.garch eq1{!a}.makederivs derv_it01{!a} derv_it02{!a}
I guess N should be the number of observations, so say if it is 500, we should write 500. But code gives an error of "!a is not a valid string or scalar name". What should I understand from this?

Thanks for your help.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Problem on GARCH(1,1) programming

Postby EViews Gareth » Sat Jun 04, 2016 4:49 am

That code is incomplete, and doesn't appear to do what you think it does.

It runs multiple estimations with different dependent variables (Y1 - YN).

jasmine_cam
Posts: 9
Joined: Sat Jun 04, 2016 4:31 am

Re: Problem on GARCH(1,1) programming

Postby jasmine_cam » Sat Jun 04, 2016 4:58 am

Thanks for your quick answer.

Code: Select all

scalar n=1 'number of time series (y1,y2,.....,N), (x1,x2,.....,N) scalar ind=1 'input for loop for !a=1 to N vector(N) LMxy 'returns LMstat for volatility spillover from x to y vector(N) pvalxy 'returns corresponding pvalue for LMxy vector(N) LMyx 'returns LMstat for volatility spillover from y to x vector(N) pvalyx 'returns corresponding pvalue for LMstatyx equation eq1{!a}.arch y{!a} c y{!a}(-1) eq1{!a}.garch eq1{!a}.makederivs derv_it01{!a} derv_it02{!a} eq1{!a}.makegarch zit{!a}
this is actually how it looks for the beginning of the code.

As far as I understand !a=1 is control variable, and Eviews should be replacing !a with 1 in each case. For some reason I cannot make it work.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Problem on GARCH(1,1) programming

Postby EViews Gareth » Sat Jun 04, 2016 6:06 am

What exactly are you doing?

jasmine_cam
Posts: 9
Joined: Sat Jun 04, 2016 4:31 am

Re: Problem on GARCH(1,1) programming

Postby jasmine_cam » Sat Jun 04, 2016 6:38 am

I basically would like to do a volatility spillover test which includes multiple steps as follows:

1) After calculating the standardized residuals for the two stationary series i and j, estimate a GARCH (1,1) model for these residuals and obtain the standardized residuals of this equation, the derivatives, and volatility process of the GARCH model.
2) Regress standardized residuals on the derivatives and volatility process indicators obtained in step 1.
3) LM test statistics, is equal to the number of observations times the degree of explanation of the regression (R2) in Step 2. The critical value for LM test would follow distribution where n is the number of indicators in volatility process

though since I would do this analysis for over 100 variables, it would be much easier for me to compute through the code

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Problem on GARCH(1,1) programming

Postby EViews Gareth » Sat Jun 04, 2016 6:49 am

No, I meant how are you running the code? What goes wrong?

jasmine_cam
Posts: 9
Joined: Sat Jun 04, 2016 4:31 am

Re: Problem on GARCH(1,1) programming

Postby jasmine_cam » Sat Jun 04, 2016 7:10 am

There are 5000 observations for each series. So I write 5000 in lieu of N (not sure if thats correct, but guess so). Then the error says "!a is not a valid string or scalar name". stuck at that point.

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Problem on GARCH(1,1) programming

Postby EViews Gareth » Sat Jun 04, 2016 8:01 am

More basic - where are you entering the text of the program etc...?

jasmine_cam
Posts: 9
Joined: Sat Jun 04, 2016 4:31 am

Re: Problem on GARCH(1,1) programming

Postby jasmine_cam » Sat Jun 04, 2016 10:28 am

If I get your question right, to the white code area in Eviews 7.

startz
Non-normality and collinearity are NOT problems!
Posts: 3797
Joined: Wed Sep 17, 2008 2:25 pm

Re: Problem on GARCH(1,1) programming

Postby startz » Sat Jun 04, 2016 10:50 am

You need to create a program window and then run the program from there.
File/New/Program

jasmine_cam
Posts: 9
Joined: Sat Jun 04, 2016 4:31 am

Re: Problem on GARCH(1,1) programming

Postby jasmine_cam » Sun Jun 05, 2016 9:02 am

Thanks a lot! Just this code will save me hours of time.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests