Structural VAR model

Questions and discussions on Vector Autoregressions
Elyorbek
Posts: 11
Joined: Wed Jan 15, 2025 6:03 am

Structural VAR model

Unread post by Elyorbek »

Hi Tom,
I am a beginner in using RATS. Please, I have two questions. I have 6 variable VAR system (remittances, GDP, CPI, M2, interest rate (IR), and real effective exchange rate (REER)). All variables are not stationary; they are cointegrated. I wanted to check how do GDP and CPI react when there were shocks to M2, IR and REER. Initially, I found price and exchange rate puzzles with simple Cholesky ordering. Then, I got motivation from papers Pearsman & Smets (2001), Sims & Zha (1995) and Kim & Roubini (2000) who used contemporanous zero restrictions. Following to MONTESVAR.RPF example of Monte Carlo (importance sampling) on your platform, I wrote my code and solved price and exchange rate puzzles. My questions are as follows:
1. Did I choose right model and replication example by considering only 60 observations, which are short, non-stationary features, and the existence of cointegrated vectors? If you can suggest any other options or replication examples by considering my data features, please advise me.
2. If the MONTESVAR.RPF (example of Monte Carlo, importance sampling) is suitable, could you please review my implementation to ensure correctness for the next steps of my project?.

Thanks for your time and guidance in advance.

Best regards,
Elyor
Attachments
data-set.xlsx
(23.8 KiB) Downloaded 12 times
svar.rpf
(3.07 KiB) Downloaded 13 times
TomDoan
Posts: 7686
Joined: Wed Nov 01, 2006 4:36 pm

Re: Structural VAR model

Unread post by TomDoan »

First, I would recommend *not* scaling the interest rate:

set ir = r*.01

Just use set ir = r. With everything else in 100xlog's, doing the interest rates in percentages rather than fractions will give all the shocks roughly the same scale which will make the coefficients all O(1) rather than O(10^2) or O(10^-2).

60 data points isn't very many for a 4 lag 6 variable VAR. AIC and SBC pick 1 lag, and pretty strongly reject using 4, so I would shorten up the lags; probably no more than 2.

The technical problem that this model has (and shares with Kim-Roubini and Sims-Zha) is that the data don't seem to be very clear about what is going on with that 4, 5 and 6 equations. This has been better studied in the Sims-Zha model, but there they had two equations which they wanted to interpret as "money supply" and "money demand" but in practice a substantial number of simulations had the interpretations switched, resulting in a bimodal distribution. If you look at your model, the key coefficients (a45, a46, a54, a56, a64, a65) are insignificant, i.e. their signs are not well-determined.
Elyorbek
Posts: 11
Joined: Wed Jan 15, 2025 6:03 am

Re: Structural VAR model

Unread post by Elyorbek »

Dear Tom,
Thank you very much for the response.

I have changed lags and got almost similar results. You mentioned a technical problem related to coefficients (a45, a46, a54, a56, a64, a65) that do not have clear signs or significant values. Could you suggest how I can address this issue? How can I ensure that my model avoids this bimodal behavior?
Are there specific diagnostic tests or adjustments I can apply to improve the identification of shocks in my model?

Best regards,
Elyor
TomDoan
Posts: 7686
Joined: Wed Nov 01, 2006 4:36 pm

Re: Structural VAR model

Unread post by TomDoan »

The problem you are seeing is why increasingly people are using models with short- and long-run restrictions or sign restrictions for structural VAR's---with contemporaneous-only models it's difficult to separate (for instance) supply and demand effects.
Elyorbek
Posts: 11
Joined: Wed Jan 15, 2025 6:03 am

Re: Structural VAR model

Unread post by Elyorbek »

Dear Tom,

Thank you very much. As I understood your last answer, I should try short, long and sign restrictions. Do I understand you clearly?

Best regards,
Elyor
TomDoan
Posts: 7686
Joined: Wed Nov 01, 2006 4:36 pm

Re: Structural VAR model

Unread post by TomDoan »

Yes, I would suggest that you look at those alternative models.
Elyorbek
Posts: 11
Joined: Wed Jan 15, 2025 6:03 am

Re: Structural VAR model

Unread post by Elyorbek »

Dear Tom Doan,

Thanks for your advice!!!
Elyorbek
Posts: 11
Joined: Wed Jan 15, 2025 6:03 am

