SHORTANDLONG Procedure |
@ShortAndLong procedure takes a covariance matrix, a set of sums of (moving average) lag coefficients from a VAR or VECM, and pattern matrices for short run and long run restrictions and produces either a factor of the covariance matrix (if the model is exactly identified) or a re-parameterization if the model as input underidentifies the model. There is no simple way to estimate an overidentified model with short- and long-run restrictions because that would constrain the lag coefficients in a complicated way.
The basic model is \({\bf{u}} = {\bf{Fv}}\), where \({\bf{v}}\) are the structural shocks, restricted to be orthonormal, that is, \(E{\bf{vv'}} = I\). Thus \({\bf{FF'}} = \Sigma \) for a just-identified model.
A just-identified model needs to meet the Rubio-Ramirez-Waggoner-Zha(2010) counting rules—in the combined matrices, there must be exactly one column with 0 zeros, one with 1 zero, one with 2, out to one column with \(n - 1\). @ShortAndLong checks for this and aborts if the model fails the test.
If the matrix of moving average sums isn't full rank (because the model is cointegrated), it's possible that some long-run restrictions will be forced to be zero because others are. If that's the case, you can't count each of those as a separate restriction. In the simplest case, if you have a pair of series which are cointegrated, a long-run restriction to zero on one forces the same behavior on the other, so you can include a long-run restriction on only one (it doesn't matter which). If you include both (and only hit the counting rules because of that), @ShortAndLong will report that you have redundant restrictions and will abort.
@ShortAndLong( options ) sigma
Parameters
sigma |
(input) the covariance matrix of the VAR residuals |
Options (Inputs)
SR=NxN matrix with 0's in the slots in F restricted to be zero.
LR=NxN matrix with 0's in the slots in C(1)F restricted to be zero.
MASUMS=NxN matrix of the sum of the MAR coefficients of the VAR (C(1))
Note that the MASUMS option needs to change if the coefficients change. For a VAR that's just been estimated, you can use INV(%VARLAGSUMS), but if you draw a new set of coefficients (by Monte Carlo integration or bootstrapping), you need to recompute those using INV(%MODELLAGSUMS(the model with the new coefficients)).
Options (Outputs)
FACTOR=factor matrix (F)
RPERP=mapping from free parameters to vec(F)
Options (Estimation Controls)
[ESTIMATE]/NOESTIMATE
TRACE/[NOTRACE]
ITERATIONS=maximum number of iterations [100]
CVCRIT=convergence criterion [.000001].
This is checked against the difference between the outer product of the factor and the input covariance matrix.
INITIAL=initial guess for the factor matrix F.
By default, this takes a Cholesky factor of sigma and picks the closest fit to that.
Example
This is an example with a just-identified model which restricts shocks 2 and 3 to have no long-run effect on variable 1. 2 and 3 are identified (from each other) by the short-run restriction on shock 3 (no impact response for variable 2). This meets the RRWZ counting rules as there are 0 zeros in the 1st columns of the two matrices combined, 1 zero in the 2nd columns and 2 in the 3rd columns.
compute masums=inv(%varlagsums)
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=myvar,shocklabels=||"Permanent","Trans 1","Trans 2"||)
Copyright © 2025 Thomas A. Doan