Identifying VARs with sign restrictions

Questions and discussions on Vector Autoregressions
HypatiaCU
Posts: 12
Joined: Mon Nov 12, 2012 6:02 pm

Identifying VARs with sign restrictions

Unread post by HypatiaCU »

Dear Tom,

I am applying sign restrictions on a 2-variable VAR.
[y1_t,y2_t]'=A*[y1_{t-1},y2_{t-1}]'+[error1, erro2]’,
where
[error1, erro2]’ = [c11 c12; c21 c22]*[orthogonal_shock1, orthogonal_shock2]'. The restriction is on the contemporaneous impact.

I would like to use Uhlig’s penalty function approach. I know how to apply ‘uhligfuncs’ in the standard case (c11>0, or c12<0, etc). However, my sign restriction is a bit special. The restriction is c11>c21 and c12<c22. Is there a way to modify ‘uhligfuncs’ to apply my restrictions?

Thank you very much,
Hypatia
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Identifying VARs with sign restrictions

Unread post by TomDoan »

The simplest thing to do is to use y1-y2 and y2 as the two dependent variables. The model is the same, but that translates your restrictions into sign restrictions. The alternative is to do that on the fly by replacing

compute ik=(%xt(impulses,k)*q)./scales

with

compute ik=||1.0,-1.0|0.0,1.0||*(%xt(impulses,k)*q)./scales

which converts the impulse response to y1 and y2 into the response to y1-y2 and y2. Your first shock would want a positive response on the 1st transformed variable and the 2nd would have a negative response.
HypatiaCU
Posts: 12
Joined: Mon Nov 12, 2012 6:02 pm

Re: Identifying VARs with sign restrictions

Unread post by HypatiaCU »

Dear Tom,

I want to impose sign restrictions 'UhligPenalty' on two shocks simultaneously in the 2-variable VAR model.
[y1_t,y2_t]'=A*[y1_{t-1},y2_{t-1}]'+[error1, erro2]’,
where
[error1, erro2]’ = [c11 c12; c21 c22]*[orthogonal_shock1, orthogonal_shock2]'.
I am reading the code replicating Mountford and Uhlig(2009). Does 'g1' 'g2' 'g3' specifies different shocks in that code? Federal funds rate is the 4th variable in their VAR. Why goes "compute [vect] g2 =%fill(nvar-2,1,1.0)" specifies that the second shock is 'monetary policy shock'?

What should be my 'g1' and 'g2' if my shocks are orthogonal_shock1 and orthogonal_shock2?

Thank you very much,
Hypatia
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Identifying VARs with sign restrictions

Unread post by TomDoan »

HypatiaCU wrote:Dear Tom,

I want to impose sign restrictions 'UhligPenalty' on two shocks simultaneously in the 2-variable VAR model.
[y1_t,y2_t]'=A*[y1_{t-1},y2_{t-1}]'+[error1, erro2]’,
where
[error1, erro2]’ = [c11 c12; c21 c22]*[orthogonal_shock1, orthogonal_shock2]'.
I am reading the code replicating Mountford and Uhlig(2009). Does 'g1' 'g2' 'g3' specifies different shocks in that code? Federal funds rate is the 4th variable in their VAR. Why goes "compute [vect] g2 =%fill(nvar-2,1,1.0)" specifies that the second shock is 'monetary policy shock'?

What should be my 'g1' and 'g2' if my shocks are orthogonal_shock1 and orthogonal_shock2?

Thank you very much,
Hypatia
The G's are the basis weights on the subspace that's orthogonal to the previously chosen impulse vectors. That G2 is NVAR-2 x 1 has nothing to do with it being the monetary shock. It's due to it being the second shock chosen. The first has NVAR-1 free parameters (one degree of freedom being lost because the length has to be one), the second has NVAR-2 etc. It's the

compute func=UhligPenalty(v2,KMIN,KMAX,||+4,-5,-6,-7||)

is what makes it the monetary shock---the set of sign restrictions imposed. G1 and G2 (and in the Mountford-Uhlig example G3C and G3E) are being estimated by the FIND instructions as the penalty minimizers. The %ZEROS(...) is just to dimension them and give them guess values.
HypatiaCU
Posts: 12
Joined: Mon Nov 12, 2012 6:02 pm

Re: Identifying VARs with sign restrictions

Unread post by HypatiaCU »

TomDoan wrote: The G's are the basis weights on the subspace that's orthogonal to the previously chosen impulse vectors. The first has NVAR-1 free parameters (one degree of freedom being lost because the length has to be one), the second has NVAR-2 etc.
Dear Tom,

Only one shock with sign restrictions in a 2-variable VAR can be identified using penalty function approach, because there is only one degree of freedom. Is it correct?

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

Re: Identifying VARs with sign restrictions

Unread post by TomDoan »

Using sign restrictions generally, yes. Once one shock is chosen, the other is forced by orthogonality.
HypatiaCU
Posts: 12
Joined: Mon Nov 12, 2012 6:02 pm

Re: Identifying VARs with sign restrictions

Unread post by HypatiaCU »

TomDoan wrote:Using sign restrictions generally, yes. Once one shock is chosen, the other is forced by orthogonality.
Thank you, Tom. After I find the shock from the penalty function, how to construct the impulse responses of the orthogonal shock (bivariate VAR case). Should I change this line of code (ewise goodresp(accept)(i,j)=ik=%xt(impulses,i)*a,ik(j)) in Uhlig(2005) replication file?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Identifying VARs with sign restrictions

Unread post by TomDoan »

If you do @FORCEDFACTOR with the first shock input (as is done with the other multiple shock examples), then the second shock is just the final column of the factor matrix.
allister
Posts: 20
Joined: Sun Jan 10, 2010 10:26 am

Re: Identifying VARs with sign restrictions

Unread post by allister »

Hi Tom
I have somewhat of a silly question but I will ask nonetheless since i really I don't understand. In the case of a two shock or higher case in var's with sign restriction how does one know where the shock is emanating from. To make myself clear in terms of what I am asking, lets suppose that you have a demand and monetary shock and the demand shock is proxied by gdp and monetary shock by the federal funds rate and they are ordered 1 and 4 in the var. My question then is how do I know which shock is being represented in the sign restriction?



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

Re: Identifying VARs with sign restrictions

Unread post by TomDoan »

allister wrote:Hi Tom
I have somewhat of a silly question but I will ask nonetheless since i really I don't understand. In the case of a two shock or higher case in var's with sign restriction how does one know where the shock is emanating from. To make myself clear in terms of what I am asking, lets suppose that you have a demand and monetary shock and the demand shock is proxied by gdp and monetary shock by the federal funds rate and they are ordered 1 and 4 in the var. My question then is how do I know which shock is being represented in the sign restriction?

Allister
I'm not sure what you mean by the demand shock being "proxied by GDP". You provide a set of restrictions that each of the shocks has to meet. The one that meets the "demand shock" restrictions is the demand shock and the one that meets the monetary shock restrictions is the money shock.
Post Reply