Page 1 of 1

Recursived Forecast VAR Model

Posted: Wed Mar 27, 2013 1:28 am
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)


Re: Recursived Forecast VAR Model

Posted: Wed Mar 27, 2013 9:59 am
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.

Re: Recursived Forecast VAR Model

Posted: Wed Mar 27, 2013 8:48 pm
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)

Re: Recursived Forecast VAR Model

Posted: Wed Mar 27, 2013 10:05 pm
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.

Re: Recursived Forecast VAR Model

Posted: Thu Mar 28, 2013 2:59 am
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?

Re: Recursived Forecast VAR Model

Posted: Thu Mar 28, 2013 11:46 am
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.

Re: Recursived Forecast VAR Model

Posted: Mon Apr 01, 2013 10:00 pm
by Trankied
If I would like to know estimators in every steps, how should I add in my code?

Re: Recursived Forecast VAR Model

Posted: Tue Apr 02, 2013 7:47 am
by TomDoan
PRINT options on the ESTIMATE (rather than NOPRINT) and on the KALMAN

Re: Recursived Forecast VAR Model

Posted: Tue Apr 02, 2013 8:06 am
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.

Re: Recursived Forecast VAR Model

Posted: Tue Apr 02, 2013 9:26 am
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.

Re: Recursived Forecast VAR Model

Posted: Tue Apr 02, 2013 9:47 am
by Trankied
I wanna get estimated x1,y1,z1,x2,y2,z2,...,x10,y10,z10 under different VAR model , instead coefficient of VAR model.

Re: Recursived Forecast VAR Model

Posted: Tue Apr 02, 2013 11:23 am
by TomDoan
Changing to THEIL(PRINT) inside the loop will show the forecasts and actual data for each horizon.