Lost in a grid...
Posted: 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:
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
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