Recursived Forecast VAR Model

Questions and discussions on Vector Autoregressions

Recursived Forecast VAR Model

Postby Trankied » Wed Mar 27, 2013 1:28 am

Dear all,
I want to forecast next 10 period on my VAR model.
I have 100 data. First, I want to use the first 90 data to estimate 91, then use the first 90 data and 91 estimator to do the new VAR.
Second, use the new VAR model to estimate 92 estimator and repeat estimate the VAR model until I get the 100 estimator.
I have to compare the difference between estimator and real value to test it fitted or not.
It's seems different from static forecast or dynamic forecast.
How could I code?

I thought the wrong code is as following:
Code: Select all
SYSTEM(MODEL=A)
VARIABLES X Y Z
LAGS 1 TO 3
DET Constant
END(SYSTEM)
ESTIMATE(noprint)
FORECAST(MODEL=A,FROM=91,TO=100)

Trankied
 
Posts: 12
Joined: Sun Mar 10, 2013 10:48 pm

Re: Recursived Forecast VAR Model

Postby TomDoan » Wed Mar 27, 2013 9:59 am

Use KALMAN to update the estimates and THEIL to do the forecasts and compute the performance statistics. See, for instance, page RM-486 in the RATS v8 Reference Manual.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Recursived Forecast VAR Model

Postby Trankied » Wed Mar 27, 2013 8:48 pm

Is it correct to code as following?

Code: Select all
SYSTEM(MODEL=A)
VARIABLES X Y Z
LAGS 1 TO 3
DET Constant
END(SYSTEM)
ESTIMATE(noprint)

theil(setup,model=A,steps=10,to=100)
estimate(noprint,noftests) * 90
do time=1,100
if time==91 ; theil(dump)
theil time
kalman
end
theil(dump)
Trankied
 
Posts: 12
Joined: Sun Mar 10, 2013 10:48 pm

Re: Recursived Forecast VAR Model

Postby TomDoan » Wed Mar 27, 2013 10:05 pm

Change it to:

theil(setup,model=A,steps=10,to=100)
estimate(noprint,noftests) * 90
do time=91,100
theil time
kalman
end
theil(dump)

You want the loop to run over the period from 91 to 100---the period where you want to do the rolling estimation.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Recursived Forecast VAR Model

Postby Trankied » Thu Mar 28, 2013 2:59 am

Thanks for your great help.
While I want to use t information to estimate t+1 only.
Is N Obs colum means we use t period VAR model to estimate t+1~t+10 and compare to their real value then get RMS Error?
What I want to do is use
1~t period VAR estimate t+1(hat) , 1~t+1(hat) period VAR estimate t+2(hat) ,...,1~t+9(hat) period VAR estimate t+10(hat)
and compute RMS.

Does the last raw of RMS exactly what I need?
Trankied
 
Posts: 12
Joined: Sun Mar 10, 2013 10:48 pm

Re: Recursived Forecast VAR Model

Postby TomDoan » Thu Mar 28, 2013 11:46 am

Then you just want STEPS=1 on the THEIL. The table of statistics is computed separately for each horizon but aggregated across the start period of forecasts, so 1 step is for the performance of the one-step-ahead forecasts over the (in your case) 10 periods, 2 if for the 2-step-ahead forecasts (for which there will be just 9), etc. If you change to STEPS=1, you'll only get one line for each variable.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Recursived Forecast VAR Model

Postby Trankied » Mon Apr 01, 2013 10:00 pm

If I would like to know estimators in every steps, how should I add in my code?
Trankied
 
Posts: 12
Joined: Sun Mar 10, 2013 10:48 pm

Re: Recursived Forecast VAR Model

Postby TomDoan » Tue Apr 02, 2013 7:47 am

PRINT options on the ESTIMATE (rather than NOPRINT) and on the KALMAN
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Recursived Forecast VAR Model

Postby Trankied » Tue Apr 02, 2013 8:06 am

I plus print under kalman and get VAR Coefficients in every steps.
Instead of calculating estimations by myself, is there exist any way can help me insert the real value into VAR model in every steps and get variables estimated value by coding?
Thanks for your great help.
Trankied
 
Posts: 12
Joined: Sun Mar 10, 2013 10:48 pm

Re: Recursived Forecast VAR Model

Postby TomDoan » Tue Apr 02, 2013 9:26 am

I have no idea what you mean. The KALMAN does rolling estimations adding a data point from the original data onto the end of the interval at each time period. That sounded like what you wanted.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Recursived Forecast VAR Model

Postby Trankied » Tue Apr 02, 2013 9:47 am

I wanna get estimated x1,y1,z1,x2,y2,z2,...,x10,y10,z10 under different VAR model , instead coefficient of VAR model.
Trankied
 
Posts: 12
Joined: Sun Mar 10, 2013 10:48 pm

Re: Recursived Forecast VAR Model

Postby TomDoan » Tue Apr 02, 2013 11:23 am

Changing to THEIL(PRINT) inside the loop will show the forecasts and actual data for each horizon.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm


Return to VARs (Vector Autoregression Models)

Who is online

Users browsing this forum: No registered users and 0 guests

cron