plot.PosteriorIR: Plots impulse responses

View source: R/plot.R

plot.PosteriorIRR Documentation

Plots impulse responses

Description

Plots of of all variables to all shocks including their median and percentiles.

Usage

## S3 method for class 'PosteriorIR'
plot(
  x,
  probability = 0.9,
  shock_names,
  col = "#ff69b4",
  main,
  xlab,
  mar.multi = c(1, 4.1, 0, 1.1),
  oma.multi = c(6, 0, 5, 0),
  ...
)

Arguments

x

an object of class PosteriorIR obtained using the compute_impulse_responses() function containing posterior draws of impulse responses.

probability

a parameter determining the interval to be plotted. The interval stretches from the 0.5 * (1 - probability) to 1 - 0.5 * (1 - probability) percentile of the posterior distribution.

shock_names

a vector of length N containing names of the structural shocks.

col

a colour of the plot line and the ribbon

main

an alternative main title for the plot

xlab

an alternative x-axis label for the plot

mar.multi

the default mar argument setting in graphics::par. Modify with care!

oma.multi

the default oma argument setting in graphics::par. Modify with care!

...

additional arguments affecting the summary produced.

Author(s)

Tomasz Woźniak wozniak.tom@pm.me

See Also

compute_impulse_responses

Examples

specification  = specify_bsvar$new(us_fiscal_lsuw)   # specify model
burn_in        = estimate(specification, 5)          # run the burn-in
posterior      = estimate(burn_in, 5)                # estimate the model

# compute impulse responses``
fitted         = compute_impulse_responses(posterior, horizon = 4)
plot(fitted)                                          # plot

# workflow with the pipe |>
############################################################
us_fiscal_lsuw |>
  specify_bsvar$new() |>
  estimate(S = 5) |> 
  estimate(S = 5) |> 
  compute_impulse_responses(horizon = 4) |>
  plot()


bsvars documentation built on Aug. 22, 2026, 5:09 p.m.