plot_decomposition

Plot a decomposition plot.

plot_decomposition(
    idx_outcome::Int,
    irfs::AbstractArray{<:Number,3},
    teffects::Vector{<:AbstractArray{<:Number,3}},
    channel_names::AbstractVector{<:String};
    title::String="",
    legend::Bool=false,
    colors=wong_colors()
) -> TCAPlot

Creates a decomposition plot of the total effects (irfs) and the transmission effects (teffects) for a given outcome variable (idx_outcome).

The function returns a TCAPlot object, which displays the figure immediately in interactive environments (unless suppressed with a semicolon). You can also extract the separate Figure and A```{julia}:

fig, = plot_decomposition(...)
fig, ax = plot_decomposition(...)

Arguments

  • idx_outcome::Int: Index of the outcome variable.
  • irfs::AbstractArray{<:Number,3}: Total effects, with shape [N, 1, H] where N is the number of endogenous variables, and H is the number of horizons (including zero).
  • teffects::Vector{<:AbstractArray{<:Number,3}}: Transmission effects for each transmission channel, same shape as irfs.
  • channel_names::AbstractVector{<:String}: Names of the transmission channels.

Keyword Arguments

  • title::String: Optional figure title.
  • legend::Bool: Whether to plot a legend.
  • colors: Colors for the decomposition bars (default: Wong colors).

Returns

  • A TCAPlot that includes the figure and axis for further styling.