I am trying to modify the code from the replication files for Mountford and Uhlig (2009). I am struggling with doing this for nshocks>1.

I modified the code for identification of the first part by restricting the rotation vector as follows:

- Code: Select all
`************************************************`

* First in Order - Supply Shock

************************************************

compute [vector] v1=%zeros(1,1)~~%ransphere(nvar-1)

if UhligAccept(v1,KMIN,KMAX,||+2,-3||)==0

goto reject

compute i1=p*v1

By this I can make sure that the first variable does not respond on impact to the first structural shock.

The code goes on with forcing i1 as one column in the factorization ...

- Code: Select all
`@forcedfactor(force=column) sigmad i1 f`

compute r2=inv(p)*%xsubmat(f,1,nvar,2,nvar)

... and identifying the next shock:

- Code: Select all
`*****************************************************`

* Second in Order - Demand Shock

*****************************************************

compute [vector] v2=r2*%ransphere(nvar-1)

if UhligAccept(v2,KMIN,KMAX,||+1,+2,+3||)==0

goto reject

compute i2=p*v2

The point at which I am struggling is how to impose the same zero-restriction also for this second shock (variable 1 should not respond also to the second shock on impact). How can I find the second rotation vector such that its first element is 0 and that it "fits" to the first one in terms of the orthogonality condition? I couldn't find any example in the replication section that uses a similar identification scheme.