SHORTANDLONG - Factors with short and long-run restrictions

Use this forum to post complete RATS "procedures". Please be sure to include instructions on using the procedure and detailed references where applicable.

SHORTANDLONG - Factors with short and long-run restrictions

Postby TomDoan » Wed Jun 29, 2011 1:37 pm

The @shortandlong procedure takes a covariance matrix, a set of sums of (moving average) lag coefficients from a VAR, 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.

The basic model is u = Fv, where v are the structural shocks, restricted to be orthonormal, that is, Evv'=I. FF' is thus equal to
sigma for a just identified model.

shortandlong.src
Procedure file
(5.15 KiB) Downloaded 193 times


@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))

Options (Outputs)
FACTOR=factor matrix (F)
RPERP=mapping from free parameters to vec(F)

Note that the MASUMS options needs to change if the coefficients change. For a VAR that's been just 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)).

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).

Code: Select all
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"||)


More complicated examples are: http://www.estima.com/forum/viewtopic.php?f=8&t=309 which uses the RPERP option to estimate an SVAR which has short and long-run restrictions, and includes both "A" and "B" form restrictions on the covariance matrix and http://www.estima.com/forum/viewtopic.php?f=8&t=1118 which is a just-identified model on a five variable system, and includes Monte Carlo integration.

Control options. Calculation of the factor matrix is an iterative process.

[ESTIMATE]/NOESTIMATE
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 Choleski factor of sigma and picks the closest fit to that.


Last bumped by TomDoan on Wed Jun 29, 2011 1:37 pm.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Return to RATS Procedures

Who is online

Users browsing this forum: No registered users and 2 guests