Page 1 of 2

Short-and-long run restrictions with VECM

Posted: Wed Jun 16, 2010 5:38 pm
by TomDoan
The following is an example of a structural VECM using short and long-run restrictions. It shows how to compute the sum of the moving average coefficients for a VECM, and impose the restrictions using the ShortAndLong procedure. Note that because the long-run response matrix is singular, some zero restrictions will be forced due to other zero restrictions; in this case, because the MASUMS matrix is rank one, any zero anywhere in a column will force all three variables to have a zero long-run response to that shock.

Code: Select all

*
* Lutkepohl, New Introduction to Multiple Time Series Analysis
* Example 9.4 from pp 377-383
*
open data kpswdata.rat
calendar(q) 1947
data(format=rats) 1947:1 1988:4 c in y mp dp r
*
* Data are already in logs. We need to scale by 100.
*
set c  = c*100.0
set y  = y*100.0
set in = in*100.0
*
graph(footer="Figure 9.1 Quarterly U.S. data",$
  key=below,klabels=||"Income","Consumption","Investment"||) 3
# y
# c
# in
*
* With two cointegrating vectors, this would be easier to analyze using
* CATS.
*
@johmle(lags=2,det=constant,vectors=eigenvect)
# y c in
*
* Normalize first two eigenvectors to be identity in top 2 x 2 corner.
*
compute beta=%xsubmat(eigenvect,1,3,1,2)*inv(%xsubmat(eigenvect,1,2,1,2))
*
* Define the two cointegrating relations for input into ECT
*
dec vect[equation] ecteqns(2)
equation(coeffs=%xcol(beta,1)) ecteqns(1)
# y c in
equation(coeffs=%xcol(beta,2)) ecteqns(2)
# y c in
*
* Define and estimate the VECM
*
system(model=vecm)
variables y c in
det constant
lags 1 2
ect ecteqns
end(system)
*
estimate
*
* Compute the long-run response matrix for the VECM. For a model
* estimated with an ECT component, %varlagsums is the sum of lags on the
* differences only.
*
compute masums=%perp(beta)*$
  inv(tr(%perp(%vecmalpha))*%varlagsums*%perp(beta))*$
             tr(%perp(%vecmalpha))
*
dec rect lr(3,3) sr(3,3)
*
* Because of rank 2 cointegration, the masums matrix is rank one. As a
* result, restricting the (1,2) and (1,3) long-run responses to zero
* also forces the responses of the other two variables to zero as well.
* So three restrictions (in this pattern) will just identify the model.
*
input lr
 . 0 0
 . . .
 . . .
input sr
 . . .
 . . 0
 . . .
@ShortAndLong(lr=lr,sr=sr,masum=masums) %sigma f
disp ###.### "Impact Responses" f
disp ###.### "Long run Responses" masums*f
*
@varirf(factor=f,steps=30,model=vecm,shocklabels=||"Permanent","Trans 1","Trans 2"||)
Data file:
kpswdata.rat
(14.75 KiB) Downloaded 1481 times

Re: Short-and-long run restrictions with VECM

Posted: Mon Jun 21, 2010 7:10 pm
by luxu1983
dear
how to determine the permanent shock and graph the common trend? through weakly exogenous test?
thank you

Re: Short-and-long run restrictions with VECM

Posted: Tue Jun 22, 2010 11:55 am
by TomDoan
To get the permanent shock, use @StructResids and take the first component. The common trend is just the accumulation of that.

Re: Short-and-long run restrictions with VECM

Posted: Tue Jun 22, 2010 12:15 pm
by luxu1983
TomDoan wrote:To get the permanent shock, use @StructResids and take the first component. The common trend is just the accumulation of that.
code like this ?
"@structresids(factor=f) resids %regstart() %regend() sresids"
is the first component sresids(1)?

Re: Short-and-long run restrictions with VECM

Posted: Tue Jun 22, 2010 4:54 pm
by TomDoan
luxu1983 wrote:
TomDoan wrote:To get the permanent shock, use @StructResids and take the first component. The common trend is just the accumulation of that.
code like this ?
"@structresids(factor=f) resids %regstart() %regend() sresids"
is the first component sresids(1)?
That's correct. You also have to add a RESIDS=resids option to the ESTIMATE.

