## Regression in Hamilton filter add-in

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

KrilleJ
Posts: 40
Joined: Fri Feb 20, 2015 6:15 am

### Regression in Hamilton filter add-in

Looking at the Hamilton filter add-in it seems as if a regression on the four most recent lags is run and direct forecasts are made h periods into the future based in the estimation results in order to get a trend estimate. That is:

y_t=c(1)+c(2)*y_{t-1}+c(3)*y_{t-2}+c(4)*y_{t-3}+c(5)*y_{t-4}

is estimated while the trend estimate is:

\hat{y}_{t+h}=est_c(1)+est_c(2)*y_{t-1}+est_c(3)*y_{t-2}+est_c(4)*y_{t-3}+est_c(5)*y_{t-4}

The code in the add-in is:

Code: Select all

HamiltonEstimation192873.ls {%inputvarname} c {%inputvarname}(-1) {%inputvarname}(-2) {%inputvarname}(-3) {%inputvarname}(-4)    'Generate the trend with the fitted values from the equation estimation and lags{%trendoutputname}(!i + 5 +!h) = c(1) _+ c(2) * {%inputvarname}(!i+4)  _+ c(3) * {%inputvarname}(!i+3)  _ + c(4) * {%inputvarname}(!i+2)  _ + c(5) * {%inputvarname}(!i+1)

This is not how I read Hamilton's paper. Instead, I gather that the filter regression to be estimated is:

y_{t+h}=c(1)+c(2)*y_{t}+c(3)*y_{t-1}+c(4)*y_{t-2}+c(5)*y_{t-3}

Have I missed something or is there room for changing the regression in the add-in?

Best,
Krille

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

### Re: Regression in Hamilton filter add-in

Given how simple his technique is, you’re probably best off doing it manually.

KrilleJ
Posts: 40
Joined: Fri Feb 20, 2015 6:15 am

Great, I will.