*! version 16.0 18march2021

[VAR-NR] sr_analysis_funct() -- calculate IRFs, FEVDs, and HDs for [narrative] sign-identified SVARs

Syntax

transmorphic scalar function
sr_analysis_funct(string scalar output, transmorphic scalar sro, struct opt_struct scalar opts)

Description

sr_analysis_funct() calculates impulse response functions, forecast error
variance decompositions, and historical decompositions for [narrative]
sign-identified SVARs. output can be set as "irf", "fevd" or "hd" to
generate the IRFs, FEVDs, or HDs, respectively, of every VAR in the credible set
stored in the object sro output by sign_restrict() or
narr_sign_restrict().

The output of the function is an associative array indexed by string keys. "all"
accesses an integer-indexed associative array containing the output of
irf_funct(), fevd_funct() or
hd_funct() for each VAR in the credible set. "median" accesses
the median IRF, FEVD, or HD from the set contained in "all" (for the HD, this
is the median of the decomposition of the forecast errors of the structural
shocks). Additionally, in the IRF and FEVD cases, "bands" accesses the IRFs and
FEVDs corresponding to the -percentiles as set by opts.

Options for identification and estimation executed by
sr_analysis_funct() 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. Options affecting
sr_analysis_funct calculation are outlined below:

Options

ident must be set equal to "sr" to run sr_analysis_funct(),
specifying [narrative] sign-restriction identification.

nsteps specifies the number of steps for which, or the maximum horizon
out to which, the IRF or FEVD is calculated (must be positive integer).

impact sets the size of the shock for the impulse. Options are 0 or 1. If
it is set to "0" then shock is one standard deviation. If it is set to
"1" the shock is 1.

shut specifies if there is a row of the inverse-A matrix to be set to 0.
Options are 0 or 1, where 1 specifies that a row be shut.

pctg specifies the size of the confidence bands around the IRF or FEVD
displayed when plotted. For example, if "90" is specified, then a 90%
confidence interval is plotted. In the case of [narrative] sign identification,
this would correspond to the IRF or FEVD draws corresponding to the fifth
percentile and the ninety-fith percentile.

Remarks

sr_analysis_funct() is called in Stata by
var_nr_irf, var_nr_fevd and
var_nr_hd when srname is specified.

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