Short-and-long run restrictions with VECM
Re: Short-and-long run restrictions with VECM
The 9.20d build of RATS computes the %VARLAGSUMS as it's needed to do that calculation.
-
jonasdovern
- Posts: 97
- Joined: Sat Apr 11, 2009 10:30 am
Re: Short-and-long run restrictions with VECM
I am using RATS 8.3.
Isn't it in that version that %varlagsums is computed in such a way thatprovides the relevant matrix for a VECM?
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))
-
jonasdovern
- Posts: 97
- Joined: Sat Apr 11, 2009 10:30 am
Re: Short-and-long run restrictions with VECM
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 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?
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))
Or do I have to rely on bootstrapping (like in BOOTVECM.rpf) instead of MC simulation anyway in the case of a VECM?
-
jonasdovern
- Posts: 97
- Joined: Sat Apr 11, 2009 10:30 am
Re: Short-and-long run restrictions with VECM
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.
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
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 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
-
jonasdovern
- Posts: 97
- Joined: Sat Apr 11, 2009 10:30 am
Re: Short-and-long run restrictions with VECM
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)?
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
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
The %MODELLAGSUMS (and %MODELLAGMATRIX) functions will now handle VECM's in version 9.20e.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.