testing forecasts of VAR and BVAR models

Questions and discussions on Vector Autoregressions
sanjeev
Posts: 191
Joined: Mon Jun 18, 2012 6:51 am

Re: testing forecasts of VAR and BVAR models

Unread post by sanjeev »

Dear Tom,
Thanks for the reply. Much appreciated.
I have another question. I would be grateful if you could possibly guide me again.
I am doing the multiple regression using daily data. All explanatory variables are at one lag. I am having 891 sample. I am using first 800 sample for model estimation, and remaining 91 to check the forecast accuracy. I want to compute one step forecasts for all 91 periods, re-estimating at each period. I am doing recursive (static) forecast.
I have done the recursive forecast for ARMA(1,1) with the following code.
*
do time=801,891
boxjenk(noprint,constant,define=ar1ma1eq,ar=1,ma=1) y * time-1
uforecast(equation=ar1ma1eq,static) forecast_ar1ma1 time time
end do
*
However, I don’t know the code for recursive forecast of multiple regression.
Could you please help me with the code for multiple regression recursive forecast? My data set is also attached here.

Thanks
Sanjeev
Attachments
daily_data.xlsx
(65.22 KiB) Downloaded 642 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: testing forecasts of VAR and BVAR models

Unread post by TomDoan »

Depends upon what you mean by "multiple regression". If you mean a univariate regression with various explanatory variables, you can use UFORECAST---there's nothing about UFORECAST that's specific to pure time series models. If you mean a system with multiple dependent variables, use FORECAST.
sanjeev
Posts: 191
Joined: Mon Jun 18, 2012 6:51 am

Re: testing forecasts of VAR and BVAR models

Unread post by sanjeev »

TomDoan wrote:Depends upon what you mean by "multiple regression". If you mean a univariate regression with various explanatory variables, you can use UFORECAST---there's nothing about UFORECAST that's specific to pure time series models. If you mean a system with multiple dependent variables, use FORECAST.
Dear Tom,
I am doing the univariate regression with various explanatory variables. I need the loop command for recursive forecast for univariate regression with various explanatory variables. I am using the following code but invain:
*
do time=801,891
linreg(noprint,define=lineq, x1lag1, x2lag1,x3lag1,x4lag1,x5lag1,ylag1) y * time-1
uforecast(equation=lineq,static) forecast_lin time time
end do
*
Kindly suggest me correct code.
Thanks
Sanjeev
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: testing forecasts of VAR and BVAR models

Unread post by TomDoan »

I would suggest that you look up the syntax of LINREG. That's not even close to what a RATS instruction looks like.

I would also point out that Chapter 5 of the User's Guide, the one on Forecasting, explains how to do forecasting with multiple regression models and, in fact, has an example of forecasting with rolling samples with a multiple regression model.
sanjeev
Posts: 191
Joined: Mon Jun 18, 2012 6:51 am

Re: testing forecasts of VAR and BVAR models

Unread post by sanjeev »

TomDoan wrote:I would suggest that you look up the syntax of LINREG. That's not even close to what a RATS instruction looks like.

I would also point out that Chapter 5 of the User's Guide, the one on Forecasting, explains how to do forecasting with multiple regression models and, in fact, has an example of forecasting with rolling samples with a multiple regression model.
Dear Tom,
I am doing the univariate regression with various explanatory variables. I need the loop command for recursive forecast for univariate regression with various explanatory variables. I am using the following code but it gives dynamic forecast:
linreg(define=lineq) y * 800
# constant ylag1 x1lag1 x2lag1 x3lag1 x4lag1 x5lag1
uforecast(equation=lineq, print) forecast_lin 801 891
Kindly suggest me correct code for recursive forecast for univariate regression with various explanatory variables.
Thanks
Sanjeev
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: testing forecasts of VAR and BVAR models

Unread post by TomDoan »

Please read chapter 5. As I said, it has an example of rolling regression with a multiple regression. I would also note that RATS is not Stata---you don't have to create separate series for the lags. You can use y{1} x1{1} ... for lags of variables in a regressor list.
Post Reply