Page 1 of 1

Historical Decomposition

Posted: Wed Oct 02, 2013 2:11 pm
by AhmedSahlool
Dear Tom,

I hope this finds you well,

I would like to know why the sum of components resulting from historical decomposition, within gibbs sampling, does not sum to the actual observed value?

is it the result of skewed distribution, I average the resulting components using this loop:

Do i = 1,(nvar+1)
Do j=1,nvar

Set History(i,j) hstart hend = History(i,j)/ndraws

End do j
End do i

Do you recommend the median to get closer to the actual observation?

Would you kindly indicate how to implement it, as i tried many ways and I can not apply it.


Thank you and best regards

Re: Historical Decomposition

Posted: Wed Oct 02, 2013 2:54 pm
by TomDoan
The historical decomposition only reproduces the original data if the residuals are recomputed for new coefficients. That's covered in Chapter 4 of the VAR Workbook.

The medians of the decompositions won't necessarily add up. The means will.

Re: Historical Decomposition

Posted: Wed Oct 02, 2013 5:56 pm
by AhmedSahlool
I bought the material, I wait for it.

Would you kindly give me more hints till I receive it as I need to finish this model as soon as I can.

Thank you very much

Re: Historical Decomposition

Posted: Wed Oct 02, 2013 9:38 pm
by TomDoan
One of the example files for the Uhlig JME 2005 paper does the historical decomposition under a sampling system. Note that this isn't included in Uhlig's paper.

Re: Historical Decomposition

Posted: Thu Oct 03, 2013 8:26 am
by AhmedSahlool
Dear Tom,

I hope this finds you well,

I applied the routine for my model, however, I need to get results in the same order as those obtained with History; a matrix(nvar+1,navr), which represents the average of ndraws results, so I can graph them as I need.

Would you give me some guidance.

Thank you in advance

Re: Historical Decomposition

Posted: Thu Oct 03, 2013 9:41 am
by TomDoan
If you post what you have, I can tell you how to change it. Note, however, that if I were to redesign HISTORY now, I wouldn't arrange the output series that way---the obvious place for the base forecast is the final slot, not the first.

Re: Historical Decomposition

Posted: Thu Oct 03, 2013 10:37 am
by AhmedSahlool
Hi Tom,

Kindly find attached the program.

I tried to apply the routine outside the loop to see what I can get. I end with a matrix which is (nhor,nvar), the difference between "baseplus" and 'base". I need to have (NVAR+1,NVAR) for each NHOR, which is organized for History command as (nhor, nvar+1) for each NVAR.

So I don't know how to get this information after GIBBs sampling.

Do you see any with your experience any other pb with this program.

Thank you and best regards

Re: Historical Decomposition

Posted: Thu Oct 03, 2013 12:55 pm
by TomDoan
I found only one case where someone has asked for this in the past. One of the problems is that the base forecast range tends to be very broad. I've attached a revision of your program which does the number crunching for a full historical decomposition. The Uhlig example does only a single shock, which requires different bookkeeping.