*! version 16.0 18march2021

[VAR-NR] opt_set -- Initialize options structure loaded with defaults for var_nr Toolbox SVAR identification and analysis

Syntax

transmorphic scalar
opt_set()

Description

opt_set() initializes the opt_struct structure (part of var_nr
Toolbox) and loads it with default values. These can be individually manually
changed using the standard structure.element syntax. (In Stata, they can
be changed using var_nr_options).

The following elements are included in the structure, with default values
listed below:

Options

ident specifies the method used to identify the model.
This option will accept one of three strings: "oir", "bq", or
"sr". "oir" specifies zero short-run restrictions; "bq"
specifies zero long-run restrictions; and "sr" specifies sign
restrictions (pure and/or narrative).

nsteps specifies the number of steps for which, or the maximum horizon
out to which, impulse responses are 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 to be plotted. For example,
if 95 is specified, then a 95% confidence interval is plotted for IRFs and
FEVDs.

method specifies the method for calculating the uncertainty. If "bs"
is specified, then the error is calculated using the residuals to
calculate bootstraps. If "wild" is specified, then the error is calculated
using a wild bootstrap based on a simple distribution using Rademacher weights.

savefmt (stored in Mata as save_fmt) specifies what format plots should
be saved to the current working directory in, if any. The default setting is "none",
which indicates that plots should not be auto-saved when plotted. This setting
can be changed to any file format that Stata graphs can be saved in, such as "png"
or "gph".

shckplt (stored in Mata as shck_plt) indicates which variable or
structural shock the IRF, FEVD, or HD should be plotted for. The default setting
is "all", which indicates that plots should be generated for all variables or
shocks. For example, if the user runs a VAR on variables inflation and
unemployment, identifies the VAR with sign restrictions, and names the shocks
"Supply" and "Demand", they could specify shckplt as "unemployment" before
running var_nr_fevd_plot to plot only the forecast error
variance decomposition for unemployment, and specify shckplt as
"inflation" or "Supply" before running var_nr_irf_plot to
plot only the impulse responses to the supply shock.

ndraws specifies the number of draws satisfying the [narrative] sign
restrictions that var_nr_sign_restrict should generate
and store before stopping (must be positive integer).

errlmt (stored in Mata as err_lmt) specifies the number of consecutive
draws that do not satisfy the [narrative] sign restrictions before a successful
draw that will trigger var_nr_sign_restrict to abort
(must be positive integer). For example, if errlmt is set to 1,000, then
if var_nr_sign_restrict generates 1,000 unsuccessful
draws and no successful draw has been drawn at that point, the function will
abort and display an error.

updtfrqcy (stored in Mata as updt_frqcy) specifies how frequently
var_nr_sign_restrict should update the user on its
progress (must be positive integer). For example, if is set to
500, then the function will display after every additonal 500 draws (successful
or unsuccessful) the total number of attempted draws, the total number of draws
that have satisfied the sign restrictions, and, if applicable, the total number
of draws that have satisfied both the sign and the narrative sign restrictions.

updt specifies whether var_nr_sign_restrict
should update the user on its progress. Options are "yes" or "no". If set to
"yes", then the function will display the total number of attempted draws, the
total number of draws that have satisfied the sign restrictions, and, if
applicable, the total number of draws that have satisfied both the sign and the
narrative sign restrictions at the frequency specified by updtfrqcy.

Default settings

ident "sr"

nsteps 40

impact 0

shut 0

pctg 95

method "bs"

save_fmt "none"

shck_plt "all"

ndraws 100

err_lmt 4000

updt_frqcy 10000

updt "no"

Remarks

When var_nr is run in Stata, opt_set() is run in Mata. The
opt_struct structure is stored under the name specified in the
optname argument. For this reason, while the help file is included for
reference, the user should never need to run opt_set() themself.

For an overview of Mata functions in the toolbox, see

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