Page 1 of 3

Sign Restricted VAR

Posted: Thu Jan 21, 2016 6:26 pm
by dakila
This thread is about the srvar add-in that performs the estimation of Sign Restricted Vector Autoregression (SRVAR) models by using rejection and penalty function methods (Uhlig 2005).

Re: Sign Restricted VAR

Posted: Mon Feb 08, 2016 7:45 am
by kkotarac
Hi!

Thank you for this really interesting add-in. Have you considered extending it with different priors and/or more than one structural shock?

Best regards.

Re: Sign Restricted VAR

Posted: Tue Feb 09, 2016 4:47 am
by dakila
Hi kkotarac,

Thanks for your comment. Actually it is good point. To ensure orthogonality of structural shocks, some people suggest to use QR decomposition for a rejection method. However I couldn't find the difference. So for identification of multiple shocks, just do it again for other shocks. For a penalty function method, it is bit tricky. I will revise it with different priors and may extend penalty function approach with multiple shocks.

Re: Sign Restricted VAR

Posted: Wed Feb 10, 2016 3:28 am
by kkotarac
Thank you very much for a quick answer. My colleagues and me are glad to her this. We were also wondering if you would maybe be willing to provide a source code so we could try to enhance it to allow for zero restrictions also (using Arias et al., 2014 algorithm)?

Re: Sign Restricted VAR

Posted: Fri Feb 12, 2016 3:40 am
by lillumultipass
Dear sir,

thank you for this add-in. I am trying to estimate a bi-variate sign-restricted SVAR with daily oil and stock prices and two shocks (demand and supply).
The ultimate goal is to explain how much of the recent fall in oil prices stems from a demand shock (defined as a fall in both equity and oil prices) or a supply shock (defined as a rise in equity prices and a fall in oil prices).

After changing to program according to my needs, I get an error message just at the beginning: "Oil already exists and is of the wrong type in "VAR OIL.LS 1 7 OIL STOCKS @CONST"

VAR.OIL is the name I gave to my VAR, I have specified 7 lags and OIL and STOCKS are my 2 variables.
I don't understand what this error means.

thanks for your help!

Re: Sign Restricted VAR

Posted: Fri Feb 12, 2016 4:27 am
by lillumultipass
I think I found the solution to my problem: apparently, having the same name for the VAR and one variable was not wise :D Changing it solved everything :-)

However, I get another error:

sizes do not match in matrix function in "MATRIX INVAIRF_DRAW = @CHOLESKY(SIGMA_DRAW)*@TRANSPOSE(S)"

It looks like I made a mistake in the specification of the matrix of the shocks right?
Here is what I have:

!nshocks=2
for !r=1 to !nshocks
matrix(!nvar,3) R{!r}
next

string s1= "Demand Shock"
R1.fill(b=r) 0,0,1,0,0,1

string s2= "supply Shock"
R2.fill(b=r) 0,0,-1,0,0,1

thank you!

Re: Sign Restricted VAR

Posted: Fri Feb 12, 2016 6:03 am
by dakila
Did you read the instruction carefully?

Re: Sign Restricted VAR

Posted: Fri Feb 12, 2016 6:37 am
by lillumultipass
dakila wrote:Did you read the instruction carefully?


well, yes, I did, but I indeed don't really get the way the matrices are specified. Reading "To leave unrestricted set all three columns to zero" led me to put 0 0 in the first 2 columns as I did not want to put restrictions as to which periods the restrictions are imposed. But I think I should put 1 1 actually if I impose a restriction in the last column.

That's what I did and it is running : I am glad :-)
I may have set a too high number of draws however, because it is taking quite some time :-)

Re: Sign Restricted VAR

Posted: Wed Feb 17, 2016 8:23 am
by CharlieEVIEWS
I'd like to emphasize support for this brilliant add-in. Thanks to the creator indeed!

Re: Sign Restricted VAR

Posted: Thu Apr 07, 2016 4:07 am
by nadybe
my question may be obvious os stupid but where can you find the instructions for this add ins?

Than you very much

Re: Sign Restricted VAR

Posted: Thu Apr 07, 2016 7:08 am
by dakila
C:\Users\...\Documents\EViews Addins\srvar

Re: Sign Restricted VAR

Posted: Mon Apr 11, 2016 6:27 am
by naderian.amin
Dear Dakila,

I am trying to use this helpful add-ins to estimate a sign-restricted var for a three variable Killian model on the structure of crude oil market. However, I can not understand how it is possible to enter separate restrictions on contemporaneous impact of three distinct structural shocks (supply shocks, global demand shocks and residual shocks). As I use a 3*3 matrix of 1,0, -1 for each structural shock, it will return "no numeric argument" error.
Would you please kindly help me in this regard?

Re: Sign Restricted VAR

Posted: Mon Apr 11, 2016 7:02 am
by dakila
Did you read the instruction? If you want the impulse responses to be positive on the first variable and negative on the 3rd, you would use +1, −3 on the sign restriction box. For command line case, you should create a vector for constraint. For example, vector constraint =@fill(+1, −3). Do not use matrix.

Re: Sign Restricted VAR

Posted: Fri Jun 10, 2016 9:49 am
by wda
Dear Dakila,

Considering the sign restriction vector, I would like to know if the order matters or, alternatively, if, for example, the first element of constr indicates the shock of interest in the model.

Thank you in advance

Re: Sign Restricted VAR

Posted: Sat Jun 11, 2016 4:51 am
by dakila
No