Identifying multiple shocks using Sign Restrictions

Topics: VAR, SVAR, FAVAR
Aug 6, 2014 at 9:14 AM
Hi Jaromir,
Is it possible to identify multiple shocks at the same time using the sign restrictions approach in IRIS?
Thanks
C.
Coordinator
Aug 9, 2014 at 12:19 PM
Hi C,

Yes, you can specify any number of generalized restrictions for any number of shocks (and you can even impose restrictions that combine two or more shocks -- e.g. that the sum of responses to shock 1 plus shock 2 must be positive, etc.)

J.
Marked as answer by jaromirbenes on 8/9/2014 at 5:19 AM
Aug 10, 2014 at 9:50 AM
Thanks for your response. How do I change the code to do that? For example if I want to identify both demand and supply shocks from a single run of the model, do I need to write two sets of strings?
Thanks for your help.
C.
Coordinator
Aug 10, 2014 at 10:57 AM
Edited Aug 10, 2014 at 10:58 AM
Simple add some more conditions to the test string using the && operator (keep in mind that the procedure does not identify individual shocks, but rather the entire contemporaneous shock matrix).

Let's say you have a VAR with 2 variables, y and pi (output gap and inflation), and want to identify a structural VAR where the first shocks is a "demand" shock (y and pi move in the same direction in the very first period) and the second shock is a "supply" shock (y and pi move in opposite directions in the very first period). The test string should then look like this:
test = 'sign(S(1,1,1)) == sign(S(2,1,1)) && sign(S(1,2,1)) == -sign(S(2,2,1))';
(note that sign(...) is a standard Matlab function).

This is a very simple example -- for instance, it is not guaranteed that some of the signs don't flip into something that does not make sense in the second period, etc.

Hope this helps.

Jaromir
Marked as answer by jaromirbenes on 8/10/2014 at 3:58 AM
Aug 12, 2014 at 5:04 AM
Thanks Jaromir..
Aug 25, 2014 at 11:28 AM
Am I missing something when I use this test?
test = ' S(1,1,1)>=0 && S(2,1,1)>=0 && S(1,2,1)>=0 && S(1,1,1)<=0 '?
Coordinator
Aug 25, 2014 at 11:50 AM
ferob wrote:
Am I missing something when I use this test?
test = ' S(1,1,1)>=0 && S(2,1,1)>=0 && S(1,2,1)>=0 && S(1,1,1)<=0 '?
S(1,1,1)>=0 && S(1,1,1)<=0 will only be true if S(1,1,1)==0. The probability that this is true in a simulation context is basically zero. I guess it is not able to identify any models when you run it.
Marked as answer by jaromirbenes on 8/25/2014 at 6:06 AM
Coordinator
Aug 25, 2014 at 1:06 PM
Yeah, looks like a typo. You probably wanted to write S(2,2,1)<=0 for the last term, didn't you?
Marked as answer by jaromirbenes on 8/25/2014 at 6:06 AM
Sep 1, 2014 at 12:40 PM
yes, I meant S(2,2,1)<=0. My question was on design of the check constraint function and how it perform with respect to different form of test string.
Am I missing something in terms of symmetry or speed?
Coordinator
Sep 1, 2014 at 8:05 PM
It looks alright to my eyes. What kinds of issues are you having?
Sep 2, 2014 at 11:40 AM
I am just asking, as recently I struggled with a model. Lot of time spent but no successful draws.:-)
Coordinator
Sep 2, 2014 at 11:46 AM
Upload the model. I'm curious myself.
Sep 16, 2014 at 2:45 AM
Edited Sep 18, 2014 at 8:38 AM
Hi Jaromir,
I have another question on sign restrictions. I want to calculate the historical decompositions after identifying the shocks with sign restrictions.
I identified the shocks successfully and get sv1 and sv1data using
[sv1,sv1data,index1,crit1] = sort(sv,svdata,select,'progress=',true).
Then I try to calculate the contributions using the following;

c = simulate(sv1,sv1data,startHist+p:endHist, ...
    'contributions=',true); %?contrib?
and get the following error;
Cannot simulate multiple parameterisations or multiple data sets with 'contributions=' true

sv1 and sv1data are based on 500 parametrisations which is the source of the problem I suppose. Could you please let me know how to correct for this? Thanks

ps. I've just tried the following and it seemed to have worked. Could you please let me know if it is the correct way to do that?
sv1data.res_Yield(:,2:end) = [];
sv1data.res_SP500(:,2:end) = [];


c = simulate(sv1(1),sv1data,startHist+p:endHist, ...
    'contributions=',true); %?contrib?