MCVARDoDraws—Procedure for drawing IRF's by Monte Carlo

Use this forum to post complete RATS "procedures". Please be sure to include instructions on using the procedure and detailed references where applicable.
TomDoan
Posts: 7645
Joined: Wed Nov 01, 2006 4:36 pm

MCVARDoDraws—Procedure for drawing IRF's by Monte Carlo

Unread post by TomDoan »

@MCVARDODRAWS is a procedure for doing the draws (only) for Monte Carlo integration of the impulse responses in a VAR. This leaves the graphing and other analysis to other procedures, particularly @MCGraphIRF and @MCProcessIRF.

Detailed description

Note that this has been substantially revised with version 9 of RATS with the addition of the FFUNCTION option. This makes it much easier to adapt to handle shocks other than Cholesky.
asdavies6032
Posts: 7
Joined: Sat Feb 13, 2010 4:13 am

mcvardodraws

Unread post by asdavies6032 »

Tom,
can you please help me solve this error:

## MAT2. Matrices with Dimensions 37 x 9 and 36 x 9 Involved in + Operation
The Error Occurred At Location 0425 of MCVARDODRAWS
Line 50 of MCVARDODRAWS

i am trying to draw impulse graphs for a 9 variable VAR
Albert
TomDoan
Posts: 7645
Joined: Wed Nov 01, 2006 4:36 pm

Re: mcvardodraws

Unread post by TomDoan »

asdavies6032 wrote:Tom,
can you please help me solve this error:

## MAT2. Matrices with Dimensions 37 x 9 and 36 x 9 Involved in + Operation
The Error Occurred At Location 0425 of MCVARDODRAWS
Line 50 of MCVARDODRAWS

i am trying to draw impulse graphs for a 9 variable VAR
Albert
The last thing you do before @MCVARDODRAWS should be an ESTIMATE on the model that you're inputting to the procedure. Offhand, it looks as if you're doing some other type of regression that doesn't match the VAR.
ateeb
Posts: 65
Joined: Sat Mar 16, 2019 11:15 am

Re: MCVARDoDraws - Procedure for drawing IRF's by Monte Carl

Unread post by ateeb »

@MCVARDODRAWS is a procedure for doing the draws (only) in a Monte Carlo analysis of a VAR. This leaves the graphing and other analysis to other procedures (particularly @MCGraphIRF). By default, @MCVARDODRAWS does a Cholesky factorization, though it can easily be adapted to other situations by using the FFUNCTION option to provide a function to compute an alternative factorization. A specific alternative for the Blanchard-Quah model is @BQDODRAWS.

How does this procedure handles the error correction term? or does it consider it to be one of the determinstic terms in the model when you place it in the set of deterministic variables?

Regards,
TomDoan
Posts: 7645
Joined: Wed Nov 01, 2006 4:36 pm

Re: MCVARDoDraws - Procedure for drawing IRF's by Monte Carl

Unread post by TomDoan »

See MONTEVECM.RPF. As long as you let RATS handle the accounting for the error correction terms, the stock @MCVARDODRAWS works.
ateeb
Posts: 65
Joined: Sat Mar 16, 2019 11:15 am

Re: MCVARDoDraws—Procedure for drawing IRF's by Monte Carlo

Unread post by ateeb »

I read that and understand that when we use ect term, the estimate instruction does the differencing itself but i have a question:

in my VECM model:

SYSTEM(MODEL=PK1MODEL)
VARIABLES Diffdebt DiffM1 DiffCPI logLSM r
LAGS 1
DET Constant lagresid du
END(SYSTEM)
ESTIMATE 2003:07 2018:09

there are 3 variables that are cointegrated i.e. logdebt, logM1 and logCPI however LogLSM and r are not cointegrated. Also LogLSM and r are stationary. LogLsm (industrial production) in logs and r (interest rates) in levels.

So the ECT.rpf which is an example of montevecm - states that

"
@johmle(lags=6,det=rc,cv=cvector)
# ftbs3 ftb12 fcm7
equation(coeffs=cvector) ecteq *
# ftbs3 ftb12 fcm7 constant



This sets up the VECM based upon that:

system(model=ectmodel)
variables ftbs3 ftb12 fcm7
lags 1 to 6
ect ecteq
end(system)

and this estimates it:

estimate

The number of estimated coefficients per equation is 16: 5 each on the lagged differences for each of the three variables, plus the one coefficient on the lagged error correction term. You don't have to create a separate series for the error correction, nor do you have to difference the data yourself⎯that's all done internally by the ESTIMATE instruction."

so this means if i write my model like:

equation(coeffs=cvector) lagresid *
# logdebt logM1 logCPI constant

SYSTEM(MODEL=PK1MODEL)
VARIABLES logdebt logM1 logCPI logLSM r
LAGS 1
DET Constant lagresid du
END(SYSTEM)
ESTIMATE 2003:07 2018:09

