diff --git a/src/+gui_auxiliary/command_option_mapping.m b/src/+gui_auxiliary/command_option_mapping.m index 5766d95206c89494cd82e33c219223bae5c039dc..0a14ebd70a4f8ce7df3a311665e7b5a1cdf7d29e 100644 --- a/src/+gui_auxiliary/command_option_mapping.m +++ b/src/+gui_auxiliary/command_option_mapping.m @@ -68,6 +68,12 @@ switch name case 'mh_nblocks' mapping = 'mh_nblck'; + case 'mh_tune_jscale' + mapping = 'mh_tune_jscale.target'; + + case 'mh_tune_guess' + mapping = 'mh_tune_jscale.guess'; + case 'mcmc_jumping_covariance' mapping = 'MCMC_jumping_covariance'; @@ -79,6 +85,9 @@ switch name case 'no_posterior_kernel_density' mapping = 'estimation.moments_posterior_density.indicator'; + + case 'nonlinear_filter_initialization' + mapping = 'nonlinear_filter'; case 'number_of_particles' mapping = 'particle.number_of_particles'; @@ -91,7 +100,7 @@ switch name case 'irf_plot_threshold' mapping = 'impulse_responses.plot_threshold'; - + otherwise mapping = name; end diff --git a/src/+gui_auxiliary/dynare_command_calib_smoother_results.m b/src/+gui_auxiliary/dynare_command_calib_smoother_results.m index 26176f6a13b7135a71bc2498a37b0b99ba69b723..fddd1bb726c751aa8462a535b483b29e93568289 100644 --- a/src/+gui_auxiliary/dynare_command_calib_smoother_results.m +++ b/src/+gui_auxiliary/dynare_command_calib_smoother_results.m @@ -16,7 +16,7 @@ function dynare_command_calib_smoother_results() % SPECIAL REQUIREMENTS % none -% Copyright (C) 2003-2019 Dynare Team +% Copyright (C) 2003-2020 Dynare Team % % This file is part of Dynare. % diff --git a/src/+gui_auxiliary/dynare_command_options_estimation.m b/src/+gui_auxiliary/dynare_command_options_estimation.m index 203308e4934738b6df5489a5d8515096fe9e7f77..772d1bbae16a94be2f99514329fa4cb25dbae1b4 100644 --- a/src/+gui_auxiliary/dynare_command_options_estimation.m +++ b/src/+gui_auxiliary/dynare_command_options_estimation.m @@ -225,7 +225,7 @@ dynare_gui_.estimation.solver{num,4} = 'Use the Anderson-Moore Algorithm (AIM) t num = num+1; dynare_gui_.estimation.solver{num,1} = 'sylvester'; dynare_gui_.estimation.solver{num,2} = 'default'; -dynare_gui_.estimation.solver{num,3} = {'','default', 'fixed_point'}; % special +dynare_gui_.estimation.solver{num,3} = {'default', 'fixed_point'}; % special dynare_gui_.estimation.solver{num,4} = 'Determines the algorithm used to solve the Sylvester equation for block decomposed model. Possible values for OPTION are: default and fixed_point. Default value is default.'; num = num+1; @@ -301,6 +301,18 @@ dynare_gui_.estimation.MH_options{num,2} = '2*mh_scale'; dynare_gui_.estimation.MH_options{num,3} = 'DOUBLE'; dynare_gui_.estimation.MH_options{num,4} = 'The scale to be used for drawing the initial value of the Metropolis-Hastings chain. Default: 2*mh_scale.'; +num = num+1; +dynare_gui_.estimation.MH_options{num,1} = 'mh_tune_jscale'; +dynare_gui_.estimation.MH_options{num,2} = '0.33'; +dynare_gui_.estimation.MH_options{num,3} = 'DOUBLE'; +dynare_gui_.estimation.MH_options{num,4} = 'Automatically tunes the scale parameter of the jumping distribution’s covariance matrix (Metropolis-Hastings), so that the overall acceptance ratio is close to the desired level. Default value is 0.33. It is not possible to match exactly the desired acceptance ratio because of the stochastic nature of the algorithm (the proposals and the initial conditions of the markov chains if mh_nblocks>1). This option is only available for the Random Walk Metropolis Hastings algorithm. Must not be used in conjunction with mh_jscale = DOUBLE.'; + +num = num+1; +dynare_gui_.estimation.MH_options{num,1} = 'mh_tune_guess'; +dynare_gui_.estimation.MH_options{num,2} = '0.2'; +dynare_gui_.estimation.MH_options{num,3} = 'DOUBLE'; +dynare_gui_.estimation.MH_options{num,4} = 'Specifies the initial value for the mh_tune_jscale option. Default: 0.2. Must not be set if mh_tune_jscale is not used.'; + num = num+1; dynare_gui_.estimation.MH_options{num,1} = 'mh_recover'; dynare_gui_.estimation.MH_options{num,2} = 0; @@ -319,6 +331,12 @@ 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} = 'load_results_after_load_mh'; +dynare_gui_.estimation.MH_options{num,2} = 0; +dynare_gui_.estimation.MH_options{num,3} = 'check_option'; +dynare_gui_.estimation.MH_options{num,4} = 'This option is available when loading a previous MCMC run without adding additional draws, i.e. when load_mh_file is specified with mh_replic=0. It tells Dynare to load the previously computed convergence diagnostics, marginal data density, and posterior statistics from an existing _results file instead of recomputing them.'; + num = num+1; dynare_gui_.estimation.MH_options{num,1} = 'nodiagnostic'; dynare_gui_.estimation.MH_options{num,2} = 0; @@ -410,6 +428,18 @@ dynare_gui_.estimation.filter{num,2} = '1'; dynare_gui_.estimation.filter{num,3} = 'INTEGER'; dynare_gui_.estimation.filter{num,4} = 'Decide whether Dynare should automatically switch to univariate filter if a singularity is encountered in the likelihood computation (this is the behaviour if the option is equal to 1). Alternatively, if the option is equal to 0, Dynare will not automatically change the filter, but rather use a penalty value for the likelihood when such a singularity is encountered. Default: 1.'; +num = num+1; +dynare_gui_.estimation.filter{num,1} = 'keep_kalman_algo_if_singularity_is_detected'; +dynare_gui_.estimation.filter{num,2} = 0; +dynare_gui_.estimation.filter{num,3} = 'check_option'; +dynare_gui_.estimation.filter{num,4} = 'With the default use_univariate_filters_if_singularity_is_detected=1, Dynare will switch to the univariate Kalman filter when it encounters a singular forecast error variance matrix during Kalman filtering. Upon encountering such a singularity for the first time, all subsequent parameter draws and computations will automatically rely on univariate filter, i.e. Dynare will never try the multivariate filter again. Use the keep_kalman_algo_if_singularity_is_detected option to have the use_univariate_filters_if_singularity_is_detected only affect the behavior for the current draw/computation.'; + +num = num+1; +dynare_gui_.estimation.filter{num,1} = 'smoothed_state_uncertainty'; +dynare_gui_.estimation.filter{num,2} = 0; +dynare_gui_.estimation.filter{num,3} = 'check_option'; +dynare_gui_.estimation.filter{num,4} = 'Triggers the computation of the variance of smoothed estimates, i.e. varT(yt).'; + num = num+1; dynare_gui_.estimation.filter{num,1} = 'diffuse_filter'; dynare_gui_.estimation.filter{num,2} = 0; @@ -435,7 +465,6 @@ dynare_gui_.estimation.filter{num,2} = '1e-16'; dynare_gui_.estimation.filter{num,3} = 'DOUBLE'; dynare_gui_.estimation.filter{num,4} = 'This is the convergence criterion used in the doubling algorithm to solve the Lyapunov equation. Its default value is 1e-16.'; - %% Group 6: postprocessing num = 1; dynare_gui_.estimation.postprocessing{num,1} = 'bayesian_irf'; @@ -521,12 +550,11 @@ dynare_gui_.estimation.postprocessing{num,2} = '40'; dynare_gui_.estimation.postprocessing{num,3} = 'INTEGER'; dynare_gui_.estimation.postprocessing{num,4} = 'Number of periods on which to compute the IRFs. Setting irf=0, suppresses the plotting of IRFs. Default: 40. Only used if [bayesian irf] is passed.'; -% There is no field in options_ structure for irf_shocks -% num = num+1; -% dynare_gui_.estimation.postprocessing{num,1} = 'irf_shocks'; -% dynare_gui_.estimation.postprocessing{num,2} = ''; -% dynare_gui_.estimation.postprocessing{num,3} = '( VARIABLE_NAME [[,] VARIABLE_NAME ...] )'; % special -% dynare_gui_.estimation.postprocessing{num,4} = 'The exogenous variables for which to compute IRFs. Default: all. Only used if [bayesian irf] is passed. Cannot be used with [dsge var].'; +num = num+1; +dynare_gui_.estimation.postprocessing{num,1} = 'irf_shocks'; +dynare_gui_.estimation.postprocessing{num,2} = ''; +dynare_gui_.estimation.postprocessing{num,3} = '( VARIABLE_NAME [[,] VARIABLE_NAME ...] )'; % special +dynare_gui_.estimation.postprocessing{num,4} = 'The exogenous variables for which to compute IRFs. Default: all. Only used if [bayesian irf] is passed. Cannot be used with [dsge var].'; num = num+1; dynare_gui_.estimation.postprocessing{num,1} = 'proposal_approximation'; @@ -540,7 +568,17 @@ dynare_gui_.estimation.postprocessing{num,2} = 'unscented'; dynare_gui_.estimation.postprocessing{num,3} = {'unscented','cubature','montecarlo'}; dynare_gui_.estimation.postprocessing{num,4} = 'Sets the method for approximating the particle distribution. Possible values for OPTION are: cubature, montecarlo and unscented. Default value is unscented.'; +num = num+1; +dynare_gui_.estimation.postprocessing{num,1} = 'cpf_weights'; +dynare_gui_.estimation.postprocessing{num,2} = 'amisanotristani'; +dynare_gui_.estimation.postprocessing{num,3} = {'amisanotristani','murrayjonesparslow'}; +dynare_gui_.estimation.postprocessing{num,4} = 'Controls the method used to update the weights in conditional particle filter, possible values are amisanotristani (Amisano et al. (2010)) or murrayjonesparslow (Murray et al. (2013)).'; +num = num+1; +dynare_gui_.estimation.postprocessing{num,1} = 'nonlinear_filter_initialization'; +dynare_gui_.estimation.postprocessing{num,2} = '1'; +dynare_gui_.estimation.postprocessing{num,3} = 'INTEGER'; +dynare_gui_.estimation.postprocessing{num,4} = 'Sets the initial condition of the nonlinear filters. By default the nonlinear filters are initialized with the unconditional covariance matrix of the state variables, computed with the reduced form solution of the first order approximation of the model.'; %% Group 7: Particle filter num = 1; diff --git a/src/+gui_auxiliary/dynare_command_options_sensitivity.m b/src/+gui_auxiliary/dynare_command_options_sensitivity.m index b13c19dd16a9eb78ee3bb7eb551867a77b1e9dde..691a17fce18b15b77ee075ae3761234eab19b152 100644 --- a/src/+gui_auxiliary/dynare_command_options_sensitivity.m +++ b/src/+gui_auxiliary/dynare_command_options_sensitivity.m @@ -14,7 +14,7 @@ function dynare_command_options_sensitivity() % SPECIAL REQUIREMENTS % none -% Copyright (C) 2019 Dynare Team +% Copyright (C) 2019-2020 Dynare Team % % This file is part of Dynare. % @@ -92,7 +92,7 @@ dynare_gui_.sensitivity.sampling{num,4} = 'When pprior=0 and ppost=0, allows for %% Group 2: stability mapping num = 1; dynare_gui_.sensitivity.stability_mapping{num,1} = 'stab'; -dynare_gui_.sensitivity.stability_mapping{num,2} = 0; +dynare_gui_.sensitivity.stability_mapping{num,2} = 1; dynare_gui_.sensitivity.stability_mapping{num,3} = 'check_option'; dynare_gui_.sensitivity.stability_mapping{num,4} = 'If equal to 1, perform stability mapping. If equal to 0, do not perform stability mapping.'; diff --git a/src/+gui_auxiliary/dynare_command_options_simul.m b/src/+gui_auxiliary/dynare_command_options_simul.m index 692b3a77a0bfa2ae4ae462305a2cf40fdf21b6a1..e171bdd864120a7cd2f1f42b522bbd50864e43fb 100644 --- a/src/+gui_auxiliary/dynare_command_options_simul.m +++ b/src/+gui_auxiliary/dynare_command_options_simul.m @@ -68,6 +68,12 @@ dynare_gui_.simul.solver{num,2} = '1e-5'; dynare_gui_.simul.solver{num,3} = 'DOUBLE'; dynare_gui_.simul.solver{num,4} = 'Convergence criterion for termination based on change in function argument'; +num = num+1; +dynare_gui_.simul.solver{num,1} = 'noprint'; +dynare_gui_.simul.solver{num,2} = 0; +dynare_gui_.simul.solver{num,3} = 'check_option'; +dynare_gui_.simul.solver{num,4} = 'Don’t print anything. Useful for loops.'; + num = num+1; dynare_gui_.simul.solver{num,1} = 'stack_solve_algo'; dynare_gui_.simul.solver{num,2} = '0'; diff --git a/src/+gui_auxiliary/dynare_command_options_stoch_simul.m b/src/+gui_auxiliary/dynare_command_options_stoch_simul.m index 5f096f1ef9a11947ad15b162b485b506d956138c..ee435bb835a9308e689b6ba5e9dcf2178dd350e9 100644 --- a/src/+gui_auxiliary/dynare_command_options_stoch_simul.m +++ b/src/+gui_auxiliary/dynare_command_options_stoch_simul.m @@ -14,7 +14,7 @@ function dynare_command_options_stoch_simul() % SPECIAL REQUIREMENTS % none -% Copyright (C) 2003-2018 Dynare Team +% Copyright (C) 2003-2020 Dynare Team % % This file is part of Dynare. % @@ -85,11 +85,11 @@ dynare_gui_.stoch_simul.irf{num,2} = '1e-10'; dynare_gui_.stoch_simul.irf{num,3} = 'DOUBLE'; dynare_gui_.stoch_simul.irf{num,4} = 'Threshold size for plotting IRFs. All IRFs for a particular variable with a maximum absolute deviation from the steady state smaller than this value are not displayed. Default: 1e-10.'; -% num = num+1; -% dynare_gui_.stoch_simul.irf{num,1} = 'irf_shocks'; -% dynare_gui_.stoch_simul.irf{num,2} = ''; -% dynare_gui_.stoch_simul.irf{num,3} = 'list'; -% dynare_gui_.stoch_simul.irf{num,4} = 'The exogenous variables for which to compute IRFs. Default: all.'; +num = num+1; +dynare_gui_.stoch_simul.irf{num,1} = 'irf_shocks'; +dynare_gui_.stoch_simul.irf{num,2} = ''; +dynare_gui_.stoch_simul.irf{num,3} = '( VARIABLE_NAME [[,] VARIABLE_NAME ...] )'; % special +dynare_gui_.stoch_simul.irf{num,4} = 'The exogenous variables for which to compute IRFs. Default: all.'; num = num+1; dynare_gui_.stoch_simul.irf{num,1} = 'relative_irf'; @@ -236,6 +236,12 @@ dynare_gui_.stoch_simul.filter{num,2} = '[6,32]'; dynare_gui_.stoch_simul.filter{num,3} = '[INTEGER1:INTEGER2]'; %'[HIGHEST_PERIODICITY LOWEST_PERIODICITY]'; dynare_gui_.stoch_simul.filter{num,4} = 'Uses a bandpass filter before computing moments. The passband is set to a periodicity of HIGHEST_PERIODICITY to LOWEST_PERIODICITY, e.g. 6 to 32 quarters if the model frequency is quarterly. Default: [6,32].'; +num = num+1; +dynare_gui_.stoch_simul.filter{num,1} = 'filtered_theoretical_moments_grid'; +dynare_gui_.stoch_simul.filter{num,2} = '512'; +dynare_gui_.stoch_simul.filter{num,3} = 'INTEGER'; +dynare_gui_.stoch_simul.filter{num,4} = 'When computing filtered theoretical moments (with either option hp_filter or option bandpass_filter), this option governs the number of points in the grid for the discrete Inverse Fast Fourier Transform. It may be necessary to increase it for highly autocorrelated processes.'; + %% Group 6: Output num = 1; diff --git a/src/+gui_auxiliary/set_command_option.m b/src/+gui_auxiliary/set_command_option.m index b57cbbd2342d7c4ad42bc416a3cb98b04d1c678e..4ce78ccf34802b8a789a5de620dc1cd376c268f3 100644 --- a/src/+gui_auxiliary/set_command_option.m +++ b/src/+gui_auxiliary/set_command_option.m @@ -57,18 +57,19 @@ try end case 'sylvester' - if value == 2 %default - options_.sylvester_fp = 0; - elseif value == 3 %fixed_point + options_.sylvester_fp = 0; + + if value == 2 %fixed_point options_.sylvester_fp = 1; end + case 'dr' options_.dr_cycle_reduction = 0; options_.dr_logarithmic_reduction = 0; - if strcmp(value, 'cycle_reduction') + if value == 2 options_.dr_cycle_reduction = 1; - elseif strcmp(value, 'logarithmic_reduction') + elseif value == 3 options_.dr_logarithmic_reduction = 1; end @@ -140,15 +141,19 @@ try case 'resampling' if value == 2 + options_.particle.resampling.status.systematic = false; options_.particle.resampling.status.none = true; elseif value == 3 + options_.particle.resampling.status.systematic = false; options_.particle.resampling.status.generic = true; end case 'resampling_method' if value == 2 + options_.particle.resampling.method.kitigawa = false; options_.particle.resampling.method.stratified = true; elseif value == 3 + options_.particle.resampling.method.kitigawa = false; options_.particle.resampling.method.smooth = true; end @@ -167,20 +172,41 @@ try case 'distribution_approximation' if value == 2 + options_.particle.distribution_approximation.unscented = false; options_.particle.distribution_approximation.cubature = true; elseif value == 3 + options_.particle.distribution_approximation.unscented = false; options_.particle.distribution_approximation.montecarlo = true; end case 'proposal_approximation' if value == 2 + options_.particle.proposal_approximation.unscented = false; options_.particle.proposal_approximation.cubature = true; elseif value == 3 + options_.particle.proposal_approximation.unscented = false; options_.particle.proposal_approximation.montecarlo = true; end + case 'cpf_weights' + if value == 2 + options_.particle.cpf_weights_method.amisanotristani = false; + options_.particle.cpf_weights_method.murrayjonesparslow = true; + end + case 'posterior_nograph' options_.no_graph.posterior = logical(value); + + case 'irf_shocks' + if contains(value, ',') + irf_shocks_ = strsplit(value, ','); + options_.irf_shocks = irf_shocks_; + else + options_.irf_shocks = {value}; + end + + case 'keep_kalman_algo_if_singularity_is_detected' + options_.kalman.keep_kalman_algo_if_singularity_is_detected = logical(value); otherwise if isnumeric(value) diff --git a/src/gui_calib_smoother.m b/src/gui_calib_smoother.m index 31cff0c8fc1a623f693eaa0a5d2c47d2cb93ed0e..97345643c2a84770211eb732fb3d0be00a1fa0f9 100644 --- a/src/gui_calib_smoother.m +++ b/src/gui_calib_smoother.m @@ -183,6 +183,23 @@ handles.pushbuttonCloseAll = uicontrol( ... 'HorizontalAlignment', 'left',... 'Callback', {@checkCommOption_Callback,'filter_step_ahead'}); + num = num+1; + uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Tag', 'text7', ... + 'Style', 'text', 'BackgroundColor', bg_color,... + 'Units','normalized','Position',[spc*2 top-num*dheight dwidth*1.5 dheight/2],... + 'String', 'prefilter:', ... + 'HorizontalAlignment', 'left'); + + handles.prefilter = uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Style', 'edit', 'BackgroundColor', bg_color,... + 'Units','normalized','Position',[spc*3+dwidth*1.5 top-num*dheight dwidth*1.5 dheight/2],... + 'TooltipString','A value of 1 means that the estimation procedure will demean each data series by its empirical mean. Default: 0, i.e. no prefiltering.',... + 'HorizontalAlignment', 'left',... + 'Callback', {@checkCommOption_Callback,'prefilter'}); + num = num+1; uicontrol( ... 'Parent', handles.uipanelResults, ... @@ -203,6 +220,122 @@ handles.pushbuttonCloseAll = uicontrol( ... model_settings.calib_smoother.parameter_set = 'calibration'; + num = num+1; + uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Tag', 'text7', ... + 'Style', 'text', 'BackgroundColor', bg_color,... + 'Units','normalized','Position',[spc*2 top-num*dheight dwidth*1.5 dheight/2],... + 'String', 'loglinear:', ... + 'HorizontalAlignment', 'left'); + + handles.loglinear = uicontrol(... + 'Parent', handles.uipanelResults, ... + 'Style','checkbox',... + 'Units','normalized','Position',[spc*3+dwidth*1.5 top-num*dheight dwidth dheight/2],... + 'TooltipString','Triggers the computation of a log-linear approximation of the model instead of a linear approximation.',... + 'Callback', {@checkCommOption_Callback,'loglinear'}); + + num = num+1; + uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Tag', 'text7', ... + 'Style', 'text', 'BackgroundColor', bg_color,... + 'Units','normalized','Position',[spc*2 top-num*dheight dwidth*1.5 dheight/2],... + 'String', 'first_obs:', ... + 'HorizontalAlignment', 'left'); + + handles.first_obs = uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Style', 'edit', 'BackgroundColor', bg_color,... + 'Units','normalized','Position',[spc*3+dwidth*1.5 top-num*dheight dwidth*1.5 dheight/2],... + 'TooltipString','The number of the first observation to be used. In case of estimating a DSGE-VAR, first_obs needs to be larger than the number of lags. Default: 1.',... + 'HorizontalAlignment', 'left',... + 'Callback', {@checkCommOption_Callback,'first_obs'}); + + num = num+1; + uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Tag', 'text7', ... + 'Style', 'text', 'BackgroundColor', bg_color,... + 'Units','normalized','Position',[spc*2 top-num*dheight dwidth*1.5 dheight/2],... + 'String', 'filter_decomposition:', ... + 'HorizontalAlignment', 'left'); + + handles.filter_decomposition = uicontrol(... + 'Parent', handles.uipanelResults, ... + 'Style','checkbox',... + 'Units','normalized','Position',[spc*3+dwidth*1.5 top-num*dheight dwidth dheight/2],... + 'TooltipString','Triggers the computation of the shock decomposition of the above k-step ahead filtered values.',... + 'Callback', {@checkCommOption_Callback,'filter_decomposition'}); + + num = num+1; + uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Tag', 'text7', ... + 'Style', 'text', 'BackgroundColor', bg_color,... + 'Units','normalized','Position',[spc*2 top-num*dheight dwidth*1.5 dheight/2],... + 'String', 'diffuse_filter:', ... + 'HorizontalAlignment', 'left'); + + handles.diffuse_filter = uicontrol(... + 'Parent', handles.uipanelResults, ... + 'Style','checkbox',... + 'Units','normalized','Position',[spc*3+dwidth*1.5 top-num*dheight dwidth dheight/2],... + 'TooltipString','Uses the diffuse Kalman filter (as described in Durbin and Koopman (2012) and Koopman and Durbin (2003) for the multivariate and Koopman and Durbin (2000) for the univariate filter) to estimate models with non-stationary observed variables.',... + 'Callback', {@checkCommOption_Callback,'diffuse_filter'}); + + num = num+1; + uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Tag', 'text7', ... + 'Style', 'text', 'BackgroundColor', bg_color,... + 'Units','normalized','Position',[spc*2 top-num*dheight dwidth*1.5 dheight/2],... + 'String', 'diffuse_kalman_tol:', ... + 'HorizontalAlignment', 'left'); + + handles.diffuse_kalman_tol = uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Style', 'edit', 'BackgroundColor', bg_color,... + 'Units','normalized','Position',[spc*3+dwidth*1.5 top-num*dheight dwidth*1.5 dheight/2],... + 'TooltipString','Numerical tolerance for determining the singularity of the covariance matrix of the prediction errors (F∞) and the rank of the covariance matrix of the non-stationary state variables (P∞) during the Diffuse Kalman filter. Default value is 1e-6.',... + 'HorizontalAlignment', 'left',... + 'Callback', {@checkCommOption_Callback,'diffuse_kalman_tol'}); + + num = num+1; + uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Tag', 'text7', ... + 'Style', 'text', 'BackgroundColor', bg_color,... + 'Units','normalized','Position',[spc*2 top-num*dheight dwidth*1.5 dheight/2],... + 'String', 'xls_sheet:', ... + 'HorizontalAlignment', 'left'); + + handles.xls_sheet = uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Style', 'edit', 'BackgroundColor', bg_color,... + 'Units','normalized','Position',[spc*3+dwidth*1.5 top-num*dheight dwidth*1.5 dheight/2],... + 'TooltipString','The name of the sheet with the data in an Excel file.',... + 'HorizontalAlignment', 'left',... + 'Callback', {@checkCommOption_Callback,'xls_sheet'}); + + num = num+1; + uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Tag', 'text7', ... + 'Style', 'text', 'BackgroundColor', bg_color,... + 'Units','normalized','Position',[spc*2 top-num*dheight dwidth*1.5 dheight/2],... + 'String', 'xls_range:', ... + 'HorizontalAlignment', 'left'); + + handles.xls_range = uicontrol( ... + 'Parent', handles.uipanelResults, ... + 'Style', 'edit', 'BackgroundColor', bg_color,... + 'Units','normalized','Position',[spc*3+dwidth*1.5 top-num*dheight dwidth*1.5 dheight/2],... + 'TooltipString','The range with the data in an Excel file. For example, xls_range=B2:D200.',... + 'HorizontalAlignment', 'left',... + 'Callback', {@checkCommOption_Callback,'xls_range'}); + num = num+2; uicontrol( ... 'Parent', handles.uipanelResults, ... @@ -242,6 +375,8 @@ handles.pushbuttonCloseAll = uicontrol( ... end switch option_name + case 'filtered_vars' + comm_options.filtered_vars = value; case 'filter_step_ahead' if ~isempty(value) num_value = str2num(value); @@ -261,8 +396,24 @@ handles.pushbuttonCloseAll = uicontrol( ... comm_options = rmfield(comm_options,'filter_step_ahead'); end end - case 'filtered_vars' - comm_options.filtered_vars = value; + case 'prefilter' + comm_options.prefilter = value; + case 'parameter_set' + comm_options.parameter_set = hObject.String{value}; + case 'loglinear' + comm_options.loglinear = value; + case 'first_obs' + comm_options.first_obs = value; + case 'filter_decomposition' + comm_options.filter_decomposition = value; + case 'diffuse_filter' + comm_options.diffuse_filter = value; + case 'diffuse_kalman_tol' + comm_options.diffuse_kalman_tol = value; + case 'xls_sheet' + comm_options.xls_sheet = value; + case 'xls_range' + comm_options.xls_range = value; case 'select_all_vars' if value handles.consider_only_observed.Value = false; @@ -273,8 +424,6 @@ handles.pushbuttonCloseAll = uicontrol( ... handles.select_all_vars.Value = false; end select_only_observed(value); - case 'parameter_set' - comm_options.parameter_set = hObject.String{value}; end comm_str = gui_tools.command_string('calib_smoother', comm_options); handles.calib_smoother.String = comm_str; @@ -354,7 +503,15 @@ handles.pushbuttonCloseAll = uicontrol( ... handles.endoTable.Data(:,1) = {false}; handles.filtered_vars.Value = 0; handles.filter_step_ahead.String = ''; + handles.prefilter.Value = 0; handles.parameter_set.Value = 1; + handles.loglinear.Value = 0; + handles.first_obs.Value = 1; + handles.filter_decomposition.Value = 0; + handles.diffuse_filter.Value = 0; + handles.diffuse_kalman_tol.Value = 0; + handles.xls_sheet.String = ''; + handles.xls_range.String = ''; handles.select_all_vars.Value =0; handles.consider_only_observed.Value = 0; model_settings.calib_smoother = struct(); diff --git a/src/gui_define_comm_options.m b/src/gui_define_comm_options.m index cab37ced2267aebf33c4c96eaf737727c22b27cd..66b8bb917d25e36a1b189897c55b1b4fff729b1d 100644 --- a/src/gui_define_comm_options.m +++ b/src/gui_define_comm_options.m @@ -242,7 +242,8 @@ handles.pushbuttonReset = uicontrol( ... tab_handles.values(ii).String = user_defined_options.(group{ii,1}); elseif strcmp(option_type, 'eps, pdf, fig, none') ... || strcmp(option_type, 'FILENAME') ... - || strcmp(option_type, 'VARIABLE_LIST') + || strcmp(option_type, 'VARIABLE_LIST') ... + || strcmp(option_type, '( VARIABLE_NAME [[,] VARIABLE_NAME ...] )') tab_handles.values(ii).String = user_defined_options.(group{ii,1}); end elseif iscell(option_type) diff --git a/src/gui_sensitivity_analysis.m b/src/gui_sensitivity_analysis.m index 23a2b78fe78894641a669f0d7d0ee8c914a3a5e9..a703bbc541c4f9cd3e143de3aac2ffd82131bbc8 100644 --- a/src/gui_sensitivity_analysis.m +++ b/src/gui_sensitivity_analysis.m @@ -11,7 +11,7 @@ function gui_sensitivity_analysis(tabId) % SPECIAL REQUIREMENTS % none -% Copyright (C) 2019 Dynare Team +% Copyright (C) 2019-2020 Dynare Team % % This file is part of Dynare. % @@ -68,20 +68,38 @@ handles.pushbuttonSensitivity = uicontrol( ... old_oo_ = oo_; old_options_ = options_; try - options_ = struct(); if ~isempty(model_settings.sensitivity) names = fieldnames(model_settings.sensitivity); + options_gsa = model_settings.sensitivity; + options_ = old_options_; for ii = 1:size(names, 1) - if isempty(model_settings.sensitivity.(names{ii})) - gui_auxiliary.set_command_option(names{ii}, 1, 'check_option'); - else - gui_auxiliary.set_command_option(names{ii}, model_settings.sensitivity.(names{ii})); + switch names{ii} + case 'namendo' + if contains(options_gsa.(names{ii}), ',') + namendo_ = strsplit(options_gsa.(names{ii}), ','); + options_gsa.namendo = namendo_; + else + options_gsa.namendo = {options_gsa.(names{ii})}; + end + case 'namlagendo' + if contains(options_gsa.(names{ii}), ',') + namlagendo_ = strsplit(options_gsa.(names{ii}), ','); + options_gsa.namlagendo = namlagendo_; + else + options_gsa.namlagendo = {options_gsa.(names{ii})}; + end + case 'namexo' + if contains(options_gsa.(names{ii}), ',') + namexo_ = strsplit(options_gsa.(names{ii}), ','); + options_gsa.namexo = namexo_; + else + options_gsa.namexo = {options_gsa.(names{ii})}; + end + case 'threshold_redform' + options_gsa.threshold_redform = str2num(options_gsa.(names{ii})); end end end - options_gsa = options_; - options_ = old_options_; - gui_tools.project_log_entry('Running stochastic sensitivity','...'); [jObj, guiObj] = gui_tools.create_animated_screen('Running stochastic sensitivity, please wait...', tabId); handles.pushbuttonResults.Enable = 'off';