Lost in a grid...

For questions regarding programming in the EViews programming language.

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

Novi
Posts: 44
Joined: Sun May 16, 2010 11:48 am

Lost in a grid...

Postby Novi » Tue Mar 27, 2012 3:56 am

Hi Eviews forum,
For some reason I am getting lost with a simple procedure, a grid search over 3 parameters.
My code is simple and goes as follows:

Code: Select all

series t1=gamma+0.1*@trend series t2=c1+0.1*@trend series t3=t2 stom(t1,thr1) stom(t2,thr2) stom(t3,thr3) 'i=i+1 vector(273) ssr_result for !u=1 to 273 for !k=1 to 91 for !j=1 to 91 for !i=1 to 91 'this amounts to arrive to 10 in the grid coef(5) gphi1=phi1_store coef(5) gphi2=phi2_store equation grid.ls(showopts) x=gphi1(1)+gphi1(2)*z(-1)+gphi1(3)*y+gphi1(4)*x(-1)+gphi1(5)*y(-1)+(gphi2(1)+gphi2(2)*z(-1)+gphi2(3)*y+gphi2(4)*x(-1)+gphi2(5)*y(-1))*@logit((thr1(!i)/scalef)*(trans+thr2(!j))*(trans+thr3(!k)) ) ssr_result(!u)=@ssr next next next next
However, from the error message I get it seems that the program is not understanding how it has to change the combinations of the three parameters. More precisely, the equation is nonlinear but I know for sure that the starting values are good (the phi1_store, phi2_store) and outside this grid the estimation works. However, within these 3 nested loops at a certain point I get a nonsingular matrix error. SHOULD I MAYBE USE A WHILE LOOP INSIDE THE MAIN FOR LOOP? how can I make eviews understand what I need? any suggestion will be appreciated! thx

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

Re: Lost in a grid...

Postby EViews Gareth » Tue Mar 27, 2012 7:48 am

There's nothing wrong with the loop that I can see. The most likely cause is that the equation does go singular at some point.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests