*! version 16.0 18march2021

[VAR-NR]var_nr_sign_restrict -- Routine to generate [narrative] sign-identified credible set for SVAR

Syntax

var_nr_sign_restrict
,

varname("string")
srname("string")
optname("string")
outname("string")
[nsrname("string")]

Description

var_nr_sign_restrict generates a credible set of SVARs identified by sign
and/or narrative sign restrictions. srname should be specified with the
name of the object created by var_nr_shock_create
storing sign restrictions set using var_nr_shock_set. If
narrative restrictions on the historical decomposition are to be imposed, then
nsrname must be specified with the name of the object created by
var_nr_narr_create storing the narrative restrictions
set using var_nr_narr_set. The output of this function
is a bundle of credible sets (stored in Mata) named with outname. This
output can then be fed into var_nr_irf,
var_nr_fevd or var_nr_hd.

The sign restrictions algorithm first draws an OLS reduced-form matrix of
coefficients and variance-covariance matrix from the previously estimated VAR
input. Additionally, a random orthonormal matrix Q is drawn. The impact
matrix of effects on the structural shocks is then calculated as the product of
the drawn covariance matrix and Q. The IRF of the VAR with these drawn
elements is calculated and sign restrictions are imposed. If sign restrictions
are satisfied, the draw is retained; otherwise, the draw is discarded, and the
algorithm begins anew. This process repeats until the target number of credible
draws is obtained or too many failures occur prior to a successful draw; both
thresholds are set in the opts structure prior to running
var_nr_sign_restrict.

Options for sign restriction identification and functioning are set to defaults
when var_nr is run. They are adjusted using
var_nr_options in Stata or using standard
structure.element structure syntax in Mata. Relevant options are outlined
below. Note that options affecting impulse response calculations are naturally
relevant as well, and are outlined in the help file for
var_nr_irf.

Options

ndraws specifies the target number of successful draws. When
var_nr_sign_restrict has generated the target number of draws that satisfy
the given sign restrictions, the functions stops. This value should be a
positive integer.

err_lmt specifies the maximum number of failed draws before the first
successful draw that the var_nr_sign_restrict algorithm should tolerate. If this
threshold is met, the function aborts with an error message. This value should
be a positive integer.

updt indicates whether the var_nr_sign_restrict function should
periodically update the user on its progress. Options are "yes" or "no". If
"yes", the function will display the number of successful draws and the number
of total draws so far at the interval set by the updt_frqcy option.

updt_frqcy specifies how often the var_nr_sign_restrict function updates the
user on its progress if updt is set to "yes". After every updt_frqcy
draws, function prints the number of successful draws and the number of total
draws so far. This value should be a positive integer.

Remarks

var_nr_sign_restrict runs the Mata function
sign_restrict().

For an overview of functions in the toolbox, see

[VAR-NR] var_nr Toolbox -- Stata functions and Mata functions.

Sources

Code for this function is adapted from Ambrogio Cesa-Bianchi's VAR Toolbox.
Code follows Kilian and Lutkepohl's notation in
Structural Vector Autoregressive Analysis (2016).