Re: Structural VAR model

Unread post by Elyorbek »

Dear Tom,
I changed identification from overidentified to just identified. As you write on the VAR book, error bands for just identified structures are similar to chapter 3.3. I followed that one to produce error bands but got error messages. Could you please check my code and help to correct errors? Files are attached.

Best regards,
Elyor
Attachments
svar2.rpf
(1.97 KiB) Downloaded 6 times
data-set.xlsx
(25.49 KiB) Downloaded 6 times
TomDoan
Posts: 7686
Joined: Wed Nov 01, 2006 4:36 pm

Re: Structural VAR model

Unread post by TomDoan »

First of all, you are misinterpreting what it is saying. A just-identified model *can* be done by re-estimating a factorization for each draw for the covariance matrix, but if you need CVMODEL to estimate the factorization, it may be more efficient to use the sampling techniques for over-identified models because of the time it takes to do the CVMODEL estimates (which needs to be re-done each draw). If you *had* a properly just-identified model, what this program is trying to do would require redoing the CVMODEL applied to SIGMAD rather than %SIGMA.

However, the more serious problem is that your model isn't globally identified as it fails the RRWZ test:

https://estima.com/webhelp/topics/var-s ... l#RRWZRule

Unfortunately, for A-form models, almost any model which satisfies this is likely to be just a re-arranged Cholesky factor.
Elyorbek
Posts: 11
Joined: Wed Jan 15, 2025 6:03 am

Re: Structural VAR model

Unread post by Elyorbek »

Dear Tom,

Based on your advice, I started to look at sign restriction procedure. I was going to see your replication code for Farrant and Peersman(2006), "Is the Exchange Rate a Shock Absorber or a Source of Shocks? New Empirical Evidence" but I got an error message when I ran it. I gave pictures in the attached Word file. Please instruct me on how to solve it.

Thanks in advance.
Attachments
technical problem.docx
(267.12 KiB) Downloaded 6 times
TomDoan
Posts: 7686
Joined: Wed Nov 01, 2006 4:36 pm

Re: Structural VAR model

Unread post by TomDoan »

Do the Help-Update Procedures operation. Some of the procedures were just written for this.
Elyorbek
Posts: 11
Joined: Wed Jan 15, 2025 6:03 am

Re: Structural VAR model

Unread post by Elyorbek »

Dear Tom,

I updated procedures and restarted my laptop. Then, I run the code. The new pop-up window is asking for the file name mcsignrestrictions, but what is available in my directory is mcsignrestriction (I am not sure whether one letter s is important or not) then I chose the RATS procedure file mcsignrestriction and pressed open. A new pop-up window is asking for the file mcsignrestrictio, but I could not find this in my procedure directory. What I found again is mcsignrestriction, and I opened it. As a result, I got this error message:
## CP17. PROCEDURE/FUNCTION Must be Initial Statement in a Compiled Section
>>>>procedure <<<<
## CP18. MCSIGNRESTRICTIO is not the Name of a PROCEDURE. (Did you forget to SOURCE?)
>>>>procedure <<<<
Sorry for this inconvenience. Please advise me again.

Best regards,
Elyor
TomDoan
Posts: 7686
Joined: Wed Nov 01, 2006 4:36 pm

Re: Structural VAR model

Unread post by TomDoan »

Sorry. Download the Farrant-Peersman zip again. We mistakenly posted an earlier version.
Elyorbek
Posts: 11
Joined: Wed Jan 15, 2025 6:03 am

Re: Structural VAR model

Unread post by Elyorbek »

Dear Tom,

I redownloaded the the Farrant-Peersman zip and run again. This time, there is not technical problem but it has not finished the procedure in 3 hours and is showing 5 hours left to finish it. What might be the reason? Please check the attached screen.

Best regards,
Elyor
Attachments
screen.docx
(267.18 KiB) Downloaded 3 times
TomDoan
Posts: 7686
Joined: Wed Nov 01, 2006 4:36 pm

Re: Structural VAR model

Unread post by TomDoan »

From the program file:

*
* This needs a large number of draws to get 10000 that achieve all the constraints
*
compute nkeep=10000
compute varDraws=10000
compute subDraws=20000

With the fully constrained four variable model, it is very hard to get a draw to satisfy all of them.
Post Reply