plotIRF#

Purpose#

The plotIRF function is designed to plot the Impulse Response Functions (IRFs) from a structural Vector Autoregression (VAR) model. It visualizes the dynamic response of one variable to shocks in another variable over time. The function supports both unrestricted and restricted IRF matrices and includes confidence intervals based on bootstrapped results.

Format#

plotIRF(sOut[, rirf])#
Parameters:
  • sOut (struct) – An instance of the svarOut structure containing the results from the svarFit() estimation procedure.

  • rirf (scalar) – Optional, an indicator variable, set to 1 to specify that restricted irfs should be plotted.

Example#

// Load library
new;
library tsmt;

/*
** Data import
*/
lutkepohl2 = loadd(getGAUSShome("pkgs/tsmt/examples/lutkepohl2.dta"));

// Filter data
lutkepohl2 = selif(lutkepohl2, lutkepohl2[., "qtr"] .<= "1978-12-30");

// Set Y
y = packr(lutkepohl2[., "qtr" "dln_inv" "dln_inc" "dln_consump"]);

// Set up output structures
struct svarOut sout;

// Compute structural VAR model
sout = svarFit(Y);

// Plot the IRFs
plotIRF(sOut);

Remarks#

The plotIRF() function expects a filled instance of the svarOut structure. It must be called after running svarFit().

See also

Functions svarFit(), svarControlCreate(), plotFEVD()