I might be doing something wrong, but when I use lagged xregs in a model and then generate forecasts, the first n (where n is the max lag period) values are NA, but only for the first .rep.
This model results in an NA forecast for 2009 Q3, but only for the first rep. Initially I saw the NA and though it was because new_data doesn't contain lag = 1 for the first observation of the xreg (I would think the model could get it from the original training data, but that's a separate issue). However, I noticed that in all reps > 1, the value for 2009 Q3 was returned successfully.
From what I found, this generalizes to any n lag periods, where the first n values of the first .rep will be NA.
I might be doing something wrong, but when I use lagged xregs in a model and then generate forecasts, the first n (where n is the max lag period) values are
NA
, but only for the first.rep
.Basic Forecast (no lags)
Works as expected.
Forecast with lagged xregs
This model results in an
NA
forecast for 2009 Q3, but only for the first rep. Initially I saw theNA
and though it was becausenew_data
doesn't contain lag = 1 for the first observation of the xreg (I would think the model could get it from the original training data, but that's a separate issue). However, I noticed that in all reps > 1, the value for 2009 Q3 was returned successfully.From what I found, this generalizes to any n lag periods, where the first n values of the first
.rep
will beNA
.I'm not sure if this is a bug, or if I'm mis-understanding how I am supposed to supply new data to
generate()
.