Page 1 of 1

Syntax error

Posted: Mon Jun 23, 2014 1:24 am
by innagt
Hi team,

I am trying to write a state space model. Its showing syntax error in signal y but couldnt locate any mistake . Please help me out with this E-view team.

I am building a model based on this paper. http://www.bde.es/f/webbde/Secciones/Pu ... t0416e.pdf

@signal y = a(1) * y(-1) + a(2) * y(-2) + a(3) * r(-1) + a(4) * r(-2) + SV1 - a(1) * SV1(-1) - a(2) * SV1(-2) - a(3) * SV2(-1) - a(4) * SV2(-2) + [var=exp(c(1))]
@signal p = B(4) * y(-1) + (1-3*(b(2))-3*(b(3)) * p(-1) + b(2) * p(-2) + b(2) * p(-3) + b(2) * p(-4) + b(3) * p(-5) + b(3) * p (-6) + b(3) * p(-7) + b(3) * p(-8) - b(5) * SV1(-1) + [var=exp(c(2))]
@state SV2 = d(1) * SV3 +SV4
@state SV4 = e(1) * SV4(-1) + e(2) * SV4(-2) + [var= exp(c(3))]
@state SV1 = SV1(-1) + SV3(-1) + [Var=exp(c(4))]
@state SV3 = SV3(-1) + [Var=exp(c(5))]


Best Regards
Innagt

Re: Syntax error

Posted: Mon Jun 23, 2014 6:38 am
by startz
Hi team,

I am trying to write a state space model. Its showing syntax error in signal y but couldnt locate any mistake . Please help me out with this E-view team.


@signal p = B(4) * y(-1) + (1-3*(b(2))-3*(b(3)) * p(-1) + b(2) * p(-2) + b(2) * p(-3) + b(2) * p(-4) + b(3) * p(-5) + b(3) * p (-6) + b(3) * p(-7) + b(3) *
............................. ^
unclosed parenthesis?

Re: Syntax error

Posted: Tue Jun 24, 2014 6:29 am
by innagt
Hi Startz,

Its not showing parenthesis problem. error is "Syntax error in equation in equation". Could you please help me on writing this code. I am damn struck.

Would be very thankful


Best regards
INNAGT

Re: Syntax error

Posted: Tue Jun 24, 2014 6:40 am
by innagt
Please clarify whether this problem is happening because I am restricting co-efficients. If you see the equation my y(-1) and SV(-1) has same co efficient.
Same I have done in Equation two also. Is it because of this I am facing problem? or else i couldn't identify what is causing problem.

Please help.

Re: Syntax error

Posted: Tue Jun 24, 2014 6:42 am
by startz
Do you have the same number of open and close parentheses?

Re: Syntax error

Posted: Tue Jun 24, 2014 7:12 am
by innagt
yes, parenthesis are matching. The error I am getting is here Syntax error in equation in equation "y = a(1) * y(-1) + a(2) * y(-2) + a(3) * r(-1) + a(4) * r(-2) + SV1 - a(1) * SV1(-1) - a(2) * SV1(-2) - a(3) * SV2(-1) - a(4) * SV2(-2) + [var=exp(c(1))]".

Re: Syntax error

Posted: Tue Jun 24, 2014 7:16 am
by innagt
pfa the workfile

Re: Syntax error

Posted: Tue Jun 24, 2014 8:01 am
by EViews Gareth
You don't have A defined in your workfile.

Re: Syntax error

Posted: Wed Jun 25, 2014 2:52 am
by innagt
Hi Gareth,

Thanks for your reply. I have re -written my code. still its showing error as Signal variable not allowed in state equatio, but then i changed my code by directly adding lag in signal equation, even then it is not working.

Please please help me out on correcting this code. Couldn't locate what is the prob.

@signal y = c(1)*y2 + c(2)*y3 + c(3)*r1 + c(4)*r2 + c(5)*SV1 - c(1)*SV2 - c(2)*SV3 - c(3)*SV4 - c(4)*SV5 - c(5)*SV6 + [var=exp(c(20))]

@signal p = c(6)*y2 + (1-3*(c(7))-3*(c(8)))*p2 + c(8)*p3 + c(8)*p4 + c(8)*p4 + c(9)*p5 + c(9)*p6 + c(9)*p7 + c(9)*p8 + [var=exp(c(21))]

@state y2 = y(-1)
@state y3 = y(-2)
@state r1 = r(-1)
@state r2 = r(-2)
@state SV1 = SV1(-1) + SV7(-1) + [Var=exp(c(22))]
@state SV2 = SV1(-1)
@state SV3 = SV1(-2)
@state SV4 = c(10)*SV7 + SV9 + [var= exp(c(23))]
@state SV5 = SV4(-1)
@state SV6 = SV4(-2)
@state p2 = p(-1)
@state p3 = p(-2)
@state p4 = p(-3)
@state p5 = p(-4)
@state p6 = p(-5)
@state p7 = p(-6)
@state p8 = p(-7)
@state p9 = p(-8)
@state SV7 = SV7(-1) + [Var=exp(c(24))]
@state SV9 = SV9(-1) + SV9(-2) + [Var=exp(c(25))]

Please help me correcting this. Thanks in advance

Re: Syntax error

Posted: Wed Jun 25, 2014 6:23 am
by startz
From the Help system
• State equations may not contain signal equation dependent variables, or leads or lags of these variables.

Re: Syntax error

Posted: Fri Jun 27, 2014 12:31 am
by innagt
Hi Startz,

Thanks for reply. I re wrote my code by removing the specifications y1 and y2 as it was in my previous post and added lags directly into the Signal equation.

Now the problem is with my SV4. what is wrong with my SV4 specification?. My SV4 represents this equation r*t = c g(t)+ z (t), where that the natural rate of interest (r*t ) depends only on real factors, specifically the trend growth in the economy (gt) and a series of random factors, which are denoted by the variable zt, which in turn follows a stochastic process determined by equation (4).

Please help, I am badly struck.

@signal y = c(1)*y(-1) + c(2)*y(-2) + c(3)*r1 + c(4)*r2 + c(5)*SV1 - c(1)*SV2 - c(2)*SV3 - c(3)*SV4 - c(4)*SV5 - c(5)*SV6 + [var=exp(c(20))]

@signal p = c(6)*y(-1) + (1-3*(c(7))-3*(c(8)))*p2 + c(8)*p3 + c(8)*p4 + c(8)*p4 + c(9)*p5 + c(9)*p6 + c(9)*p7 + c(9)*p8 + [var=exp(c(21))]

@state r1 = r(-1)
@state r2 = r(-2)
@state SV1 = SV1(-1) + SV7(-1) + [Var=exp(c(22))]
@state SV2 = SV1(-1)
@state SV3 = SV2(-1)
@state SV4 = c(10)*SV7 + SV9 + [var= exp(c(23))]
@state SV5 = SV4(-1)
@state SV6 = SV5(-1)
@state p2 = p(-1)
@state p3 = p(-2)
@state p4 = p(-3)
@state p5 = p(-4)
@state p6 = p(-5)
@state p7 = p(-6)
@state p8 = p(-7)
@state p9 = p(-8)
@state SV7 = SV7(-1) + [Var=exp(c(24))]
@state SV9 = SV9(-1) + SV9(-2) + [Var=exp(c(25))]

Re: Syntax error

Posted: Fri Jun 27, 2014 5:09 am
by startz
This would probably be a good time for you to review the material in the help system and/or to read up some background material on the specification of state space models.

Re: Syntax error

Posted: Fri Jun 27, 2014 7:06 am
by innagt
Hi Startz,

Iam seriously wondering, whether you are able to identify any prob in my SV4 specification.

and there is no hard rule mentioned in the guide that constant trend shouldn't be in state variable.

I have seen many posts where trubador helping very patiently and that really helps people.

Just looking for some help to build it up. Please tell what is the problem there in SV4 set up.