Skip to content
Snippets Groups Projects
Verified Commit c7e306f9 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

introduce interface for prior/posterior distribution of moments

parent 49799686
Branches
No related tags found
No related merge requests found
......@@ -12,7 +12,7 @@ function menu_options(oid, status)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-2019 Dynare Team
% Copyright (C) 2003-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -29,7 +29,7 @@ function menu_options(oid, status)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global M_ oo_ project_info
global oo_ project_info
handles = guihandles(getappdata(0,'main_figure'));
......@@ -110,6 +110,9 @@ switch oid
case 'epilogue'
handles.post_processing_epilogue.Enable = status;
case 'prior_posterior'
handles.post_processing_prior_posterior.Enable = status;
otherwise
error(['menu option: ' oid ' not handled']);
end
......
......@@ -17,7 +17,7 @@ function varargout = dynare_gui(varargin)
% stop. All inputs are passed to dynare_gui_OpeningFcn via varargin.
%
%
% Copyright (C) 2003-2019 Dynare Team
% Copyright (C) 2003-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -355,6 +355,9 @@ function post_processing_epilogue_Callback(hObject, ~, handles)
gui_epilogue(addTab(hObject, 'Epilogue', handles));
end
function post_processing_prior_posterior_Callback(hObject, ~, handles)
gui_prior_posterior_distribution(addTab(hObject, 'Prior/Posterior distribution', handles));
end
% --------------------------------------------------------------------
function help_product_help_Callback(~, ~, ~)
path = [getappdata(0, 'dynare_gui_root') filesep 'resources' filesep 'html' filesep 'index.html'];
......@@ -936,6 +939,17 @@ uimenu(...
'Tag', 'post_processing_epilogue',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'post_processing_prior_posterior';
uimenu(...
'Parent', h33, ...
'Enable', 'off', ...
'Callback', @(hObject,eventdata)dynare_gui('post_processing_prior_posterior_Callback',hObject,eventdata,guidata(hObject)),...
'Label', 'Prior/Posterior distribution',...
'Tag', 'post_processing_prior_posterior',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'help';
......
function gui_prior_posterior_distribution(tabId)
% function gui_prior_posterior_distribution(tabId)
%
% INPUTS
% tabId: GUI tab element which displays epilogue command interface
%
% OUTPUTS
% none
%
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2020 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global M_
bg_color = char(getappdata(0, 'bg_color'));
special_color = char(getappdata(0, 'special_color'));
handles = [];
gui_size = gui_tools.get_gui_elements_size(tabId);
% --- PANELS -------------------------------------
handles.uipanelVars = uipanel( ...
'Parent', tabId, ...
'Tag', 'uipanelVars', ...
'UserData', zeros(1,0), ...
'BackgroundColor', special_color, ...
'Units', 'normalized', ...
'Position', [0.51 0.18 0.48 0.7], ...
'Title', '', ...
'BorderType', 'none');
handles = gui_tabs.create_endo_vars(handles, 'prior_posterior');
% --- Radio Buttons -------------------------------------
handles.buttongroup = uibuttongroup( ...
'Parent', tabId, ...
'Position', [0.05 0.88 0.36 0.05], ...
'Units', 'normalized');
uicontrol(handles.buttongroup, ...
'Style', 'radiobutton', ...
'String', 'Prior', ...
'Units', 'normalized', ...
'Position', [0 0 1 1]);
uicontrol(handles.buttongroup, ...
'Style', 'radiobutton', ...
'String', 'Posterior', ...
'Units', 'normalized', ...
'Position', [0.1 0 1 1]);
handles.buttongroup1 = uibuttongroup( ...
'Parent', tabId, ...
'Position', [0.05 0.2 0.4 0.65], ...
'Units', 'normalized');
uicontrol(handles.buttongroup1, ...
'Style', 'radiobutton', ...
'String', 'IRF', ...
'Units', 'normalized', ...
'Position', [0 0.9 1 .1]);
uicontrol(handles.buttongroup1, ...
'Style', 'radiobutton', ...
'String', 'Smoother', ...
'Units', 'normalized', ...
'Position', [0 0.8 1 .1]);
uicontrol(handles.buttongroup1, ...
'Style', 'radiobutton', ...
'String', 'Smoother', ...
'Units', 'normalized', ...
'Position', [0 0.7 1 .1]);
uicontrol(handles.buttongroup1, ...
'Style', 'radiobutton', ...
'String', 'Filter', ...
'Units', 'normalized', ...
'Position', [0 0.6 1 .1]);
uicontrol(handles.buttongroup1, ...
'Style', 'radiobutton', ...
'String', 'Update', ...
'Units', 'normalized', ...
'Position', [0 0.5 1 .1]);
uicontrol(handles.buttongroup1, ...
'Style', 'radiobutton', ...
'String', 'Forecast', ...
'Units', 'normalized', ...
'Position', [0 0.4 1 .1]);
% --- PUSHBUTTONS -------------------------------------
handles.pushbuttonSimulation = uicontrol( ...
'Parent', tabId, ...
'Tag', 'pushbuttonPriorPosterior', ...
'Style', 'pushbutton', ...
'Units','normalized', ...
'Position', [gui_size.space gui_size.bottom gui_size.button_width_small gui_size.button_height], ...
'String', 'Run prior/posterior', ...
'Callback', @pushbuttonPriorPosterior_Callback);
function pushbuttonPriorPosterior_Callback(~, ~)
end
handles.pushbuttonReset = uicontrol( ...
'Parent', tabId, ...
'Tag', 'pushbuttonReset', ...
'Style', 'pushbutton', ...
'Units','normalized', ...
'Position', [gui_size.space*2+gui_size.button_width_small gui_size.bottom gui_size.button_width_small gui_size.button_height], ...
'String', 'Reset', ...
'Callback', @reset);
function reset(~, ~)
handles.endoTable.Data(:, 1) = {false};
end
uicontrol( ...
'Parent', tabId, ...
'Tag', 'pushbuttonCloseTab', ...
'Style', 'pushbutton', ...
'Units', 'normalized', ...
'Position', [gui_size.space*3+gui_size.button_width_small*2 gui_size.bottom gui_size.button_width_small gui_size.button_height], ...
'String', 'Close this tab', ...
'Callback', {@close_tab,tabId});
function close_tab(~, ~, hTab)
gui_tabs.delete_tab(hTab);
end
uicontrol( ...
'Parent', tabId, ...
'Tag', 'pushbuttonSimulation', ...
'Style', 'pushbutton', ...
'Units','normalized', ...
'Position', [gui_size.space*5+gui_size.button_width_small*4 gui_size.bottom gui_size.button_width_small gui_size.button_height], ...
'String', 'Close all output figures', ...
'Enable', 'on', ...
'Callback', @close_all);
function close_all(~, ~)
gui_tools.close_all_figures();
end
end
......@@ -11,7 +11,7 @@ function gui_set_menus(enable)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2019 Dynare Team
% Copyright (C) 2019-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -40,6 +40,7 @@ gui_tools.menu_options('stochastic','Off');
gui_tools.menu_options('deterministic','Off');
gui_tools.menu_options('sensitivity', 'Off');
gui_tools.menu_options('epilogue', 'Off');
gui_tools.menu_options('prior_posterior', 'Off');
if isempty(model_settings) || isempty(fieldnames(model_settings))
return
......@@ -51,6 +52,7 @@ if enable
return
end
gui_tools.menu_options('epilogue', 'On');
gui_tools.menu_options('prior_posterior', 'On');
if project_info.project_model_stochastic
gui_tools.menu_options('estimation', 'On');
gui_tools.menu_options('stochastic', 'On');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment