You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Plot Type section explaining :stack and :compare usage
Added comprehensive section explaining the plot_type argument with practical examples:
- :stack for layered shock scenarios showing cumulative effects
- :compare for parameter comparisons showing separate lines
- Clear use cases for when to use each option
- Code examples demonstrating both visualization types
Positioned between Plot Labels and Plot Attributes sections for logical flow.
Co-authored-by: thorek1 <[email protected]>
The `plot_type` argument (default: `:compare`, type: `Symbol`) determines how IRFs are visualized when multiple scenarios are displayed. Two options are available:
945
+
946
+
-`:compare` - Displays IRFs as separate lines for comparison across scenarios
947
+
-`:stack` - Stacks IRFs on top of each other to show cumulative effects
948
+
949
+
The `:stack` option is particularly useful when analyzing scenarios composed of multiple shock series, as it shows how different shocks contribute to the overall response. The `:compare` option is better suited for comparing IRFs across different parameter values or model specifications.
950
+
951
+
#### Using `:stack` for Layered Shock Scenarios
952
+
953
+
When analyzing a scenario composed of multiple shocks, `:stack` visualizes the cumulative impact. For example, plot the combined effect of `eps_a` and `nu` shocks:
954
+
955
+
```julia
956
+
# First shock in the scenario
957
+
plot_irf(Gali_2015_chapter_3_nonlinear,
958
+
shocks =:eps_a)
959
+
960
+
# Add second shock to show cumulative effect
961
+
plot_irf!(Gali_2015_chapter_3_nonlinear,
962
+
shocks =:nu,
963
+
plot_type =:stack)
964
+
```
965
+
966
+
The `:stack` visualization shows how each shock contributes to the total response, with the second shock's effect layered on top of the first.
967
+
968
+
#### Using `:compare` for Parameter Comparisons
969
+
970
+
When comparing IRFs across different parameter values, `:compare` displays the responses as separate lines:
971
+
972
+
```julia
973
+
# Baseline parameterization
974
+
plot_irf(Gali_2015_chapter_3_nonlinear,
975
+
parameters = (:β=>0.99,),
976
+
shocks =:eps_a,
977
+
label ="β = 0.99")
978
+
979
+
# Alternative parameterization for comparison
980
+
plot_irf!(Gali_2015_chapter_3_nonlinear,
981
+
parameters = (:β=>0.95,),
982
+
shocks =:eps_a,
983
+
label ="β = 0.95",
984
+
plot_type =:compare)
985
+
```
986
+
987
+
The `:compare` option (the default) makes it easy to see how parameter changes affect the IRF magnitude and persistence.
988
+
942
989
### Plot Attributes
943
990
944
991
The `plot_attributes` argument (default: `Dict()`, type: `Dict`) accepts a dictionary of attributes passed on to the plotting function. See the Plots.jl documentation for details.
0 commit comments