Recursived Forecast VAR Model

Questions and discussions on Vector Autoregressions
Trankied
Posts: 11
Joined: Sun Mar 10, 2013 10:48 pm

Recursived Forecast VAR Model

Unread post by Trankied »

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)

TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Recursived Forecast VAR Model

Unread post by TomDoan »

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.
Trankied
Posts: 11
Joined: Sun Mar 10, 2013 10:48 pm

Re: Recursived Forecast VAR Model

Unread post by Trankied »

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)
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Recursived Forecast VAR Model

Unread post by TomDoan »

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.
Trankied
Posts: 11
Joined: Sun Mar 10, 2013 10:48 pm

Re: Recursived Forecast VAR Model

Unread post by Trankied »

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?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Recursived Forecast VAR Model

Unread post by TomDoan »

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.
Trankied
Posts: 11
Joined: Sun Mar 10, 2013 10:48 pm

Re: Recursived Forecast VAR Model

Unread post by Trankied »

If I would like to know estimators in every steps, how should I add in my code?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Recursived Forecast VAR Model

Unread post by TomDoan »

PRINT options on the ESTIMATE (rather than NOPRINT) and on the KALMAN
Trankied
Posts: 11
Joined: Sun Mar 10, 2013 10:48 pm

Re: Recursived Forecast VAR Model

Unread post by Trankied »

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.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Recursived Forecast VAR Model

Unread post by TomDoan »

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.
Trankied
Posts: 11
Joined: Sun Mar 10, 2013 10:48 pm

Re: Recursived Forecast VAR Model

Unread post by Trankied »

I wanna get estimated x1,y1,z1,x2,y2,z2,...,x10,y10,z10 under different VAR model , instead coefficient of VAR model.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Recursived Forecast VAR Model

Unread post by TomDoan »

Changing to THEIL(PRINT) inside the loop will show the forecasts and actual data for each horizon.
Post Reply