Manipulating estimated coefficients

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

ziki6368
Posts: 1
Joined: Mon Jun 04, 2012 8:03 am

Manipulating estimated coefficients

Postby ziki6368 » Tue Jun 05, 2012 5:58 am

Hi,

I made a expanding window forecast for the stock return(exstock) against (yspr(-1)). Now what i want is: if the estimation coefficient is positive we keep it and when it is negative we set it to zero for the recursive forecast, so that there will be no forecast power. In this way, we can reduce the prediction error if we know the parameter should have a certain sign. I want to do this through a if command? And how do we specify the coeficient to be 0?

Thanks

for !i = 1 to !length-!window+1-!step step !step
' set sample to estimation period
smpl @first @first+!i+!window-2
' estimate equation
eq1.ls exstock c yspr(-1)
' reset sample to forecast period
smpl @first+!i+!window-1 @first+!i+!window-2+!step
' make forecasts in temporary series first
eq1.forecast(f=na) tmp_yhat tmp_se
' copy data in current forecast sample
yhat = tmp_yhat
yhat_se = tmp_se
next

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13604
Joined: Tue Sep 16, 2008 5:38 pm

Re: Manipulating estimated coefficients

Postby EViews Gareth » Tue Jun 05, 2012 7:48 am

You cannot set the coefficient for the forecast. However, it looks like you are copying the forecast into another series, so you could always only do that copy if the coefficient is positive.

Code: Select all

if eq1.@coef(2)>0 then yhat = tmp_yhat yhat_se = tmp_se endif


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 1 guest