hi: that model is what the political scientists called an LDV ( lagged dependent variable model ), the marketing people call a koyck distributed model and the economists call it an ADL(1,0) or ADL(0,1). ( i forget ).
You have to be careful about the error term because, if it's not white noise, then the coefficient on hire.total.lag1 is biased. ( there's a whole literature on this. google for regression with lagged dependent variable and a lot of things should come up ). In that case, you need to build the likelihood and use optim or optimx because lm is not the correct approach. as far as prediction, most people assume an impulse at x ( you're case.total variable ) and zero afterwards but, since you have them and don't need to assume an implulse, then I would just do the prediction by brute force as you were planning to do. let me know off line if you want papers about below from many different perspectives ( econ, marketing, poli sci ) and also, send it to R-Sig-Finance because it's more relevant there so more people will respond probably. but apologize for cross-posting. mark On Wed, Nov 30, 2011 at 4:40 PM, AaronB <aa...@communityattributes.com>wrote: > I'm currently working with some time series data with the xts package, and > would like to generate a forecast 12 periods into the future. There are > limited observations, so I am unable to use an ARIMA model for the > forecast. > Here's the regression setup, after converting everything from zoo objects > to > vectors. > > hire.total.lag1 <- lag(hire.total, lag=-1, na.pad=TRUE) > lm.model <- lm(hire.total ~ case.total + hire.total.lag1) > > hire.total is a monthly historical time series from Jan 2010 to Oct 2011. > hire.total.lag1 is the same time series, lagged 1 period backwards. > case.total is a monthly historical time series from Jan 2010 to Oct 2011, > plus forecasts forward another 12 periods. > > I'd like to use this model to forecast hire.total for the next period, and > use each successive prediction of hire.total as the lag1 "observation" for > the next prediction. I have enough "observed" values for case.total to > forecast out as far as I need. I might be able to construct this using a > loop, but I have a feeling it will be messy and slow. Any suggestions? > > > > > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/forecasting-linear-regression-from-lagged-variable-tp4125091p4125091.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.