# An iterative forecast with one recursive independent variable

I would like to forecast iteratively a model with a lag dependent variable and a recursive independent variable. Is this possible to do in Stata?

Basically, it would be:

y(t+1)=a0+a1*y(t)+a2*x(t),

as usual, for 1 step ahead forecast (I know how to do this part), but in the 2nd step it would be

y(t+2)=a0+a1*y(t+1)+a2*x(t+1),

where x(t+1) is a forecast from another model, whereas y(t+1) is the iterative forecast from the previous period

• SAS can't do this and since STATA is (generaly) a SAS knockoff I presume they can't BUT I have used other software that actually does this. – IrishStat Sep 21 '17 at 19:39
• Such as? Can it be done in R? – Roux Sep 22 '17 at 4:38
• Apparently, forecast solve does it by default in cases with a lag dependent and an exogenous variable. Thanks! – Roux Sep 22 '17 at 9:23