*! version 16.0 18march2021

[VAR-NR] shock_set() -- Set sign restriction on given structural shock

Syntax

transmorphic scalar
shock_set(real scalar start, real scalar end, string scalar sign, string scalar shock, string scalar affected, transmorphic scalar S)

Description

shock_set(start,end,sign,shock,affected,S)
imposes a sign restriction on the impulse response to a given structural shock.
start and end set the horizons on the impulse response that the sign
restriction is enforced. If these are equal, the restriction is imposed on a
single horizon. sign indicates whether the sign is restricted to be
positive or negative; this argument accepts "positive", "pos", "+", "negative",
"neg", or "-". shock should be loaded with the name of the shock that is
being restricted as it is entered in shock_name() (if the shock
is not named, the corresponding variable name should be entered instead).
affected should be filled with the name (as a string) of the endogenous
variable whose impulse response to the specified shock is to be restricted.
S is the sign restriction object output by
shock_create() that is to be updated. The function has no
output, but updates S.

Remarks

shock_set() can be called in Stata using function
var_nr_shock_set.

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