Re: Short-and-long run restrictions with VECM

Posted: Wed Jun 23, 2010 12:37 pm
by TomDoan
I would suggest you get a copy of The Cointegrated VAR Model by Juselius. It not only explains the mechanics of cointegration, but also how you give an economic interpretation to the results. If currencies A and B are out of PPP---is A high; is B low; both? The policy makers in country A would probably say B is low; the policy makers in country B would probably say A is high. The data aren't really equipped to answer that; that's why economists write papers with policy histories and discussions.

Re: Short-and-long run restrictions with VECM

Posted: Tue May 29, 2012 10:26 am
by dacanoo
Hi Tom, I am trying to estimate a SVECM and see how one of the variables behaves after imposing different long-run and short-run restrictions. I wonder if the "Impact Responses" and "Long run Responses" output from @ShortAndLong are the estimated coefficients of the SVECM, and if I can use them to obtain the 'fitted' values. What I have in mind is to use this coefficients, the permanent shocks from @StructResids and the initial values of the variable to get a Beveridge-Nelson MA representation of the SVECM. Is this a right procedure? and if not, how can I get the fitted values?

Re: Short-and-long run restrictions with VECM

Posted: Wed May 30, 2012 5:32 pm
by TomDoan
dacanoo wrote:Hi Tom, I am trying to estimate a SVECM and see how one of the variables behaves after imposing different long-run and short-run restrictions. I wonder if the "Impact Responses" and "Long run Responses" output from @ShortAndLong are the estimated coefficients of the SVECM, and if I can use them to obtain the 'fitted' values. What I have in mind is to use this coefficients, the permanent shocks from @StructResids and the initial values of the variable to get a Beveridge-Nelson MA representation of the SVECM. Is this a right procedure? and if not, how can I get the fitted values?
The stochastic trend representation of the series of a VECM doesn't depend upon the structural model for the covariance matrix---it's a function of the lag parameters of the VECM and the non-orthogonalized innovations. If you impose a structural model on the innovation, you simply rotate the component trends and counter-rotate the weights to get the same result.

Re: Short-and-long run restrictions with VECM

Posted: Fri Jun 08, 2012 1:21 pm
by dacanoo
Thank you Tom, I think I don't really understand the reason to impose short and long run restrictions in a VECM. I've seen in Johansen (1995) that cointegration coefficients can not be interpreted as elasticities, neither cointegrating relations as equations, but that a in SVECM it is possible. What I want is to have a right interpretation of long run cointegrating relations and see how changes in one of them affect the others. I thought this could be done with short and long run restrictions to obtain a SVECM, but if the stochastinc trends can not be associated to any particular series I can not interpretate them neither. What do you think I could do?

Re: Short-and-long run restrictions with VECM

Posted: Sun Jun 10, 2012 1:08 pm
by TomDoan
If you have more than one stochastic trend, you can rotate the space to get trends behaving differently. It's just that the B-N type trend in any given series will be the same regardless of the SVAR that you apply.

Re: Short-and-long run restrictions with VECM

Posted: Thu Jun 21, 2012 2:30 pm
by wfirew
Dear Tom,
I am new to rats, can you clarify on a couple of questions I have? Thank you in advance.
1. This is regarding the long-run restrictions. Even if one wants the (two) transitory shocks to have no permanent effects, it suffices to restrict one row to zero (because of the reduced rank of the long run impact matrix). Is that a right statement to make? If so, does it matter which row I choose to put the zeros? Does this condition also holds if we have more than one common trends. For example, in the case two common trends (one cointegration relation), I have to put zeros on two rows for the transitory shock? Of course, in that case I would need one more long-run restriction and no short run restriction.
2. Is it possible to specify restricted trend in the cointegrating relations in johmle?
Cheers,

Re: Short-and-long run restrictions with VECM

