Statics forecast of different periods
Posted: Thu Jan 26, 2012 3:39 pm
Hi,
I want to create a programming in order to run statics forecasts from a VAR model, but the issue is that I have first to regress from period 1 to 100, then forecast from the period 101 to 102, and find the RMSE. After that, I have to regress again but from period 1 to 102, then forecast from period 103 to 104, and find the RMSE, and do it again the same procedure until the end of the sample. I started to programming the forecast in a very easy but not so refined mode (see the program at the end of this message).
I was wondering if you can guide me if there is a programming to compute this multiple forecasts without doing it one by one.
Regards,
ECPM
'Forecast two periods inflation (static forecast)
'1 forecast
smpl 1954q3 1999q4
equation eq_inf.ls inf c inf(-1) inf(-2) inf(-3) inf(-4) u(-1) u(-2) u(-3) u(-4) ff(-1) ff(-2) ff(-3) ff(-4)
smpl 2000q1 2000q2
fit inf_hat
scalar rmse_1p = @rmse(inf, inf_hat)
'2 forecast
smpl 1954q3 2000q2
equation eq_inf.ls inf c inf(-1) inf(-2) inf(-3) inf(-4) u(-1) u(-2) u(-3) u(-4) ff(-1) ff(-2) ff(-3) ff(-4)
smpl 2000q3 2000q4
fit inf_hat
scalar rmse_2p = @rmse(inf, inf_hat)
'3 forecast
smpl 1954q3 2000q4
equation eq_inf.ls inf c inf(-1) inf(-2) inf(-3) inf(-4) u(-1) u(-2) u(-3) u(-4) ff(-1) ff(-2) ff(-3) ff(-4)
smpl 2001q1 2001q2
fit inf_hat
scalar rmse_3p = @rmse(inf, inf_hat)
I want to create a programming in order to run statics forecasts from a VAR model, but the issue is that I have first to regress from period 1 to 100, then forecast from the period 101 to 102, and find the RMSE. After that, I have to regress again but from period 1 to 102, then forecast from period 103 to 104, and find the RMSE, and do it again the same procedure until the end of the sample. I started to programming the forecast in a very easy but not so refined mode (see the program at the end of this message).
I was wondering if you can guide me if there is a programming to compute this multiple forecasts without doing it one by one.
Regards,
ECPM
'Forecast two periods inflation (static forecast)
'1 forecast
smpl 1954q3 1999q4
equation eq_inf.ls inf c inf(-1) inf(-2) inf(-3) inf(-4) u(-1) u(-2) u(-3) u(-4) ff(-1) ff(-2) ff(-3) ff(-4)
smpl 2000q1 2000q2
fit inf_hat
scalar rmse_1p = @rmse(inf, inf_hat)
'2 forecast
smpl 1954q3 2000q2
equation eq_inf.ls inf c inf(-1) inf(-2) inf(-3) inf(-4) u(-1) u(-2) u(-3) u(-4) ff(-1) ff(-2) ff(-3) ff(-4)
smpl 2000q3 2000q4
fit inf_hat
scalar rmse_2p = @rmse(inf, inf_hat)
'3 forecast
smpl 1954q3 2000q4
equation eq_inf.ls inf c inf(-1) inf(-2) inf(-3) inf(-4) u(-1) u(-2) u(-3) u(-4) ff(-1) ff(-2) ff(-3) ff(-4)
smpl 2001q1 2001q2
fit inf_hat
scalar rmse_3p = @rmse(inf, inf_hat)