Commit b76bfe65 authored by Marco Ratto's avatar Marco Ratto Committed by Stéphane Adjemian
Browse files

Bug fixes after changes in the options structures for shock decompositions.

(cherry picked from commit 5e7256da)

Fixed conflicts in matlab/graph_decomp_detail.m. Also fixed issues due to the transition from
char arrays to cell of row char arrays for the variable names.
parent 927b33cf
......@@ -34,16 +34,19 @@ mydata=get(findobj(gcf,'tag',['group' int2str(ic)]),'userdata');
if isfield(mydata,'shock_decomp')
options.shock_decomp=mydata.shock_decomp;
end
options.plot_shock_decomp=mydata.plot_shock_decomp;
options.first_obs=mydata.first_obs;
options.nobs=mydata.nobs;
% define expanded group
label = mydata.shock_group.label;
shocks = mydata.shock_group.shocks;
options.shock_decomp.fig_name = [mydata.fig_name '. Expand'];
options.use_shock_groups = strrep(label,' ','_'); %[use_shock_groups_old int2str(ic)];
options.plot_shock_decomp.fig_name = [mydata.fig_name '. Expand'];
options.plot_shock_decomp.use_shock_groups = strrep(label,' ','_'); %[use_shock_groups_old int2str(ic)];
for j=1:length(shocks)
M.shock_groups.(options.use_shock_groups).(['group' int2str(j)]).label=shocks{j};
M.shock_groups.(options.use_shock_groups).(['group' int2str(j)]).shocks=shocks(j);
M.shock_groups.(options.plot_shock_decomp.use_shock_groups).(['group' int2str(j)]).label=shocks{j};
M.shock_groups.(options.plot_shock_decomp.use_shock_groups).(['group' int2str(j)]).shocks=shocks(j);
end
options.shock_decomp.interactive=0;
options.shock_decomp.expand=1;
options.plot_shock_decomp.interactive=0;
options.plot_shock_decomp.expand=1;
plot_shock_decomposition(M,oo,options,var_list_);
......@@ -193,12 +193,15 @@ for j=1:nvar
mydata.fig_name = DynareOptions.plot_shock_decomp.fig_name(2:end);
mydata.use_shock_groups = DynareOptions.plot_shock_decomp.use_shock_groups;
mydata.shock_group = shock_groups.(shock_ind{i});
mydata.shock_decomp = DynareOptions.plot_shock_decomp;
if ~isempty(mydata.shock_group.shocks{1})
mydata.shock_decomp = DynareOptions.shock_decomp;
mydata.plot_shock_decomp = DynareOptions.plot_shock_decomp;
mydata.first_obs = DynareOptions.first_obs;
mydata.nobs = DynareOptions.nobs;
if ~isempty(mydata.shock_group.shocks)
c = uicontextmenu;
hl.UIContextMenu=c;
browse_menu = uimenu(c,'Label','Browse group');
expand_menu = uimenu(c,'Label','Expand group','Callback',['expand_group(''' mydata.use_shock_groups ''',''' deblank(mydata.shock_decomp.orig_varlist(j,:)) ''',' int2str(i) ')']);
expand_menu = uimenu(c,'Label','Expand group','Callback',['expand_group(''' mydata.plot_shock_decomp.use_shock_groups ''',''' deblank(mydata.plot_shock_decomp.orig_varlist(j,:)) ''',' int2str(i) ')']);
set(expand_menu,'UserData',mydata,'Tag',['group' int2str(i)]);
for jmember = mydata.shock_group.shocks
uimenu('parent',browse_menu,'Label',char(jmember))
......
......@@ -195,12 +195,15 @@ for j=1:nvar
mydata.fig_name = DynareOptions.plot_shock_decomp.fig_name(2:end);
mydata.use_shock_groups = DynareOptions.plot_shock_decomp.use_shock_groups;
mydata.shock_group = shock_groups.(shock_ind{ic});
mydata.shock_decomp = DynareOptions.plot_shock_decomp;
if ~isempty(mydata.shock_group.shocks{1})
mydata.shock_decomp = DynareOptions.shock_decomp;
mydata.plot_shock_decomp = DynareOptions.plot_shock_decomp;
mydata.first_obs = DynareOptions.first_obs;
mydata.nobs = DynareOptions.nobs;
if ~isempty(mydata.shock_group.shocks)
c = uicontextmenu;
hax.UIContextMenu=c;
browse_menu = uimenu(c,'Label','Browse group');
expand_menu = uimenu(c,'Label','Expand group','Callback',['expand_group(''' mydata.use_shock_groups ''',''' deblank(mydata.shock_decomp.orig_varlist(j,:)) ''',' int2str(ic) ')']);
expand_menu = uimenu(c,'Label','Expand group','Callback',['expand_group(''' mydata.plot_shock_decomp.use_shock_groups ''',''' deblank(mydata.plot_shock_decomp.orig_varlist(j,:)) ''',' int2str(ic) ')']);
set(expand_menu,'UserData',mydata,'Tag',['group' int2str(ic)]);
for jmember = mydata.shock_group.shocks
uimenu('parent',browse_menu,'Label',char(jmember))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment