plot_decomposition_comparison
plot_decomposition_comparison
Plot a decomposition comparison plot.
plot_decomposition_comparison
plot_decomposition_comparison(
idx_outcome::Int,
irfs::AbstractArray{<:Number,3},
channel_names::AbstractVector{<:String},
decomposition_names::AbstractVector{<:String},
teffects::Vector{<:AbstractArray{<:Number,3}}...;
title::String="",
legend::Bool=true,
colors=wong_colors()
) -> TCAPlot
Creates a decomposition comparison plot of the total effects (irfs
) and the transmission effects (teffects
), of various transmission matrices, 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}
:
Arguments
idx_outcome::Int
: Index of the outcome variable.irfs::AbstractArray{<:Number,3}
: Total effects, with shape[N, 1, H]
whereN
is the number of endogenous variables, andH
is the number of horizons (including zero).channel_names::AbstractVector{<:String}
: Names of the transmissiondecomposition_names::AbstractVector{<:String}
: Names of the decompositionsteffects::Vector{<:AbstractArray{<:Number,3}}...
: Transmission effects for each transmission channel and each transmission matrix; Each transmission effect must have the same shape asirfs
.
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.