Page 1 of 1
Variance Decomposition with Sign restrictions
Posted: Mon Aug 09, 2010 4:08 pm
by KOBE24
Dear Tom,
sorry for bothering you with such a stupid question.
I am interested in getting a variance decomposition table for a VAR in 4 variables (output, inflation, interest rate and exchange rate).
I am performing full identification with sign restrictions (supply, demand, monetary policy and ex. rate shock): but I do not want the graph with the bands..
how can I get such a table? could you please help me one more time?
Further, may I get such a decomposition even adding a fifth variable (commodity prices) and not identifying a fifth shock?
I really hope you can help me, I am in troubles!
Kind regards,
Kobe24
Re: Variance Decomposition with Sign restrictions
Posted: Tue Aug 10, 2010 11:50 am
by KOBE24
Hello,
I clarify my question...
I need a table like the one you get when running the instruction ERRORS in the simple Cholesky scheme.
Of course one get the matrix of FEVD just adding for each shocks goodfevd goodfevda and so on.
But then, I am no more able in recovering a table... I think I need to store them some way, but I still don't get any advances...
Any guess or suggestions?
Thanks in advance!
Re: Variance Decomposition with Sign restrictions
Posted: Tue Aug 10, 2010 12:35 pm
by TomDoan
The Mountford and Uhlig example doesn't do the FEVD, but the original Uhlig paper does in the uhlig2 program file. Although that just does one shock, that same calculation works for any shock you use. The key is that the "denominator" (the k-step ahead variance) changes with the draw for the VAR coefficients and covariance matrix (outer loop), but isn't dependent upon the shocks that you isolate. As a result, you can compute the percentage due to each shock without knowing what the other shocks are.
BTW, calculating the FEVD with sign restrictions is covered in the VAR course:
http://www.estima.com/courses_completed.shtml
Re: Variance Decomposition with Sign restrictions
Posted: Wed Aug 11, 2010 5:49 am
by KOBE24
Dear Tom,
thanks for your kind support and help!
I think I understand your point, and the fact you have to increment not only goodresp, but goodfevd too to be able to plot or table them (their median with the upper and lower band).
What I don't get it's maybe more stupid, I guess (maybe I need some days relax): let's consider the example uhlig2 you correctly pointed out.
If I run it all, I obtain two outputs: the irf and the fevd with their respective error bands. Now, in the post processing section for the FEVD I would like
finding some output storing the progression of variance explained by the shock from 1 to nstep.
However, the only thing I get is "work", which is not a matrix, but looks like a series if one checks for it in the show series window.
Further, the plot coming from uhlig2 shows very similar (almost identical) shares of variance explained for the six variables: is it correct? It sounds a little puzzling to me..
Last, should it not be compute resp(k)=%avg(work) instead of frac(2)?
Sorry for these (many) silly questions, but I am really in desperate need to find an appropriate decomposition!
Regards,
KOBE
spgraph(vfields=3,hfields=2,$
footer="Figure 8. Fraction of Variance Explained with Pure-Sign Approach")
do i=1,nvar
compute minlower=maxupper=0.0
smpl 1 accept
do k=1,nstep
set work = goodfevd(t)(k,i)
compute frac=%fractiles(work,||.16,.50,.84||)
compute lower(k)=frac(1)
compute upper(k)=frac(3)
compute resp(k)=frac(2)
end do k
*
smpl 1 nstep
graph(ticks,number=0,min=0.0,picture="##.##",$
header="Fraction Explained for "+vl(i)) 3
# resp
# upper / 2
# lower / 2
end do i
*
spgraph(done)
Re: Variance Decomposition with Sign restrictions
Posted: Wed Aug 11, 2010 12:39 pm
by TomDoan
This will do what you want. If you want to skip some steps, just switch from
do k=1,nstep
to
dofor k = (for instance) 1 2 4 8 12 16 20 24
Code: Select all
report(action=define)
report(atrow=1,atcol=1,fillby=rows) "Step" vl
do k=1,nstep
report(atrow=k+1,atcol=1) k
end do k
do i=1,nvar
compute minlower=maxupper=0.0
smpl 1 accept
do k=1,nstep
set work = goodfevd(t)(k,i)
compute frac=%fractiles(work,||.16,.50,.84||)
compute lower(k)=frac(1)
compute upper(k)=frac(3)
compute resp(k)=frac(2)
report(atrow=k+1,atcol=i+1) 100.0*resp(k)
end do k
end do i
*
report(action=format,picture="##.##")
report(action=show)
Re: Variance Decomposition with Sign restrictions
Posted: Wed Aug 11, 2010 12:48 pm
by KOBE24
I just tried the code and it is simply PERFECT!
Don't know what to say..
THANK YOU, TOM! YOU BASICALLY SAVED MY LIFE!!!!!