changing a variable within a "system" from a VARX object
Posted: Sun Jul 22, 2012 10:44 pm
Hi
Trust all is well thanks in advance for your replies . My problem is more a syntax issue, I have programmed a loop to pick out the optimal lag length on my VARX model. I have then have created a "system" from my VARX model and added a a line for an additional equation. My question is related to changing the name of the variables in the system, without having to go into the work file i.e. by code.
[smpl {%t}
VAR {%d}_var_{%t}.ls 1 !bestlag dlog({%d}_asia) dlog({%d}_sa) @ west_d(-1 to -!bestexo) china_d(-1 to -!bestexo) c
{%d}_var_{%t}.makesystem(n={%d}_ss_{%t})
{%d}_ss_{%t}.append dlog({%d})= @replace(*,"china_d", "dlog(china_sa") ''trying to replace “china_d” in the “dlog({%d}_asia)" and "dlog({%d}_sa)” equations.
{%d}_ss_{%t}.append dlog(CHINA_SA) =C(29)*dlog(CHINA_SA(-1)) + C(30)*dlog(CHINA_SA(-2)) + C(31)*west_sa(-1) + C(32)*dlog(WEST_SA(-2)) + C(33)*dlog(WEST_SA(-3)) + C(34)*dlog(WEST_SA(-4))+ C(35)*dlog(WEST_SA(-5))+ C(36)*dlog(WEST_SA(-6))+c(37)
]
as the dlog(china_sa) line suggests i need the china_d to be dlog(china_sa) to forecast teh system.
thanks again
Trust all is well thanks in advance for your replies . My problem is more a syntax issue, I have programmed a loop to pick out the optimal lag length on my VARX model. I have then have created a "system" from my VARX model and added a a line for an additional equation. My question is related to changing the name of the variables in the system, without having to go into the work file i.e. by code.
[smpl {%t}
VAR {%d}_var_{%t}.ls 1 !bestlag dlog({%d}_asia) dlog({%d}_sa) @ west_d(-1 to -!bestexo) china_d(-1 to -!bestexo) c
{%d}_var_{%t}.makesystem(n={%d}_ss_{%t})
{%d}_ss_{%t}.append dlog({%d})= @replace(*,"china_d", "dlog(china_sa") ''trying to replace “china_d” in the “dlog({%d}_asia)" and "dlog({%d}_sa)” equations.
{%d}_ss_{%t}.append dlog(CHINA_SA) =C(29)*dlog(CHINA_SA(-1)) + C(30)*dlog(CHINA_SA(-2)) + C(31)*west_sa(-1) + C(32)*dlog(WEST_SA(-2)) + C(33)*dlog(WEST_SA(-3)) + C(34)*dlog(WEST_SA(-4))+ C(35)*dlog(WEST_SA(-5))+ C(36)*dlog(WEST_SA(-6))+c(37)
]
as the dlog(china_sa) line suggests i need the china_d to be dlog(china_sa) to forecast teh system.
thanks again