Page 2 of 2

Re: Short-and-long run restrictions with VECM

Posted: Fri Dec 08, 2017 8:34 am
by TomDoan
The 9.20d build of RATS computes the %VARLAGSUMS as it's needed to do that calculation.

Re: Short-and-long run restrictions with VECM

Posted: Sun Dec 10, 2017 1:37 pm
by jonasdovern
I am using RATS 8.3.

Isn't it in that version that %varlagsums is computed in such a way that

Code: Select all

comp masums=%perp(beta) * inv(tr(%perp(%vecmalpha))*%varlagsums*%perp(beta)) * tr(%perp(%vecmalpha))
provides the relevant matrix for a VECM?

Re: Short-and-long run restrictions with VECM

Posted: Tue Feb 27, 2018 3:12 pm
by jonasdovern
I would like to follow up on this question in the context of simulating error bands for IRFs for VECMs.

RATS tells me that I cannot use %MODELLAGSUMS(model) to obtain the lag sums (of the lagged differences) of a VECM. But I can also not simply use %varlagsums inside an MC loop (like for instance in MCVARDODRAWS.SRC) because that would not reflect the varying parameter choices but would always reflect the OLS estimates.

Is there an easy way to do

Code: Select all

comp masums=%perp(beta) * inv(tr(%perp(%vecmalpha))*%varlagsums*%perp(beta)) * tr(%perp(%vecmalpha))
during each iteration of an MC simulation in such a way that it takes the simulated parameter estimates into account?

Or do I have to rely on bootstrapping (like in BOOTVECM.rpf) instead of MC simulation anyway in the case of a VECM?

Re: Short-and-long run restrictions with VECM

Posted: Thu Mar 01, 2018 2:23 am
by jonasdovern
Due to my lack of knowledge about any special RATS functions, I wrote the following function that can be used to compute the relevant input for @shortandlong for a VECM if one needs to use this inside an MC loop.

Code: Select all

function %vecmlagsums model nlags nects beta
   type rec %vecmlagsums
   type model model
   type int nlags nects
   type rec beta
   *
   local vec[rec] phi
   local rec alpha
   local int ll nvars ncoeffs
   *
   dim phi(nlags)
   comp nvars=%rows(%modeldepvars(model))
   comp ncoeffs = %rows(%modelgetcoeffs(model))

   comp %vecmlagsums = %identity(nvars)
   do ll=1,nlags
      dim phi(ll)(nvars,nvars)
      ewise phi(ll)(i,j) = %modelgetcoeffs(model)((j-1)*nvars+ll,i)
      comp %vecmlagsums = %vecmlagsums-phi(ll)
   end do ll

   comp alpha = tr(%xsubmat(%modelgetcoeffs(model),ncoeffs-nects+1,ncoeffs,1,3))   
   comp %vecmlagsums = %perp(beta)*inv(tr(%perp(alpha))*%vecmlagsums*%perp(beta))*tr(%perp(alpha))
end function
It takes a plain vanilla VECM model, the number of lags (of the differenced variables), the number of CI vectors, and the vectors (which are assumed to be known) as inputs.

It returns a rectangular that can immediatly be used with @shortandlong as follows (I use it in a modified version of MCVARDODRAWS.SRC):

Code: Select all

@ShortAndLong(lr=lr,sr=sr,masum=%vecmlagsums(model,3,2,beta),factor=factor) sigmad; * This is model-specific  

Re: Short-and-long run restrictions with VECM

Posted: Thu Mar 08, 2018 2:48 am
by jonasdovern
How can I implement this if I have a VECM for which the constant is included in the cointegrating vector (determ=rc)?

Can I simply ignore the "deterministic part" of the CI vector when computing the sum of moving average coefficients like above (and as defined by equation (3.1.7) in the new book by Kilian and Lütkepohl)?

Re: Short-and-long run restrictions with VECM

Posted: Thu Mar 08, 2018 10:23 am
by TomDoan
Correct. The moving average representation has a deterministic term which depends upon the deterministic components and a stochastic component, which doesn't. The LR impact matrix is part of the latter.

Re: Short-and-long run restrictions with VECM

Posted: Wed Mar 28, 2018 11:12 pm
by TomDoan
jonasdovern wrote: RATS tells me that I cannot use %MODELLAGSUMS(model) to obtain the lag sums (of the lagged differences) of a VECM. But I can also not simply use %varlagsums inside an MC loop (like for instance in MCVARDODRAWS.SRC) because that would not reflect the varying parameter choices but would always reflect the OLS estimates.
The %MODELLAGSUMS (and %MODELLAGMATRIX) functions will now handle VECM's in version 9.20e.