Fry-Pagan JEL 2011

Use this forum for posting example programs or short bits of sample code.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Fry-Pagan JEL 2011

Unread post by TomDoan »

This is an example of the calculation of Fry-Pagan (2011) median target estimators. "Sign Restrictions in Structural Vector Autoregressions: A Critical Review," Journal of Economic Literature, vol. 49, no. 4, 938-60. The example is taken from Uhlig(2005), "What are the effects of monetary policy on output? Results from an agnostic identification procedure", Journal of Monetary Economics, 52, pp 381-419.

As noted in the comments, there is no reason that the minimum distance response has to be inside the [16-84]-ile bands at every point, and in this case, the short-run responses for non-borrowed reserves are outside of it.
uhlig fry pagan.rpf
Program file
(4.66 KiB) Downloaded 1382 times
uhligdata.xls
Data file
(96 KiB) Downloaded 922 times
luching
Posts: 64
Joined: Mon Jun 07, 2010 4:05 pm

Re: Fry-Pagan JEL 2011

Unread post by luching »

Hi Tom, I tried implementing the Fry-Pagan minimization in a different setting. You did mention that the selected impulse might lie outside the confidence bands. On a more fundamental note, will the Fry-Pagan approach guarantee that the selected impulse satisfies the sign restrictions we impose (in all the horizons)? I suspect the minimization routine does not guarantee that, but would like to double check with you.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Fry-Pagan JEL 2011

Unread post by TomDoan »

luching wrote:Hi Tom, I tried implementing the Fry-Pagan minimization in a different setting. You did mention that the selected impulse might lie outside the confidence bands. On a more fundamental note, will the Fry-Pagan approach guarantee that the selected impulse satisfies the sign restrictions we impose (in all the horizons)? I suspect the minimization routine does not guarantee that, but would like to double check with you.
That's correct. It chooses the impulse vector whose responses come "closest" to the median of the cloud of responses which do satisfy the constraints, but there is no guarantee that it itself satisfies those constraints.
umee
Posts: 22
Joined: Sat Mar 05, 2016 5:39 pm

Re: Fry-Pagan JEL 2011

Unread post by umee »

Tom,

How might I alter this code to produce forecast error variance decomposition?

I tried altering it with aspects of the Uhlig (2005) code, but had no success.

Thanks,
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Fry-Pagan JEL 2011

Unread post by TomDoan »

Add this to the end. It's just a single shock, so it's just a single calculation.

Code: Select all

*
* Compute the percentages of this shock in the FEVD
*
declare series[rect] irfsquared
declare vector ones ik
declare rect fevd(nstep,nvar)
compute ones=%fill(nvar,1,1.0)
*
gset irfsquared 1 1     = %xt(impulses,t).^2
gset irfsquared 2 nstep = irfsquared{1}+%xt(impulses,t).^2
ewise fevd(i,j)=ik=(irfsquared(i)*(a.^2))./(irfsquared(i)*ones),ik(j)
report(action=define,title="Forecast Variance Explained by FP Shock")
report(atrow=1,atcol=2,align=center) vl
report(atcol=1,atrow=2,fillby=cols) %seq(1,nstep)
report(atrow=2,atcol=2) 100.0*fevd
report(action=format,atrow=2,picture="###.###")
report(action=show)
umee
Posts: 22
Joined: Sat Mar 05, 2016 5:39 pm

Re: Fry-Pagan JEL 2011

Unread post by umee »

Thanks. How might I graph the FEVDs? I've tried the following, but no success.

do i=1,nvar
compute minlower=maxupper=0.0
smpl 1 accept
do k=1,nstep
set work = fevd(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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Fry-Pagan JEL 2011

Unread post by TomDoan »

Graph what? It's one shock.
umee
Posts: 22
Joined: Sat Mar 05, 2016 5:39 pm

Re: Fry-Pagan JEL 2011

Unread post by umee »

Can I not graph the FEVD for the 1, 2, 3, ....step ahead? So for GDP, can I simple create a graph of the numbers that coincide with the FEVD.
umee
Posts: 22
Joined: Sat Mar 05, 2016 5:39 pm

Re: Fry-Pagan JEL 2011

Unread post by umee »

I guess what I'm saying is, instead of presenting the numbers, is there a better graphical presentation?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Fry-Pagan JEL 2011

Unread post by TomDoan »

It's one shock. There are no error bands. I'm not sure what a graph is doing that's not obvious from the table. (To be perfectly honest, I don't even know what an FEVD of the FP shock is supposed to be showing anyway).
umee
Posts: 22
Joined: Sat Mar 05, 2016 5:39 pm

Re: Fry-Pagan JEL 2011

Unread post by umee »

Is it possible to calculate the error variance for each accepted draw, and then use that info to construct an error variance graph from 1 to 50 steps ahead?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Fry-Pagan JEL 2011

Unread post by TomDoan »

The original Uhlig paper has FEVD's done what way. You're posting questions in a thread about Fry-Pagan.
Post Reply