RATS 11
RATS 11

Procedures /

UHLIGFUNCSSD Functions

Home Page

← Previous Next →

This provides a pair of functions for implementing impulse responses identified using sign restrictions as described in Uhlig(2005) and later papers. You need to do a

 

source uhligfuncssd.src

 

instruction before you can use either of these.

 

SignDescription type

Both funcitions use a SignDescription type to describe an element out of a sign restriction (the SD at the end of the file name and the function names is short for SignDescription). This is a VECTOR of VECTORs of INTEGERS, each of which has three elements:

1.the target variable, based upon its position in the list of dependent variables. This is +slot if the response is constrained to be positive (actually non-negative) and -slot is it is constrained to be negative (non-positive).

2.the lowest horizon constrained with 1=impact

3.the highest horizon constrained

 

For instance:

 

dec SignDescription myirf(2)

compute myirf(1)=||-4,1,5||

compute myirf(2)=||+2,1,3||

 

combines a constraint that the response of variable 4 in the model is negative (hence the -4) for horizons 1 to 5 with the response of variable 2 being positive for horizons 1 to 3.

 

Impulse Vectors

Both procedures are based upon the result that the space of what Uhlig calls impulse vectors (a column out of any orthogonal factorization of a covariance matrix \(\Sigma\)). This is the set of all vectors that take the form \({\bf{Qx}}\) where \(\bf{Q}\) is a factor of \(\Sigma\) (any factor can be used) and \(\left\| {\bf{x}} \right\| = 1\). The two different approaches to finding sign-restricted impulse responses are

1.rejection method, where impulse vectors are randomly chosen and rejected if they fail to meet the constraints

2.penalty function method, where an impulse vector is chosen to minimize a penalty for failing to make the desired constraints

 

Rejection Method

UhligAcceptSD(impulses,x,constraints)

Parameters

impulses

RECT[SERIES] of impulse responses to some (any) orthogonalized set of shocks. This would be generated using the RESULTS option on IMPULSE.

x

Test unit vector

constraints

The SignDescription array describing this shock

 

It returns 1 if the impulse responses generated by applying the weights x to the orthogonalized IRF in impulses satisfies all the constraints and 0 otherwise. The impulse vector (initial shock) implied by this will be \({\bf{Qx}}\) where \(\bf{Q}\) is the factor used in computing impulses.

 

Penalty Function Method

UhligPenaltySD(impulses,x,constraints,scales)

This returns a penalty function summed across the constraints, where a response which has the correct sign has a negative value and a response which has the wrong sign has a positive value 100 times as large, that is, define

\begin{equation} f(z) = \left\{ {\begin{array}{*{20}c} z & {{\rm{if}}\,z < 0} \\ {100z} & {{\rm{if}}\,z > 0} \\ \end{array}} \right. \end{equation}

Note that this isn't differentiable at 0, so the method used for estimation can't assume differentiability. Because the different dependent variables may have very different scales, the scales parameter provides scaling factors for each.

 

For constraint \(i\), let \(I(i)\) be the sign of the constraint (+1 or -1), \(h(i)\) be the horizon constrained and \(j(i)\) be the dependent variable. \(s_j\) is the scaling value for dependent variable \(j\). \(\Psi [x]_{h}\) is the IRF for impulse vector \(x\) at horizon \(h\). Then the objective function is:

\begin{equation} \sum\limits_i {f\left( {I\left( i \right)\frac{{\Psi [x]_{h(i)} \left( {j(i)} \right)}}{{s_{j(i)} }}} \right)} \end{equation}

The goal is to minimize that across impulse vectors—the process handling the minimization calls this function.

Parameters

impulses

RECT[SERIES] of impulse responses to some (any) orthogonalized set of shocks. This would be generated using the RESULTS option on IMPULSE.

x

Test unit vector

constraints

The SignDescription array describing this shock

scales

VECTOR of scale factors for the penalty function

 


Copyright © 2025 Thomas A. Doan