Incorporing new forecasted values to estimations
Posted: Fri Nov 20, 2015 11:53 am
Hello, I'm running a regression like this:
equation.ls Y c Y(-1) Y(-2) X X(-1) X(-2) Z Z(-1) Z(-2)
I have projections for X and Z in the future, therefore I can make a forecast. But my intention is to make one-step ahead forecast for Yand incoporate this forecast as if it were real. After that re-estimate my model including this one-step forecast (my sample gets +1 observation) and make a one step forecast again. An so on. The idea is to incorporate each forecast as new real data for future forecasts.
I have something like this, but I would like to make it a loop, so I don't have to manually estimate each time
smpl 2011m01 2015m10
equation m1.ls Y c Y(-1) Y(-2) X X(-1) X(-2) Z Z(-1) Z(-2)
smpl 2015m11 2015m11
forecast(f=actual) Y_F
Y = Y_F
And then I will re-estimate again for, incorporate the data to the original variable, reestimate and forecast for december ,january, and so on...
Any help in how to make this some kind of loop, or a rolling regressión with the fixed start point and moving +1 each time would be of great help
equation.ls Y c Y(-1) Y(-2) X X(-1) X(-2) Z Z(-1) Z(-2)
I have projections for X and Z in the future, therefore I can make a forecast. But my intention is to make one-step ahead forecast for Yand incoporate this forecast as if it were real. After that re-estimate my model including this one-step forecast (my sample gets +1 observation) and make a one step forecast again. An so on. The idea is to incorporate each forecast as new real data for future forecasts.
I have something like this, but I would like to make it a loop, so I don't have to manually estimate each time
smpl 2011m01 2015m10
equation m1.ls Y c Y(-1) Y(-2) X X(-1) X(-2) Z Z(-1) Z(-2)
smpl 2015m11 2015m11
forecast(f=actual) Y_F
Y = Y_F
And then I will re-estimate again for, incorporate the data to the original variable, reestimate and forecast for december ,january, and so on...
Any help in how to make this some kind of loop, or a rolling regressión with the fixed start point and moving +1 each time would be of great help