then it will be correct to use error instruction and the model will treat logdebt, logM1 and logCPI as I(1) and difference them but not LogLSM and r?
TomDoan
Posts: 7645
Joined: Wed Nov 01, 2006 4:36 pm

Re: MCVARDoDraws—Procedure for drawing IRF's by Monte Carlo

Unread post by TomDoan »

Are you saying the log of industrial production is stationary? (r is also usually treated as I(1)).

However, assuming that those are indeed stationary, the usual way to include those in a VECM is to add an error correction term for each which is the lagged level of the stationary variable. As you have that written, you'll have to do a lot of extra work since IMPULSE and ERRORS have no idea what the relationship is between the "diff" variables and their levels and between the levels and the "lagresid"---setting up a system using ECT gives you both.
ateeb
Posts: 65
Joined: Sat Mar 16, 2019 11:15 am

Re: MCVARDoDraws—Procedure for drawing IRF's by Monte Carlo

Unread post by ateeb »

Let me explain may be you can guide me better than.

The original variables are
Log of debt (NS)
Log of M1(NS)
Log of CPI (NS)
Log of IP (S)
Interest rate, r (S)

Specifying VAR in 1st difference will be miss specification error as Log of debt, log of M1 and log of CPI can have cointegration! Right?

Then if i use engle-granger procedure on pages 218-222 on programming manual that does not have stationary variables so they do not face this problem in the example.

So how would i setup my model VECM with logdebt logcpi and logm1 as non stationary and logLSM (log of IP) and r as stationary?

I ask this because @mcvardodraws would be inappropriaye for getting the standard errors? So can u help me how to setup this?
TomDoan
Posts: 7645
Joined: Wed Nov 01, 2006 4:36 pm

Re: MCVARDoDraws—Procedure for drawing IRF's by Monte Carlo

Unread post by TomDoan »

In what country is log IP stationary? A series can be non-stationary but not part of a cointegrating relationship with other variables in the system.
ateeb
Posts: 65
Joined: Sat Mar 16, 2019 11:15 am

Re: MCVARDoDraws—Procedure for drawing IRF's by Monte Carlo

Unread post by ateeb »

If i write the country it will like revealing my question of interest, therefore that i can share in an email. Furthermore, my sample and variables are already visible. I did not understand a series can be non stationary and still part of a cointegrating relationship, I know it is a LR relationship among non stationary variables already. I am more stuck with how to specify the system with both stationary variables and cointegrating vector in there. Also how to get standard errors for such a system so that i can plot IRFs and get VDCs.
TomDoan
Posts: 7645
Joined: Wed Nov 01, 2006 4:36 pm

Re: MCVARDoDraws—Procedure for drawing IRF's by Monte Carlo

Unread post by TomDoan »

There's no reason that you can't have a set of non-stationary series, some of which are cointegrated, some of which aren't---that's the same thing as the cointegrating vector having a zero coefficient on the series not involved.
ateeb
Posts: 65
Joined: Sat Mar 16, 2019 11:15 am

Re: MCVARDoDraws—Procedure for drawing IRF's by Monte Carlo

Unread post by ateeb »

The logLSM ( log of Industrial Production) is stationary and interest rate (r) also. So when i setup my System, should i use diff of Debt, M1 and CPI which are non stationary and levels of LSM and r or there will be another way of handling these together in a VECM model specification ... thats my question.
TomDoan
Posts: 7645
Joined: Wed Nov 01, 2006 4:36 pm

Re: MCVARDoDraws—Procedure for drawing IRF's by Monte Carlo

Unread post by TomDoan »

No. You let the program take care of everything. You put the five variables in as themselves (no differences), you do three error correction terms; one of which is your cointegrating relation, the other two are just

equation lsmect lsm
#
equation rect r
#
ateeb
Posts: 65
Joined: Sat Mar 16, 2019 11:15 am

Re: MCVARDoDraws—Procedure for drawing IRF's by Monte Carlo

Unread post by ateeb »

There is only 1 cointegrating vector among the non stationary variables i.e. logdebt, logM1 and logCPI ... so should i put in all variables in logs and then put the error correction equation in the deterministic part as the example specifies?

Also once i do that the @McVARdodraws will be able to correctly give me the standard errors and the errors commands would be giving me the correctly calculated standard errors?

This is what my advisor is concerned about and i also am, right now i am trying to learn more of how to code in RATs, following manuals.

Thanks for your reply. Waiting for your reply on the question above.

Regards,
TomDoan
Posts: 7645
Joined: Wed Nov 01, 2006 4:36 pm

Re: MCVARDoDraws—Procedure for drawing IRF's by Monte Carlo

Unread post by TomDoan »

If you want to include the two stationary variables as endogenous variables, you have to set it up as I indicated. A stationary variable is (in effect) "cointegrated" with itself. Read the User's Guide more carefully. Note that (30) can always be written in the form (31) regardless of whether the series are I(1), I(0), or any combination.

The model as you've written it is fine for estimation, but it doesn't have the proper dynamic links that are required for forecasting/impulse response analysis. That's what the Error correction form for the system provides.
Post Reply