Posted: Tue Jun 26, 2012 1:58 pm
by TomDoan
wfirew wrote:Dear Tom,
I am new to rats, can you clarify on a couple of questions I have? Thank you in advance.
1. This is regarding the long-run restrictions. Even if one wants the (two) transitory shocks to have no permanent effects, it suffices to restrict one row to zero (because of the reduced rank of the long run impact matrix). Is that a right statement to make? If so, does it matter which row I choose to put the zeros?
Yes. As the model above is set up, any zero in any row of a column causes that shock for that column to have a zero LR effect on all variables.
wfirew wrote: Does this condition also holds if we have more than one common trends. For example, in the case two common trends (one cointegration relation), I have to put zeros on two rows for the transitory shock? Of course, in that case I would need one more long-run restriction and no short run restriction.
You can't have two shocks which have zero long-run effects on all variables in a model like that. A pair of zeros in a column will make that shock transitory on all three variables. Your final identifying assumption will need to be either one zero impact restriction or one zero long run restriction on one of the other two shocks.
wfirew wrote: 2. Is it possible to specify restricted trend in the cointegrating relations in johmle?
It's not in the comments, but DET=RTREND will do the restricted trend.

Re: Short-and-long run restrictions with VECM

Posted: Tue Dec 05, 2017 8:39 am
by jonasdovern
Dear Tom,

I estimated a VECM and imposed the following restrictions:

Code: Select all

input lr
 . 0 0
 . . 0
 . . .
input sr
 . . .
 . . .
 . . .
Since the second and the third variable are cointegrated, the implied impact and long-run responses are given by

Code: Select all

Impact Responses
  0.503  -0.468   0.135
  0.498   0.646   0.427
 -0.137  -0.194   0.671

Long run Responses
  0.856  -0.000   0.000
  1.614   2.125   0.000
  1.614   2.125   0.000
So far so good. However, if I compute and plot the IRFs using @varirf the long-run response of the first variable to the second shock (see attachement) is not 0 (it is also not after 10000 periods). How is that possible? The code used to generate this is:

Code: Select all

@ShortAndLong(lr=lr,sr=sr,masum=masums,iterations=10000) %sigma f
disp ###.### "Impact Responses" f
disp ###.### "Long run Responses" masums*f

*** Plot impulse response functions
@varirf(factor=f,steps=100,model=vecm)

Re: Short-and-long run restrictions with VECM

Posted: Wed Dec 06, 2017 2:42 pm
by TomDoan
Are you sure you have the right MASUMS for the model? The @ShortAndLong procedure will solve out for the pattern that you ask regardless of what goes in for MASUMS, but the impulse responses will only match that if the MASUMS is computed correctly for the model.

Re: Short-and-long run restrictions with VECM

Posted: Fri Dec 08, 2017 6:43 am
by jonasdovern
I followed the example at the beginning of this thread which computes masums as described, for instance, also in Chapter 10 of the new book by Kilian and Lütkepohl.

But probably I overlooked something. Is there an issue with restrictions on the cointegration vector?

I am attaching my data set and the complete code.

Code: Select all

cal(q) 1950:1
all 2017:4

open data FRED_data.xlsx
data(format=xlsx,org=col) /
close data
table

set infl = (def(t)-def(t-1))*400

*** Define the cointegrating relation for input into ECT
comp beta=||0,1.,-1.||
dec vect[equation] ecteqns(1)
equation(coeffs=beta) ecteqns(1)
# gdp infl ffr


*** Define and estimate the reduced-form VECM
system(model=vecm)
   variables gdp infl ffr
   det constant
   lags 1 8
   ect ecteqns
end(system)
*
estimate 60:1 2017:2

*** Compute the long-run response matrix for the VECM. This corresponds to equation (10.2.3) in Kilian and Lütkepohl (2017)!
comp masums=%perp(beta) * inv(tr(%perp(%vecmalpha))*%varlagsums*%perp(beta)) * tr(%perp(%vecmalpha))

*** Specify restrictions
dec rect lr(3,3) sr(3,3)
input lr
 . 0 0
 . . 0
 . . .
input sr
 . . .
 . . .
 . . .

*** Compute impact matrix and long-run responses
@ShortAndLong(lr=lr,sr=sr,masum=masums,iterations=10000) %sigma f
disp ###.### "Impact Responses" f
disp ###.### "Long run Responses" masums*f

*** Plot impulse response functions
@varirf(factor=f,steps=100,model=vecm)