From e4c50fc510341b8afc705d2f7b33442d58db7cfb Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Thu, 2 May 2019 14:33:45 +0200 Subject: [PATCH] add qoq/yoy/aoa to shock decomposition --- src/gui_realtime_shock_decomposition.m | 21 +++++++++++++++++++++ src/gui_shock_decomposition.m | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/src/gui_realtime_shock_decomposition.m b/src/gui_realtime_shock_decomposition.m index 413a313..d7cd78d 100644 --- a/src/gui_realtime_shock_decomposition.m +++ b/src/gui_realtime_shock_decomposition.m @@ -250,6 +250,25 @@ handles.pushbuttonClose = uicontrol( ... 'Units', 'normalized', ... 'Position', [spc+dwidth*1.6 top-num*dheight dwidth dheight/1.5], ... 'FontWeight', 'normal'); + + num = num + 1; + uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Tag', 'text8', ... + 'Style', 'text', ... + 'Units', 'normalized', ... + 'Position', [spc*3 top-num*dheight dwidth*1.5 dheight/2], ... + 'String', 'type:', ... + 'HorizontalAlignment', 'left'); + + handles.type = uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Tag', 'type', ... + 'Style', 'popupmenu', ... + 'Units', 'normalized', ... + 'Position', [spc*3+dwidth*1.5 top-num*dheight dwidth*2 dheight/2], ... + 'String', {'qoq','yoy','aoa'}, ... + 'Value', 1); end function pushbuttonShockDecomposition_Callback(hObject, ~) @@ -280,6 +299,7 @@ handles.pushbuttonClose = uicontrol( ... options_.presample = str2double(handles.PresamplePeriod.String); options_.nodisplay = 0; options_.plot_priors = 0; + options_.type = handles.type.String; gui_tools.project_log_entry('Running shock decomposition','...'); [jObj, guiObj] = gui_tools.create_animated_screen('Running shock decomposition, please wait...', tabId); var_list_ = handles.endoTable.Data([handles.endoTable.Data{:,1}], 2); @@ -373,6 +393,7 @@ handles.pushbuttonClose = uicontrol( ... handles.lastPeriodQuarter.Value = handles.lastPeriodQuarterDefault; handles.lastPeriodYear.Value = handles.lastPeriodYearDefault; handles.useShockGrouping.Value = 0; + handles.type.Value = 1; end function close_tab(~, ~, hTab) diff --git a/src/gui_shock_decomposition.m b/src/gui_shock_decomposition.m index 3ac323c..a75c7e9 100644 --- a/src/gui_shock_decomposition.m +++ b/src/gui_shock_decomposition.m @@ -228,6 +228,25 @@ handles.pushbuttonClose = uicontrol( ... 'Position', [spc top-num*dheight 1-spc*4 dheight/2], ... 'String', 'init_state (condition on smoothed states in period 1)',... 'FontWeight', 'bold'); + + num = num + 1; + uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Tag', 'text8', ... + 'Style', 'text', ... + 'Units', 'normalized', ... + 'Position', [spc*3 top-num*dheight dwidth*1.5 dheight/2], ... + 'String', 'type:', ... + 'HorizontalAlignment', 'left'); + + handles.type = uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Tag', 'type', ... + 'Style', 'popupmenu', ... + 'Units', 'normalized', ... + 'Position', [spc*3+dwidth*1.5 top-num*dheight dwidth*2 dheight/2], ... + 'String', {'qoq','yoy','aoa'}, ... + 'Value', 1); end function pushbuttonShockDecomposition_Callback(hObject, ~) @@ -254,6 +273,7 @@ handles.pushbuttonClose = uicontrol( ... options_.datafile = project_info.data_file; options_.nodisplay = 0; options_.plot_priors = 0; + options_.type = handles.type.String; gui_tools.project_log_entry('Running shock decomposition', '...'); [jObj, guiObj] = gui_tools.create_animated_screen('Running shock decomposition, please wait...', tabId); var_list_ = handles.endoTable.Data([handles.endoTable.Data{:,1}], 2); @@ -349,6 +369,7 @@ handles.pushbuttonClose = uicontrol( ... handles.lastPeriodYear.Value = handles.lastPeriodYearDefault; handles.useShockGrouping.Value = 0; handles.useInitState.Value = 0; + handles.type.Value = 1; end function close_tab(~, ~, hTab) -- GitLab