Help- stop the loop
Posted: Wed Jul 24, 2013 9:15 am
Hello Everyone! Could you please help me with the codes below? My problem is that I have set the loop to be stopped when nrtf{!k}=nrtf{!j}. According to my results, nrtf3=nrtf4 but the loop does not stop and continues to produce the nrtf5 nrtf6...nrtf10. I have attached the files in this message.
Thanks you very much for the help.
'start
equation eq01
eq01.ls rt c
series nrt=@recode(rt=na,eq01.@coefs(1),rt)
equation eq02
eq02.ARCH(tdist, backcast=0.7,derive=aa) nrt c
eq02.forecast nrtf1
series nrtf1=@recode(rt=na, nrtf1,rt)
for !i = 3 to 10
!j = !i-2
!k = !i-1
equation eq{!i}
eq{!i}.ARCH(tdist,backcast=0.7,derive=aa) nrtf{!j} c
eq{!i}.forecast nrtf{!k}
series nrtf{!k} = @recode(rt=na,nrtf{!k},rt)
if nrtf{!k}=nrtf{!j}
exitloop
endif
next
Thanks you very much for the help.
'start
equation eq01
eq01.ls rt c
series nrt=@recode(rt=na,eq01.@coefs(1),rt)
equation eq02
eq02.ARCH(tdist, backcast=0.7,derive=aa) nrt c
eq02.forecast nrtf1
series nrtf1=@recode(rt=na, nrtf1,rt)
for !i = 3 to 10
!j = !i-2
!k = !i-1
equation eq{!i}
eq{!i}.ARCH(tdist,backcast=0.7,derive=aa) nrtf{!j} c
eq{!i}.forecast nrtf{!k}
series nrtf{!k} = @recode(rt=na,nrtf{!k},rt)
if nrtf{!k}=nrtf{!j}
exitloop
endif
next