Page 1 of 1

A Loop problem

Posted: Sun Mar 03, 2013 7:45 pm
by kalolibaby
Hello

I just want to form a state-space model with 5 loop. Reference to manual, each signal and state equation should have one covariance vector respectively. I formed program but it didn't work. Please tell me how I can fix it, thanks!

for !i=1 to 5
sspace tvp!i
tvp!i.append num!i=sv1!i*h+[var=exp(c((!i-1)*2+1))]
tvp!i.append @state sv1!i=sv1!i(-1)+[var=exp(c(!i*2))]
tvp!i.ml
next

Cheers.

Re: A Loop problem

Posted: Sun Mar 03, 2013 7:55 pm
by EViews Gareth
Hard to tell exactly without more details, but one thing that looks wrong is that you have:

Code: Select all

c(!i-1)
Which will yield C(0), which doesn't exist (EViews is 1-based, not 0-based).

Re: A Loop problem

Posted: Sun Mar 03, 2013 8:22 pm
by kalolibaby
Hard to tell exactly without more details, but one thing that looks wrong is that you have:

Code: Select all

c(!i-1)
Which will yield C(0), which doesn't exist (EViews is 1-based, not 0-based).
i just want to refine disturbance of signal and state equation with follows:
sspace1
c(1) c(2)
sspace2
c(3) c(4)
....

How i form like this way? Thnaks.

Re: A Loop problem

Posted: Sun Mar 03, 2013 8:27 pm
by EViews Gareth

Code: Select all

!coef1 = (!i-1)*2+1 !coef2 = (!i-1)*2+2

Re: A Loop problem

Posted: Tue Mar 12, 2013 6:12 pm
by kalolibaby

Code: Select all

!coef1 = (!i-1)*2+1 !coef2 = (!i-1)*2+2
I got it. Thanks vary much