Hi,
I have a dataset containing panel data for the period 2008-2015. I want to use recursive forecasting to create predictions on an out-of-sample basis. The main idea is as follows:
I want to estimate a simple regression model (y on x1 and x2) for year=2008 and use the estimated model to predict the y value for 2009 -->> estimate the regression model for year=2008 +2009 and use the estimated model to predict the y value for 2010 -->> etc. Repeat this process until I have obtained predicted values for my y variable for the years 2009-2015.
Is there an efficient way to do this which also allows me to store the predicted values under one variable name (y_pred)?
Many thanks, Ali
I have a dataset containing panel data for the period 2008-2015. I want to use recursive forecasting to create predictions on an out-of-sample basis. The main idea is as follows:
I want to estimate a simple regression model (y on x1 and x2) for year=2008 and use the estimated model to predict the y value for 2009 -->> estimate the regression model for year=2008 +2009 and use the estimated model to predict the y value for 2010 -->> etc. Repeat this process until I have obtained predicted values for my y variable for the years 2009-2015.
Is there an efficient way to do this which also allows me to store the predicted values under one variable name (y_pred)?
Many thanks, Ali
Comment