BLOCK EXOGENEITY SVAR
BLOCK EXOGENEITY SVAR
Hey dear guys,
How are you? I am doing my dissertation about the Effects of Monetary Policy on Economic Activity for the Mexican case (a Small Open Economy). I am trying to estimate a block exogeneity SVAR. I ran the code but I am getting an error (the error message tells me something about one loop). Apparently, the error consists in trying to make the loop. (## Unassigned 613 The Error Occurred At Location 1563, Line 96 of loop/block).
I cannot identify where is the error. As a result, I was wondering if some of you may be familiar with that.
I add my data and code.
Thanks so much,
Fernando
How are you? I am doing my dissertation about the Effects of Monetary Policy on Economic Activity for the Mexican case (a Small Open Economy). I am trying to estimate a block exogeneity SVAR. I ran the code but I am getting an error (the error message tells me something about one loop). Apparently, the error consists in trying to make the loop. (## Unassigned 613 The Error Occurred At Location 1563, Line 96 of loop/block).
I cannot identify where is the error. As a result, I was wondering if some of you may be familiar with that.
I add my data and code.
Thanks so much,
Fernando
- Attachments
-
- code.RPF
- CODE
- (14.34 KiB) Downloaded 903 times
Re: BLOCK EXOGENEITY SVAR
It looks like you copied the information about saving the responses verbatim from the Cushman and Zha paper, which is a different model. It has 4 variables in the exogenous block where you have 3, so, in particular,
compute %%responseus(draw)(14,h)=impulses(11,1)(h)
can't work since you have to variable 11. You also might want to look at the different linear combinations and see if they even make sense with your data.
compute %%responseus(draw)(14,h)=impulses(11,1)(h)
can't work since you have to variable 11. You also might want to look at the different linear combinations and see if they even make sense with your data.
Re: BLOCK EXOGENEITY SVAR
Thanks so much for you very quick response. I really really appreciate your very kind help and support Dear Tom.
Your comment was very helpful, I solved the issue.
I apologize for the delay to reply.
My best wishes,
Fernando
Your comment was very helpful, I solved the issue.
I apologize for the delay to reply.
My best wishes,
Fernando
Re: BLOCK EXOGENEITY SVAR
Hi Everyone:
I am replicating the Cushman and Zha (1997) model but for the Mexican case.
Before writing this question I tried to find the answer but it has not been possible to me finding it.
I think the question is very simple.
And it is regarding the syntax of one line of the code, which is this one:
compute %%responsems(draw)(2,h)=impulses(2,1)(h)
My question is if the number -2- refers to the second variable in the model (the variable that is going to respond) and if the number 1 is the variable (money supply) in which we assume the shock?
And why we include h in the line?
If you think that I may look for the answer in one specific paper, textbook or handbook, I will really thank you if you let me know where I can find them.
I already run the model but my impulse response functions look flat. Which it does not make sense for me.
I really thank you for all your help and support.
Thanks so much,
I am replicating the Cushman and Zha (1997) model but for the Mexican case.
Before writing this question I tried to find the answer but it has not been possible to me finding it.
I think the question is very simple.
And it is regarding the syntax of one line of the code, which is this one:
compute %%responsems(draw)(2,h)=impulses(2,1)(h)
My question is if the number -2- refers to the second variable in the model (the variable that is going to respond) and if the number 1 is the variable (money supply) in which we assume the shock?
And why we include h in the line?
If you think that I may look for the answer in one specific paper, textbook or handbook, I will really thank you if you let me know where I can find them.
I already run the model but my impulse response functions look flat. Which it does not make sense for me.
I really thank you for all your help and support.
Thanks so much,
Re: BLOCK EXOGENEITY SVAR
H is the horizon:
do h=1,steps
...
end do h
The IMPULSE instruction is what is generating the IMPULSES array.
impulse(noprint,model=surmodel,shock=canmoney,$
results=impulses,steps=steps)
This does only one shock, so the IMPULSES series will all be IMPULSES(target series,1). (The column in IMPULSES is the number of the shock, which will always be 1 here since only one shock is being used).
compute %%responsems(draw)(2,h)=impulses(2,1)(h)
The 2 on the right side is the variable from the VAR. The 2 on the left is whatever the desired response is in the list:
compute MSResponses=||"Exchange Rate","Money","Interest Rate","Price","Output","Export","Import",$
"Trade Balance","Real Interest Rate","Real Exchange Rate","UIP Condition"||
that is, here it would be money. Many of them are just direct copies of the responses, but some of the ones later on:
compute %%responsems(draw)(8,h)=impulses(5,1)(h)-impulses(4,1)(h)
compute %%responsems(draw)(9,h)=impulses(3,1)(h)-(impulses(7,1)(h+3)-impulses(7,1)(h))*400.0
compute %%responsems(draw)(10,h)=impulses(1,1)(h)+impulses(7,1)(h)-impulses(9,1)(h)
compute %%responsems(draw)(11,h)=impulses(3,1)(h)-impulses(10,1)(h)+(impulses(1,1)(h+3)-impulses(1,1)(h))*400.0
are linear combinations (sometimes across multiple horizons) of the base variables. If you're interested in learning more about those, you should read the paper carefully.
do h=1,steps
...
end do h
The IMPULSE instruction is what is generating the IMPULSES array.
impulse(noprint,model=surmodel,shock=canmoney,$
results=impulses,steps=steps)
This does only one shock, so the IMPULSES series will all be IMPULSES(target series,1). (The column in IMPULSES is the number of the shock, which will always be 1 here since only one shock is being used).
compute %%responsems(draw)(2,h)=impulses(2,1)(h)
The 2 on the right side is the variable from the VAR. The 2 on the left is whatever the desired response is in the list:
compute MSResponses=||"Exchange Rate","Money","Interest Rate","Price","Output","Export","Import",$
"Trade Balance","Real Interest Rate","Real Exchange Rate","UIP Condition"||
that is, here it would be money. Many of them are just direct copies of the responses, but some of the ones later on:
compute %%responsems(draw)(8,h)=impulses(5,1)(h)-impulses(4,1)(h)
compute %%responsems(draw)(9,h)=impulses(3,1)(h)-(impulses(7,1)(h+3)-impulses(7,1)(h))*400.0
compute %%responsems(draw)(10,h)=impulses(1,1)(h)+impulses(7,1)(h)-impulses(9,1)(h)
compute %%responsems(draw)(11,h)=impulses(3,1)(h)-impulses(10,1)(h)+(impulses(1,1)(h+3)-impulses(1,1)(h))*400.0
are linear combinations (sometimes across multiple horizons) of the base variables. If you're interested in learning more about those, you should read the paper carefully.
Re: BLOCK EXOGENEITY SVAR
Thank you so much Dear Tom. I really appreciate it. You are so nice!
Re: BLOCK EXOGENEITY SVAR
Hi Everyone,
I am trying to estimate a Block Exogeneity SVAR similar to Cushman and Zha (1997). But my model is a little different.
I am using 10 variables. 7 of them are for Mexico (inside) and 3 for the USA (outside). Frequency data is monthly and seasonally adjusted (I do not include seasonal dummies in my model). Time period is 1997m01 to 2019m12.
The seven variables for Mexico are according to the common literature for a small open economy (Y, CPI, EXC, R)-that is; production, prices index, exchange rate and short-term interest rate. But instead Y, I am using employment as a proxy variable of production for four regions (South-ES-, North Central-ECN-, North-EN, and Central-EC). My idea is to analyze the heterogenous effects across the employment of different Mexican regions given a domestic monetary policy shock.
The exogenous variables are the ones for USA (Industrial Production-Y*, CPI* and Federal Funds Rate-R*).
All the variables are in logs with exemption of interest rates.
I assume that there is not contemporaneous relationship between the employment levels of different regions. And for the rest of the domestic variables I assume a recursive order (same order as above indicated). I also assume that USA variables do not respond to Mexican variables. The block for USA variables is lower triangular. And I assumed that CPI respond on impact to CPI* and R responds on impact to R*.
However, after I tried to estimate the SVAR using the Cushman and Zha Model with the above modifications, I found that the IRF´s for regional employment given a domestic monetary policy shock (R) DO NOT make sense at all.
In the first graph (Figure 1), I set up all the “guess initial values” outside the diagonal in the domestic block (block11) equal to 0.5 and for the diagonal values I assumed they are equal to 1. Results look very WEIRD. I think I am overfitting.
In Figure 2, I changed the “guess initial values” by estimating the coefficients outside the diagonal in the domestic block11using Eviews. I estimated the impact matrix and I got some values. Of course, the problem is that in Eviews I can´t impose restrictions on the lag matrices. So, I am just using those values as approximates. Results make more sense, but still not very confident.
In figure 3, I estimated a VARX in RATS with endogenous (Mexican) and exogenous-American- (deterministic variables) and results make much more sense. I would expect that employment in the southern region shows that “puzzling response”.
As a result, I have noticed that the model is very sensitive to the “guess initial values” and I was wondering if there could be something else that I would adjust to be able to use the Cushman and Zha (1997) Model with the previous changes indicated.
For instance, I have read that I can also modify these lines. However, I have also read that changes to these values do not make big differences.
1. compute fcvx=.25*%decomp(%xx)
2. compute c=.9*inv(%decomp(y2m2))
Nevertheless, what really worry me is that the bands, for instance the ones showed in the Figure 4, DO NOT MAKE SENSE AT ALL. The scale is huge, that really concerns me.
As a result, I was wondering if you may have an idea of what may be wrong and what I may adjust.
Attached you will find my code and data,
Thanks so much,
Luis
I am trying to estimate a Block Exogeneity SVAR similar to Cushman and Zha (1997). But my model is a little different.
I am using 10 variables. 7 of them are for Mexico (inside) and 3 for the USA (outside). Frequency data is monthly and seasonally adjusted (I do not include seasonal dummies in my model). Time period is 1997m01 to 2019m12.
The seven variables for Mexico are according to the common literature for a small open economy (Y, CPI, EXC, R)-that is; production, prices index, exchange rate and short-term interest rate. But instead Y, I am using employment as a proxy variable of production for four regions (South-ES-, North Central-ECN-, North-EN, and Central-EC). My idea is to analyze the heterogenous effects across the employment of different Mexican regions given a domestic monetary policy shock.
The exogenous variables are the ones for USA (Industrial Production-Y*, CPI* and Federal Funds Rate-R*).
All the variables are in logs with exemption of interest rates.
I assume that there is not contemporaneous relationship between the employment levels of different regions. And for the rest of the domestic variables I assume a recursive order (same order as above indicated). I also assume that USA variables do not respond to Mexican variables. The block for USA variables is lower triangular. And I assumed that CPI respond on impact to CPI* and R responds on impact to R*.
However, after I tried to estimate the SVAR using the Cushman and Zha Model with the above modifications, I found that the IRF´s for regional employment given a domestic monetary policy shock (R) DO NOT make sense at all.
In the first graph (Figure 1), I set up all the “guess initial values” outside the diagonal in the domestic block (block11) equal to 0.5 and for the diagonal values I assumed they are equal to 1. Results look very WEIRD. I think I am overfitting.
In Figure 2, I changed the “guess initial values” by estimating the coefficients outside the diagonal in the domestic block11using Eviews. I estimated the impact matrix and I got some values. Of course, the problem is that in Eviews I can´t impose restrictions on the lag matrices. So, I am just using those values as approximates. Results make more sense, but still not very confident.
In figure 3, I estimated a VARX in RATS with endogenous (Mexican) and exogenous-American- (deterministic variables) and results make much more sense. I would expect that employment in the southern region shows that “puzzling response”.
As a result, I have noticed that the model is very sensitive to the “guess initial values” and I was wondering if there could be something else that I would adjust to be able to use the Cushman and Zha (1997) Model with the previous changes indicated.
For instance, I have read that I can also modify these lines. However, I have also read that changes to these values do not make big differences.
1. compute fcvx=.25*%decomp(%xx)
2. compute c=.9*inv(%decomp(y2m2))
Nevertheless, what really worry me is that the bands, for instance the ones showed in the Figure 4, DO NOT MAKE SENSE AT ALL. The scale is huge, that really concerns me.
As a result, I was wondering if you may have an idea of what may be wrong and what I may adjust.
Attached you will find my code and data,
Thanks so much,
Luis
Last edited by lfc160030 on Mon Jul 27, 2020 3:59 pm, edited 1 time in total.
Re: BLOCK EXOGENEITY SVAR
Hi Tom,
I am trying to replicate the Cushman and Zha (1997) for the Mexican case. However it is the case that the bands are very broad. Scale is huge(millions). My variables are in log levels except the interest rates. Attaches you will see the IRF of employment to a monetary shock.
Any ideas about what may be wrong,
I already tried different number of iterations to see if the problem is that, but look like it IS NOT. The problem persists.
Thanks so much,
Luis
I am trying to replicate the Cushman and Zha (1997) for the Mexican case. However it is the case that the bands are very broad. Scale is huge(millions). My variables are in log levels except the interest rates. Attaches you will see the IRF of employment to a monetary shock.
Any ideas about what may be wrong,
I already tried different number of iterations to see if the problem is that, but look like it IS NOT. The problem persists.
Thanks so much,
Luis
TomDoan wrote:H is the horizon:
do h=1,steps
...
end do h
The IMPULSE instruction is what is generating the IMPULSES array.
impulse(noprint,model=surmodel,shock=canmoney,$
results=impulses,steps=steps)
This does only one shock, so the IMPULSES series will all be IMPULSES(target series,1). (The column in IMPULSES is the number of the shock, which will always be 1 here since only one shock is being used).
compute %%responsems(draw)(2,h)=impulses(2,1)(h)
The 2 on the right side is the variable from the VAR. The 2 on the left is whatever the desired response is in the list:
compute MSResponses=||"Exchange Rate","Money","Interest Rate","Price","Output","Export","Import",$
"Trade Balance","Real Interest Rate","Real Exchange Rate","UIP Condition"||
that is, here it would be money. Many of them are just direct copies of the responses, but some of the ones later on:
compute %%responsems(draw)(8,h)=impulses(5,1)(h)-impulses(4,1)(h)
compute %%responsems(draw)(9,h)=impulses(3,1)(h)-(impulses(7,1)(h+3)-impulses(7,1)(h))*400.0
compute %%responsems(draw)(10,h)=impulses(1,1)(h)+impulses(7,1)(h)-impulses(9,1)(h)
compute %%responsems(draw)(11,h)=impulses(3,1)(h)-impulses(10,1)(h)+(impulses(1,1)(h+3)-impulses(1,1)(h))*400.0
are linear combinations (sometimes across multiple horizons) of the base variables. If you're interested in learning more about those, you should read the paper carefully.
Re: BLOCK EXOGENEITY SVAR
Dear Tom,
After some time I realized that the problem was that in my data interest rates were in units, that is 20% equal to 20. I solved all my problems putting 20% equal to 0.2.
In the replication code I saw that they used my first scale option.
That SOLVED alll my previous problems,
Thanks so much,
Luis
After some time I realized that the problem was that in my data interest rates were in units, that is 20% equal to 20. I solved all my problems putting 20% equal to 0.2.
In the replication code I saw that they used my first scale option.
That SOLVED alll my previous problems,
Thanks so much,
Luis
Re: BLOCK EXOGENEITY SVAR
Hi Everyone,
Does someboy know if there is a test that we can use to prove that the SVAR (like the one of Cushman and Zha (1997)) with a exogenous block is stable?
Thanks,
Luis
Does someboy know if there is a test that we can use to prove that the SVAR (like the one of Cushman and Zha (1997)) with a exogenous block is stable?
Thanks,
Luis
Re: BLOCK EXOGENEITY SVAR
Stable in what sense?
Re: BLOCK EXOGENEITY SVAR
Roots of reverse characteristic polynomial.
Re: BLOCK EXOGENEITY SVAR
%MODELLARGESTROOT can be applied to any type of VAR or restricted VAR. The model is stable if the largest root is <1 (though in practice, it's not uncommon for the largest root to be very slightly larger than 1, like 1.002).
Re: BLOCK EXOGENEITY SVAR
Thanks so much Dear Tom,
I really appreciate it,
Very nice,
Luis
I really appreciate it,
Very nice,
Luis