diff --git a/src/+gui_auxiliary/dynare_command_options_estimation.m b/src/+gui_auxiliary/dynare_command_options_estimation.m index 45c8cc74617a44557ea2aa55711f247e24452d87..bdcc007563fcc7ddea1b14b28241d44119fdce2d 100644 --- a/src/+gui_auxiliary/dynare_command_options_estimation.m +++ b/src/+gui_auxiliary/dynare_command_options_estimation.m @@ -14,7 +14,7 @@ function dynare_command_options_estimation() % SPECIAL REQUIREMENTS % none -% Copyright (C) 2003-2019 Dynare Team +% Copyright (C) 2003-2020 Dynare Team % % This file is part of Dynare. % @@ -242,6 +242,18 @@ dynare_gui_.estimation.solver{num,4} = 'Value used to test if a generalized eige %% Group 4: MH_options num = 1; +dynare_gui_.estimation.MH_options{num,1} = 'mcmc_jumping_covariance'; +dynare_gui_.estimation.MH_options{num,2} = 'hessian'; +dynare_gui_.estimation.MH_options{num,3} = {'hessian','prior_variance','identity_matrix','FILENAME'}; %special +dynare_gui_.estimation.MH_options{num,4} = 'Tells Dynare which covariance to use for the proposal density of the MCMC sampler. mcmc_jumping_covariance can be one of the following: hessian,prior_variance,identity_matrix or FILENAME. Default value is hessian.'; + +num = num+1; +dynare_gui_.estimation.MH_options{num,1} = 'mcmc_jumping_covariance_file'; +dynare_gui_.estimation.MH_options{num,2} = ''; +dynare_gui_.estimation.MH_options{num,3} = 'FILENAME'; +dynare_gui_.estimation.MH_options{num,4} = 'Tells Dynare which file with a jumping covariance matrix to use. Stored in a .mat file. Should be specified if mcmc_jumping_covariance=FILENAME'; + +num = num+1; dynare_gui_.estimation.MH_options{num,1} = 'mh_conf_sig'; dynare_gui_.estimation.MH_options{num,2} = '0.9'; dynare_gui_.estimation.MH_options{num,3} = 'DOUBLE'; @@ -307,13 +319,6 @@ dynare_gui_.estimation.MH_options{num,2} = 0; dynare_gui_.estimation.MH_options{num,3} = 'check_option'; dynare_gui_.estimation.MH_options{num,4} = 'Tells Dynare to add to previous Metropolis-Hastings simulations instead of starting from scratch. Shouldnt be used together with mh_recover.'; -num = num+1; -dynare_gui_.estimation.MH_options{num,1} = 'mcmc_jumping_covariance'; -dynare_gui_.estimation.MH_options{num,2} = 'hessian'; -dynare_gui_.estimation.MH_options{num,3} = {'hessian','prior_variance','identity_matrix','FILENAME'}; %special -dynare_gui_.estimation.MH_options{num,4} = 'Tells Dynare which covariance to use for the proposal density of the MCMC sampler. mcmc_jumping_covariance can be one of the following: hessian,prior_variance,identity_matrix or FILENAME. Default value is hessian.'; - - num = num+1; dynare_gui_.estimation.MH_options{num,1} = 'nodiagnostic'; dynare_gui_.estimation.MH_options{num,2} = 0; diff --git a/src/+gui_auxiliary/set_command_option.m b/src/+gui_auxiliary/set_command_option.m index 3bb14446d7b0c92f0a068278fee1fb08ccf2401c..77745f7225ef1ce160c7cc673eb8d4ffa9a7a674 100644 --- a/src/+gui_auxiliary/set_command_option.m +++ b/src/+gui_auxiliary/set_command_option.m @@ -12,7 +12,7 @@ function status = set_command_option(name, value) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2003-2018 Dynare Team +% Copyright (C) 2003-2020 Dynare Team % % This file is part of Dynare. % @@ -73,7 +73,7 @@ try end case 'first_obs' - options_.first_obs = value; + options_.first_obs = str2num(value); case 'use_bandpass_filter' options_.bandpass.indicator = value; @@ -89,10 +89,31 @@ try case 'consider_only_observed' return; + + case 'mode_compute' + if ~isempty(str2num(value)) + options_.mode_compute = str2num(value); + else + options_.mode_compute = value; + end case 'filter_step_ahead' options_.filter_step_ahead = eval(value); + case 'mcmc_jumping_covariance' + if value == 2 + options_.(gui_auxiliary.command_option_mapping(name)) = 'prior_variance'; + elseif value == 3 + options_.(gui_auxiliary.command_option_mapping(name)) = 'identity_matrix'; + elseif value == 4 + options_.(gui_auxiliary.command_option_mapping(name)) = 'FILENAME'; + end + + case 'mcmc_jumping_covariance_file' + if ~isempty(value) && strcmp(options_.MCMC_jumping_covariance, 'FILENAME') + options_.MCMC_jumping_covariance = strrep(value, '.mat', ''); + end + otherwise options_.(gui_auxiliary.command_option_mapping(name)) = value; end diff --git a/src/gui_define_comm_options.m b/src/gui_define_comm_options.m index 7427686316f2a8ce8a3ecfde800cfa6fa01e2d0d..0683e89864697d4837a26cc18b1d9ef3c5631bba 100644 --- a/src/gui_define_comm_options.m +++ b/src/gui_define_comm_options.m @@ -13,7 +13,7 @@ function fHandle= gui_define_comm_options(comm, comm_name) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2003-2019 Dynare Team +% Copyright (C) 2003-2020 Dynare Team % % This file is part of Dynare. % @@ -236,8 +236,8 @@ handles.pushbuttonReset = uicontrol( ... tab_handles.values(ii).String = num2str(user_defined_options.(group{ii,1}), 15); elseif strcmp(option_type, '[INTEGER1:INTEGER2]') ... || strcmp(option_type, 'INTEGER or [INTEGER1:INTEGER2]') ... - || strcmp(option_type, '[DOUBLE DOUBLE') - tab_handles.values(ii).Value = str2num(user_defined_options.(group{ii,1})); + || strcmp(option_type, '[DOUBLE DOUBLE]') + tab_handles.values(ii).Value = str2double(user_defined_options.(group{ii,1})); tab_handles.values(ii).String = user_defined_options.(group{ii,1}); elseif strcmp(option_type, 'eps, pdf, fig, none') ... || strcmp(option_type, 'FILENAME') ... @@ -321,6 +321,8 @@ handles.pushbuttonReset = uicontrol( ... file_types = {'*.m';'*.mat';'*.xls';'*.xlsx';'*.csv'}; case 'mode_file' file_types = {'*.mat'}; + case 'mcmc_jumping_covariance_file' + file_types = {'*.mat'}; end [fileName,pathName] = uigetfile(file_types,sprintf('Select %s ...', option_name));