Rubio Ramirez -Waggoner- Zha multiple shocks

Questions and discussions on Vector Autoregressions
KOBE24
Posts: 51
Joined: Tue Jul 21, 2009 9:10 am

Rubio Ramirez -Waggoner- Zha multiple shocks

Unread post by KOBE24 »

dear Tom,

I have a stupid question.

I am trying to identify 3 shocks using Todd Clarke code, but the sign matrix does not work.
Usually, I take this code to separate elements and arrays

||1., 2| 3, 4||

but Todd uses this code just to separate elements.


comp signs = ||%NA|-1|-1|1|-1|%NA||

Hence, I can not separate arrays: if I try the other way, RATS is very slow and at the end it does not give me IRFs.

Sorry for bothering with such a silly question.

Thanks a lot!
KOBE24
Posts: 51
Joined: Tue Jul 21, 2009 9:10 am

Re: Rubio Ramirez -Waggoner- Zha multiple shocks

Unread post by KOBE24 »

Hi Tom,

apparently I managed to write the matrixs it follows for two shocks (supply and monetary policy)


**********************************************************************************************
comp signs = ||1|-1|%NA|%NA|%NA|%NA||,||%NA|-1|-1|1|-1|%NA||
**********************************************************************************************

But I got this error message

**********************************************************************************
## MAT17. Can't Use Column Range of 2 to 2 in %XCOL operation
The Error Occurred At Location 0655 of loop/block
Line 45 of loop/block

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

Thanks for helping, when you have time!

Regards!
KOBE24
Posts: 51
Joined: Tue Jul 21, 2009 9:10 am

Re: Rubio Ramirez -Waggoner- Zha multiple shocks

Unread post by KOBE24 »

To be more precise, I post the code as in Todd.
The error comes at line "break", which I put in bold: until this point, RATS runs every line!



* Save the difference between the forecasts with and without and added shocks
* (and shift them into the slots 1,...,nhor) of <<goodhist>>.
*
ewise goodhist(accept,k)(i,j)=baseplus(j)(i+hstart-1)-base(j)(i+hstart-1)
end do k
*******************************************************************************
if accept>=nkeep
break
:105
end do subdraws
if accept>=nkeep
break
infobox(current=draws)
end do draws
moderator
Site Admin
Posts: 269
Joined: Thu Oct 19, 2006 4:33 pm

Re: Rubio Ramirez -Waggoner- Zha multiple shocks

Unread post by moderator »

I don't see how a BREAK instruction itself could generate that error. Based on the error message, it would have to be an instruction that included a call to %XCOL.

I would suggest that you use the "instruction location" information (rather than the line number, which you would have to count carefully from the proper starting point) to verify exactly which line is generating the error.

You may need to run your program using a command like:

source(echo) myprog.prg

in order to see the instruction location numbers prefixed to the lines in the loop. See Section 16.1 in the User's Guide for more on this.
KOBE24
Posts: 51
Joined: Tue Jul 21, 2009 9:10 am

Re: Rubio Ramirez -Waggoner- Zha multiple shocks

Unread post by KOBE24 »

Thanks for your point,

I will read section 16.1 and give back to you!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Rubio Ramirez -Waggoner- Zha multiple shocks

Unread post by TomDoan »

Note that there is no difference (other perhaps a (very) slight one in efficiency) between the RRWZ method and the code that we've used that do the multiple shocks sequentially. So don't knock yourself out trying to do a rewrite.
tclark
Posts: 99
Joined: Wed Nov 08, 2006 3:20 pm

Re: Rubio Ramirez -Waggoner- Zha multiple shocks

Unread post by tclark »

The matrix "signs" is set up to have rows = # variables and columns = # of shocks. To have multiple shocks, you need to unput the matrix to have multiple columns. I give an arbitrary example below. Recall that the "|" delineates rows, and a "," delineates rows.

** general matrix declaration as in program
dec rec signs(nvar,nshock) ;* a matrix with the signs to be imposed, for # shocks = nshock
* use a 1 for >= 0, -1 for <= 0, and %NA for unrestricted

** two-sign restriction example
comp signs = ||%NA,1|-1,1|-1,-1|1,-1|-1,%NA|%NA,%NA||
Todd Clark
Economic Research Dept.
Federal Reserve Bank of Cleveland
Post Reply