Page 1 of 1
Problem on GARCH(1,1) programming
Posted: Sat Jun 04, 2016 4:43 am
by jasmine_cam
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.
Re: Problem on GARCH(1,1) programming
Posted: Sat Jun 04, 2016 4:49 am
by EViews Gareth
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).
Re: Problem on GARCH(1,1) programming
Posted: Sat Jun 04, 2016 4:58 am
by jasmine_cam
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.
Re: Problem on GARCH(1,1) programming
Posted: Sat Jun 04, 2016 6:06 am
by EViews Gareth
What exactly are you doing?
Re: Problem on GARCH(1,1) programming
Posted: Sat Jun 04, 2016 6:38 am
by jasmine_cam
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
Re: Problem on GARCH(1,1) programming
Posted: Sat Jun 04, 2016 6:49 am
by EViews Gareth
No, I meant how are you running the code? What goes wrong?
Re: Problem on GARCH(1,1) programming
Posted: Sat Jun 04, 2016 7:10 am
by jasmine_cam
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.
Re: Problem on GARCH(1,1) programming
Posted: Sat Jun 04, 2016 8:01 am
by EViews Gareth
More basic - where are you entering the text of the program etc...?
Re: Problem on GARCH(1,1) programming
Posted: Sat Jun 04, 2016 10:28 am
by jasmine_cam
If I get your question right, to the white code area in Eviews 7.
Re: Problem on GARCH(1,1) programming
Posted: Sat Jun 04, 2016 10:50 am
by startz
You need to create a program window and then run the program from there.
File/New/Program
Re: Problem on GARCH(1,1) programming
Posted: Sun Jun 05, 2016 9:02 am
by jasmine_cam
Thanks a lot! Just this code will save me hours of time.