I am trying to compute forecast error decompositions based on the rolling VAR estimate so I wrote the following code. But the output looks like a recursive since I have more results than expected. Can you please tell me what is wrong with this code? Besides Can you please show me how to extract a table including the results of the whole sample?
I would like adjust this code for also weekly data later.
Best Regards
Code: Select all
compute lags=2;*Number of lags
compute nstep=13 ;*Number of response steps
*
open data 2015_fuel_diff.xls
calendar(m) 1992
data(format=xls,org=columns) 1992:2 2013:10
table
compute nspan=36
do time= 1996:4, 2013:10
system(model=fuel)
variables oil er dis pri ip
lags 1 to lags
det constant ffr{1} ipus{1}
end(system)
estimate(resids=varresids, noprint) time-nspan+1 time
errors(model=fuel, steps=nstep, results=vardec, noprint)
com i11pri = vardec(4,1)(12), i12pri = vardec(4,2)(12) , i13pri = vardec(4,3)(12) , i14pri = vardec(4,4)(12), i15pri= vardec(4,5)(12)
com [rect[real]] primat = ||i11pri, i12pri, i13pri, i14pri, i15pri||
dis primat
end do time