Page 1 of 1

how to specify ecm code

Posted: Tue Apr 01, 2014 5:32 am
by ginanjar
Hi all

I am using eviews 7, and to do some ecm model
how to correctly specifiy the long run and the short run model

only put the short run

Code: Select all

model _bopmodel _bopmodel.merge eq_dm _bopmodel.merge eq_dx _bopmodel.append TB = X - M
or

put also the long run too

Code: Select all

model _bopmodel _bopmodel.append EC_M = LOG(M) - (2.31873071534*LOG(Y)-1.92167062414*LOG(E)+7.28343455044) _bopmodel.append EC_X = LOG(X) - (0.735607626835*LOG(YK)-1.12278185277*LOG(E)+ 9.25927784867) _bopmodel.merge eq_dm _bopmodel.merge eq_dx _bopmodel.append TB = X - M
the result is different though
and I can not do programmtically to put all the coefficient

here is how to estimate

Code: Select all

'-------------------------------- ' Estimating imports '-------------------------------- coef(10) c_m smpl 2008M1 2013M1 genr ec_m=0 equation eq_m1.ls(p) log(m)=c_m(1)*log(y)+c_m(2)*log(e) equation eq_m2.ls(p) log(m)=c_m(1)*log(y)+c_m(2)+[ar(1)=c_m(3)] equation eq_m3.ls(p) log(m)=c_m(1)*log(y)+c_m(2)*log(e)+c_m(3) equation eq_m4.ls(p) log(m)=c_m(1)*log(y)+c_m(2)*log(e)+c_m(3)+[ar(1)=c_m(4)] equation eq_m.ls(p) log(m)=c_m(1)*log(y)+c_m(2)*log(e)+c_m(3)+ ec_m genr ec_m=resid 'short run coef(10) c_dm smpl 2008M1 2013M1 genr ec_dm=0 equation eq_dm1.ls(p) dlog(m)=c_dm(1) + c_dm(2)*dlog(e(-1)) + c_dm(3)*dlog(y(-1)) + c_dm(4)*ec_m(-1) equation eq_dm2.ls(p) dlog(m)=c_dm(1) + c_dm(2)*dlog(e) + c_dm(3)*dlog(y) - c_dm(4)*(log(m(-1)) - c_dm(5)*log(y) - c_dm(6)*log(e)) + c_dm(7)*ec_m(-1) equation eq_dm.ls(p) dlog(m)=c_dm(1) + c_dm(2)*dlog(e(-1)) + c_dm(3)*dlog(y(-1)) + c_dm(4)*ec_m(-1) + ec_dm genr ec_dm=resid '-------------------------------- ' Estimating exports '-------------------------------- coef(10) c_x smpl 2008M1 2013M1 genr ec_x=0 equation eq_x1.ls(p) log(x)=c_x(1)*log(yk)+c_x(2) equation eq_x2.ls(p) log(x)=c_x(1)*log(yk)+c_x(2)*log(e)+c_x(3) equation eq_x3.ls(p) log(x)=c_x(1)*log(yk)+c_x(2)*log(e)+[ar(1)=c_x(3)] equation eq_x.ls(p) log(x)=c_x(1)*log(yk)+c_x(2)*log(e)+ c_x(3)+ ec_x genr ec_x=resid 'short run coef(10) c_dx smpl 2008M1 2013M1 genr ec_dx=0 equation eq_dx1.ls(p) dlog(x)=c_dx(1) + c_dx(2)*dlog(e(-1)) + c_dx(3)*dlog(yk(-1)) + c_dx(4)*ec_x(-1) equation eq_dx2.ls(p) dlog(x)=c_dx(1) + c_dx(2)*log(e) + c_dx(3)*log(yk) + c_dx(4)*(log(x(-1)) -c_dx(5)*log(yk) -c_dx(6)*log(e)) + c_dx(7)*ec_x(-1) equation eq_dx.ls(p) dlog(x)=c_dx(1) + c_dx(2)*dlog(e(-1)) + c_dx(3)*dlog(yk(-1)) + c_dx(4)*ec_x(-1) + ec_dx genr ec_dx=resid
is there any tips to program ecm model


thanks for the assistance


regards,
ginanjar

Re: how to specify ecm code

Posted: Tue Apr 01, 2014 8:33 am
by EViews Gareth
What are you trying to do? Why are you using a model object?

Re: how to specify ecm code

Posted: Tue Apr 01, 2014 6:08 pm
by ginanjar
Hi Gareth

because we want to build a full model (closed system), but we want to try it using minimum number of equations first,
so it still recursive equations but we want to evolve it into simultaneous one.

the residues of the long run equations already put into variable,
and if i put short run equation, it is solved but it has different percentage result pv_tb
I have put the model and the result in different page
bop and bop_m
If I put the long run equation directly, eviews tell that the variable already spesified as endogenous in another equations
then the equation was changed into a kind of ec_x = log(x) - (...... ......) the same as the residual data
but this model has a correct response

the problem is I have to put the append manually not programmatically, I am not sure whether I am doing it correctly

also, I can't find a simple example for eviews ecm program, I am new to econometric, my background is more to programming

thank you for helping

Re: how to specify ecm code

Posted: Tue Apr 01, 2014 8:31 pm
by EViews Gareth
I think your question is a little outside the scope of our technical support. :(

Re: how to specify ecm code

Posted: Tue Apr 01, 2014 8:38 pm
by ginanjar
It's ok Gareth, I think the temporary solution is just fine.

Another question, how to make a percent deviation graph by code

I can only do the deviation by using

Code: Select all

_bopmodel.makegraph(d,n) gr1 x
but in the menu I have the check box but cannot find the option for percent deviation. is is not included?

regards,
ginanjar