Page 2 of 2

Re: VAR Forecast from Difference to Levels

Posted: Mon Jul 12, 2021 1:27 pm
by TomDoan
Yes. You can also do:

frml(identity) VCREDITSEnseq VCREDITSEns = VCREDITSEns{1}+dVCREDITSEns

which will work with version 10.

Re: VAR Forecast from Difference to Levels

Posted: Mon Jul 12, 2021 2:38 pm
by ac_1
If the forecast SE's of the DIFFERENCE series are in:

Code: Select all

prin / s(1) s(2) s(3) s(4)
And the forecast SE's of the ORIGINAL series in LEVELS are:

Code: Select all

prin / COREERRORS(5) COREERRORS(6) COREERRORS(7) COREERRORS(8)
What do these refer to?

Code: Select all

prin / COREERRORS(1) COREERRORS(2) COREERRORS(3) COREERRORS(4)

Re: VAR Forecast from Difference to Levels

Posted: Wed Jan 31, 2024 9:25 pm
by TomDoan
ac_1 wrote: Mon Jul 12, 2021 2:38 pm If the forecast SE's of the DIFFERENCE series are in:

Code: Select all

prin / s(1) s(2) s(3) s(4)
And the forecast SE's of the ORIGINAL series in LEVELS are:

Code: Select all

prin / COREERRORS(5) COREERRORS(6) COREERRORS(7) COREERRORS(8)
What do these refer to?

Code: Select all

prin / COREERRORS(1) COREERRORS(2) COREERRORS(3) COREERRORS(4)
The first four equations/FRML's are for the differenced series.

Re: VAR Forecast from Difference to Levels

Posted: Fri Mar 22, 2024 3:00 am
by ac_1
Method:
(a) the differences [dVAR]
(b) blank ECT instruction [VAR ECT]

I can generate the same forecasts and SE's, in-levels, static one-step ahead using both methods!

For dynamic multi-step ahead I can generate the same forecasts (also can be calculated with ACCUMULATE as mentioned earlier in the topic). However, I cannot aggregate the SE's from method (a) to match the results of (b). Presumably I need a formulae for those?

Here's an example using the data from ECT.RPF.

Code: Select all

*===============================
* set parameters

comp nsteps = 10


*===============================
* ***************
* *** DYNAMIC ***
* ***************

* VAR ECT
* -------
system(model=dvarmodel2)
variables ftbs3 ftb12 fcm7
lags 1 2 3 4 5 6 7; * 7 lagged levels are equivalent to 6 lagged changes
ect; * NO error correction terms
det constant
end(system)
estimate(noftests) 1975:07 2001:06-nsteps
*
forecast(model=dvarmodel2,results=f_D,stderrs=s_D,from=2001:6-nsteps+1,steps=nsteps)

prin 2001:6-nsteps+1 2001:06 f_D s_D


*===============================
* dVAR
* ----
dec vect[series] dfcast_D(3)
dec vect[series] dstderrs_D(3)

diff ftbs3 / dftbs3
diff ftb12 / dftb12
diff fcm7 / dfcm7

system(model=dvarmodel1)
variables dftbs3 dftb12 dfcm7
lags 1 2 3 4 5 6
det constant
end(system)
estimate(noftests) 1975:07 2001:06-nsteps
forecast(model=dvarmodel1,results=dfcast_D,stderrs=dstderrs_D,from=2001:6-nsteps+1,steps=nsteps)

prin 2001:6-nsteps+1 2001:06 dfcast_D dstderrs_D


* Back-out FORECAST's and SE's in LEVELS having estimated VAR for DIFFERENCE series
frml(identity) ftbs3_eq ftbs3 = ftbs3{1}+dftbs3
frml(identity) ftb12_eq ftb12 = ftb12{1}+dftb12
frml(identity) fcm7_eq  fcm7  = fcm7{1}+dfcm7

FORECAST(MODEL=dvarmodel1+ftbs3_eq+ftb12_eq+fcm7_eq,NOSTATIC,RESULTS=COREFOR_D,STDERRS=COREERRORS_D,from=2001:6-nsteps+1,steps=nsteps)

prin / COREFOR_D
prin / COREERRORS_D