Sign Restricted VAR
Moderators: EViews Gareth, EViews Moderator, EViews Esther
Sign Restricted VAR
This thread is about the srvar addin that performs the estimation of Sign Restricted Vector Autoregression (SRVAR) models by using rejection and penalty function methods (Uhlig 2005).
Last edited by dakila on Sat Jan 05, 2019 3:10 pm, edited 2 times in total.
Re: Sign Restricted VAR
Hi!
Thank you for this really interesting addin. Have you considered extending it with different priors and/or more than one structural shock?
Best regards.
Thank you for this really interesting addin. Have you considered extending it with different priors and/or more than one structural shock?
Best regards.
Re: Sign Restricted VAR
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.
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
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)?

 Posts: 9
 Joined: Fri Feb 12, 2016 3:33 am
Re: Sign Restricted VAR
Dear sir,
thank you for this addin. I am trying to estimate a bivariate signrestricted 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!
thank you for this addin. I am trying to estimate a bivariate signrestricted 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!

 Posts: 9
 Joined: Fri Feb 12, 2016 3:33 am
Re: Sign Restricted VAR
I think I found the solution to my problem: apparently, having the same name for the VAR and one variable was not wise 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!
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
Did you read the instruction carefully?

 Posts: 9
 Joined: Fri Feb 12, 2016 3:33 am
Re: Sign Restricted VAR
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

 Posts: 202
 Joined: Tue Jul 17, 2012 9:47 am
Re: Sign Restricted VAR
I'd like to emphasize support for this brilliant addin. Thanks to the creator indeed!
Re: Sign Restricted VAR
my question may be obvious os stupid but where can you find the instructions for this add ins?
Than you very much
Than you very much
Re: Sign Restricted VAR
C:\Users\...\Documents\EViews Addins\srvar

 Posts: 1
 Joined: Mon May 02, 2011 7:32 am
Re: Sign Restricted VAR
Dear Dakila,
I am trying to use this helpful addins to estimate a signrestricted 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?
I am trying to use this helpful addins to estimate a signrestricted 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
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
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
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
Who is online
Users browsing this forum: No registered users and 3 guests