IRIS-Solutions-Team / IRIS-Toolbox

[IrisToolbox] for Macroeconomic Modeling
Other
90 stars 41 forks source link

SVAR - Exact Zero Restrictions #313

Closed ospiridonova closed 2 years ago

ospiridonova commented 2 years ago

Hello!

I identify a SVAR model. The "householder" identifiation method lets me impose only sign restrictions. How can I impose an exact zero restriction in addition to sign restrictions? The option when I just add "== 0" to the logical expression ("test=") does not work.

My code example:

    v = VAR(list_1);
    [v, var_db] = estimate(v, db_raw, estStartDate:estEndDate, 'order=', p, 'const=', false, ...
        'covParameters=', true, 'BVAR=', litterman, 'stdize=', true, 'A=', constrA, 'timeWeights=', db_raw.w);     %This part works well:)
    test_string = [ ...
     ' S(4,1,1) > 0 ', ...
     '&& S(1,1,1) > 0 ', ...
     '&& S(1,5,1) < 0 ',...
     '&& S(2,2,1) < 0 ',...
      '&& S(6,1,1) == 0 ',...
      '&& S(2,1,1) > 0 '];
     [s3,sd3] = SVAR(v,var_db,'method=', 'householder', 'test=', test_string, 'ndraw=', 1000,'maxIter=',Inf,'progress=',true);

If I remove '&& S(6,1,1) == 0 ', then everything works fine, but the constraint is not satisfied. How can I add this restriction?

jaromir-benes commented 2 years ago

Hi Olga

This is because of the random sampling nature of the algorithm. In other words, the probability that a random number will be exactly equal to your desired value, is zero, and hence this algorithm cannot be used in that instance. As a workaround, you can specify some (rather narrow) interval around zero, e.g. S(6,1,1)<0.1 && S(6,1,1)>-0.1. The narrower the interval, the larger number of draws is needed, though.

Hope this helps. Best Jaromir

On Tue, Jan 18, 2022 at 12:04 PM Olga Spiridonova @.***> wrote:

Hello!

I identify a SVAR model. The "householder" identifiation method lets me impose only sign restrictions. How can I impose an exact zero restriction in addition to sign restrictions? The option when I just add "== 0" to the logical expression ("test=") does not work.

My code example:

v = VAR(list_1);
[v, var_db] = estimate(v, db_raw, estStartDate:estEndDate, 'order=', p, 'const=', false, ...
    'covParameters=', true, 'BVAR=', litterman, 'stdize=', true, 'A=', constrA, 'timeWeights=', db_raw.w);     %This part works well:)
test_string = [ ...
 ' S(4,1,1) > 0 ', ...
 '&& S(1,1,1) > 0 ', ...
 '&& S(1,5,1) < 0 ',...
 '&& S(2,2,1) < 0 ',...
  '&& S(6,1,1) == 0 ',...
  '&& S(2,1,1) > 0 '];
 [s3,sd3] = SVAR(v,var_db,'method=', 'householder', 'test=', test_string, 'ndraw=', 1000,'maxIter=',Inf,'progress=',true);

If I remove '&& S(6,1,1) == 0 ', then everything works fine, but the constraint is not satisfied. How can I add this restriction?

— Reply to this email directly, view it on GitHub https://github.com/IRIS-Solutions-Team/IRIS-Toolbox/issues/313, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGCVKKQTTVUT54EWRAF7GHDUWVCNDANCNFSM5MG3S7EA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

AndreyDO commented 2 years ago

Olga,

I recommend looking at the algorithm in "Inference Based on Structural Vector Autoregressions Identified With Sign and Zero Restrictions: Theory and Applications" by Arias, Rubio‐Ramírez, Waggoner (2018). There, the authors draw from the posterior distribution conditional on zero restrictions and then do the sign restrictions. The BEAR Toolbox has it implemented.

Andrey

ospiridonova commented 2 years ago

Thanks for the answers!