*! version 1.0.0 20may2026 Dr Merwan Roudane (merwanroudane920@gmail.com)

Title

mixi01_irf -- Impulse responses and variance decompositions

Syntax

mixi01_irf
[,
options]

Horizon
step(#) forecast horizon; default: step(40)

Selection
shock(numlist) which shock(s) to plot (equation indices)

response(numlist) which response variable(s) to plot

Confidence intervals
ci compute bootstrap confidence intervals

nreps(#) number of bootstrap replications; default: nreps(500)

level(real 95) CI level

Display
fevd plot FEVD instead of IRF

permanent overlay permanent component

combine combine all subplots into one graph

nograph suppress graphical output

Graph appearance
scheme(string) graph scheme; default: s2color

save(string) save graph to file

title(string) overall graph title

Description

mixi01_irf is a post-estimation command that computes and plots impulse
response functions (IRFs) and forecast error variance decompositions (FEVDs)
using results stored by mixi01_svar or mixi01_fmvar.

IRF computation. IRFs are computed via the companion-matrix recursion:

Phi_h = J * C^h * J' * P

where C is the (np × np) companion matrix of the VAR, J = [I_n, 0] selects the
first n rows, and P is the structural impact matrix (A_0^{−1} if structural
identification is available, or the Cholesky factor of Sigma otherwise).

FEVD computation. The contribution of shock s to the h-step-ahead
forecast error variance of variable r is:

FEVD_(h) = sum_^ Phi_l(r,s)^2 / sum_^ sum_^ Phi_l(r,j)^2

Bootstrap CIs. When ci is specified, bootstrap confidence intervals
are computed using a residual resampling procedure. For each of nreps()
replications, residuals are redrawn (with replacement), the data are
reconstructed, the FM-VAR/SVAR is re-estimated, and IRFs are recomputed.
Percentile bands are then reported at the specified confidence level.

Options

Horizon

step(#) sets the forecast horizon for the IRF/FEVD.

Selection

shock(numlist) specifies which shocks to plot by equation index.
Default: all shocks.

response(numlist) specifies which response variables to plot.
Default: all variables.

Confidence intervals

ci activates bootstrap confidence intervals.

nreps(#) sets the number of bootstrap replications.

level(#) sets the CI level.

Display

fevd plots FEVDs instead of IRFs. The FEVD is displayed as stacked
area charts, with different colours for each shock type (P1, T1, P0, T0).

permanent overlays the permanent component Delta y^P_t on the IRF
plot. Requires prior estimation via mixi01_svar with the permanent
component stored.

combine places all response–shock subplots into a single combined
graph arranged in a grid.

nograph suppresses graphical output; only the IRF/FEVD data are
computed and stored.

Graph appearance

scheme(string) specifies the graph scheme.

save(string) saves the combined graph to the specified file.
Supported formats: .png, .pdf, .eps, .wmf.

title(string) sets the main title for the combined graph.

Remarks

IRF plot design. Each subplot shows:

• A navy line for the point estimate of the impulse response.

• A gray shaded area (rarea) for the bootstrap confidence band.

• A dashed horizontal line at zero.

• A subtitle indicating the shock type (P1, T1, P0, T0) from the Fisher–Huh–Pagan classification.

FEVD plot design. Each subplot is a stacked area chart showing the
decomposition of forecast error variance across shocks over the horizon.
Colours distinguish the four shock types:

P1 shocks: navy

T1 shocks: maroon

P0 shocks: forest green

T0 shocks: dark orange

Data access. After running mixi01_irf, the IRF/FEVD data are
available in the current (preserved) dataset. Variables are named
irf_r__s, irf_lo_r__s, and
irf_hi_r__s for response r to shock s.
Use restore to return to the original dataset.

Examples

Example 1: Basic IRFs with bootstrap CIs

. mixi01_svar y1 y2 y3 y4, lags(2) i1(y1 y2 y3) i0(y4) p1(1) t1(2 3) p0(4) cholesky

. mixi01_irf, step(40) ci nreps(500) combine

Example 2: FEVD plot

. mixi01_irf, step(40) fevd combine save("fevd_plot.png")

Example 3: Selected shocks and responses

. mixi01_irf, step(24) shock(1 4) response(1 2) ci nreps(200) combine

Example 4: IRF without graph (data only)

. mixi01_irf, step(60) nograph

. list horizon irf_1_1 irf_2_1 in 1/10

Stored results

mixi01_irf stores the following in e():

Scalars

e(irf_step) forecast horizon

e(irf_nreps) number of bootstrap replications

e(irf_level) CI level

Macros

e(irf_cmd) mixi01_irf

IRF/FEVD data are stored in the current dataset as variables:

horizon time horizon (0, 1, ..., step)

irf_r_s IRF of response r to shock s

irf_lo_r_s lower CI bound

irf_hi_r_s upper CI bound

fevd_r_s FEVD contribution of shock s to variable r

References

Fisher, L. A., H.-S. Huh and A. R. Pagan (2016). Econometric methods for
modelling systems with a mixture of I(1) and I(0) variables.
Journal of Applied Econometrics, 31(5), 892–911.

Lütkepohl, H. (2006). New Introduction to Multiple Time Series
Analysis. Berlin: Springer.

Phillips, P. C. B. (1995). Fully modified least squares and vector
autoregression. Econometrica, 63(5), 1023–1078.

Author

Dr Merwan Roudane

Department of Economics (Independent Researcher)

merwanroudane920@gmail.com

Also see

Master help — mixi01.

Sibling commands — mixi01_fmols, mixi01_fmvar,
mixi01_fmiv, mixi01_acl, mixi01_svar,
mixi01_vecm, mixi01_irf, mixi01_test.