Skip to content

utilities + plot shock decompositions + init condition decompositions

Marco Ratto requested to merge rattoma/dynare:master into master
  1. Commit acf2ecc9: adds utility files to get steady state st. error of shocks, smoother/updated variables and irfs by name of variables/shocks.
  2. Commit fd534cab traps case of an option in cell format in set_default_options.
  3. All other commits provide fixes and enhancements of plot shock/init decompositions.
  4. Required associated pre-processor extensions:
  • new plot_shock_decomposition option: max_nrows [default=6]. This allows users to set their preferred max number of rows in the subplot layout of detailed shock decomp graphs. Columns are always 3.
  • allow initial_condition_decomposition to get more options, with same default as for plot_shock_decompositions. nodisplay, graph_format, fig_name, max_nrows.
  • new command: squeeze_shock_decomp [optional list of vars]. For large models, the size of info stored by shock decompositions (especially various settings of realtime decomps) may become huge. This command allows to squeeze info according to 2 criteria: (1) automatic (default): plot_shock_decomp stores the variable for which decompositions have been plotted during the dynare instance. If use the command squeeze_shock_decomp at the end of the dynare file, this will store in oo_ only the decomposition info for plotted variables; (2) adding a list of variables after the command stores info only for variables listed.

Usage: squeeze_shock_decomp; or squeeze_shock_decomp var1 var2 ... ; Preprocessor output: with auto mode [oo_,options_] = squeeze_shock_decomp(M_,oo_,options_);; with list of variables [oo_,options_] = squeeze_shock_decomp(M_,oo_,options_,varlist); where varlist is a cell array, as usual in 4.6.

List of enhancements/bug fixes:

  • allow aoa plots to work with lists variables: current aoa handling needs to be further adjusted for epilogue variables;
  • bug fix for aoa variables requiring aux variables;
  • completed aoa realtime decomps for the case vintage=0;
  • parsimonious storage of shock decomp results in oo_;
  • improve legend info for initial condition shock decomp;
  • fixed interactive mode leading to crashes, especially for aoa plots.

Detail of new functions

  • get_mean: get steadystate of vars by name.

Usage: ss = get_mean('name1','name2', ... , 'order' ); or get_mean name1 name2 ... order.

Optionally, as last input argument, one can provide integer 1 (default) or 2. The latter would trigger the steady state at order 2.

  • get_shock_stderr_by_name: get shock std err by name

Usage: sd = get_shock_stderr_by_name('exoname1','exoname2') or get_shock_stderr_by_name exoname1 exoname2

  • get_smooth: get smoothed series of vars/shocks by name.

Usage: y= get_smooth('name1','name2','shock1','shock2'); or get_smooth name1 name2 shock1 shock2 etc.

  • get_updated: get updated series of vars by name.

Usage: y = get_update('name1','name2',etc.); or get_update name1 name2 etc.

  • get_irf: get irf of vars by name for an individual shock exoname. There must be 1 individual shock name and an arbitrary list of endo variables.

Usage: y = get_irf('exoname','name1','name2'); or get_irf exoname name1 name2

Edited by Marco Ratto

Merge request reports

Loading