Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 4.5
  • master
  • noGUIDE
3 results

Target

Select target project
  • Dynare/matlab-gui
  • DoraK/matlab-gui
  • rattoma/matlab-gui
3 results
Select Git revision
  • 4.5
  • master
  • noGUIDE
3 results
Show changes
Commits on Source (75)
Showing
with 953 additions and 373 deletions
...@@ -23,3 +23,6 @@ checksum ...@@ -23,3 +23,6 @@ checksum
*.dproj *.dproj
examples/**/* examples/**/*
gemc-dynare4.6/*
old_gemc-dynare4.6/*
...@@ -12,7 +12,7 @@ function mapping = command_option_mapping(name) ...@@ -12,7 +12,7 @@ function mapping = command_option_mapping(name)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2018 Dynare Team % Copyright (C) 2003-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -65,12 +65,15 @@ switch name ...@@ -65,12 +65,15 @@ switch name
case 'mode_check_number_of_points' case 'mode_check_number_of_points'
mapping = 'mode_check.number_of_points'; mapping = 'mode_check.number_of_points';
case 'optim'
mapping = 'optim_opt';
case 'mh_nblocks' case 'mh_nblocks'
mapping = 'mh_nblck'; 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' case 'mcmc_jumping_covariance'
mapping = 'MCMC_jumping_covariance'; mapping = 'MCMC_jumping_covariance';
...@@ -80,39 +83,18 @@ switch name ...@@ -80,39 +83,18 @@ switch name
case 'geweke_interval' case 'geweke_interval'
mapping = 'convergence.geweke.geweke_interval'; mapping = 'convergence.geweke.geweke_interval';
case 'use_tarb'
mapping = 'TaRB.use_TaRB';
case 'tarb_new_block_probability'
mapping = 'TaRB.new_block_probability';
case 'tarb_mode_compute'
mapping = 'TaRB.mode_compute';
case 'no_posterior_kernel_density' case 'no_posterior_kernel_density'
mapping = 'estimation.moments_posterior_density.indicator'; mapping = 'estimation.moments_posterior_density.indicator';
case 'proposal_approximation' case 'nonlinear_filter_initialization'
mapping = 'particle.proposal_approximation'; mapping = 'nonlinear_filter';
case 'distribution_approximation'
mapping = 'particle.distribution_approximation';
case 'number_of_particles' case 'number_of_particles'
mapping = 'particle.number_of_particles'; mapping = 'particle.number_of_particles';
case 'resampling'
mapping = 'particle.resampling.status';
case 'resampling_threshold' case 'resampling_threshold'
mapping = 'particle.resampling.threshold'; mapping = 'particle.resampling.threshold';
case 'resampling_method'
mapping = 'particle.resampling.method';
case 'filter_algorithm'
mapping = 'particle.filter_algorithm';
case 'tex' case 'tex'
mapping = 'TeX'; mapping = 'TeX';
......
...@@ -16,7 +16,7 @@ function dynare_command_calib_smoother_results() ...@@ -16,7 +16,7 @@ function dynare_command_calib_smoother_results()
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2019 Dynare Team % Copyright (C) 2003-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
......
...@@ -14,7 +14,7 @@ function dynare_command_options_dynare() ...@@ -14,7 +14,7 @@ function dynare_command_options_dynare()
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2019 Dynare Team % Copyright (C) 2003-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -164,12 +164,6 @@ dynare_gui_.dynare.setup{num,4} = ['Instructs Dynare not to write parameter ' .. ...@@ -164,12 +164,6 @@ dynare_gui_.dynare.setup{num,4} = ['Instructs Dynare not to write parameter ' ..
'running dynare on a large .mod file that runs into ' ... 'running dynare on a large .mod file that runs into ' ...
'workspace size limitations imposed by MATLAB.']; 'workspace size limitations imposed by MATLAB.'];
num = num+1;
dynare_gui_.dynare.setup{num,1} = 'onlymodel';
dynare_gui_.dynare.setup{num,2} = 1;
dynare_gui_.dynare.setup{num,3} = 'check_option';
dynare_gui_.dynare.setup{num,4} = 'Instructs Dynare to parse the .mod file but not to run commands it contains';
num = num+1; num = num+1;
dynare_gui_.dynare.setup{num,1} = 'compute_xrefs'; dynare_gui_.dynare.setup{num,1} = 'compute_xrefs';
dynare_gui_.dynare.setup{num,2} = 0; dynare_gui_.dynare.setup{num,2} = 0;
......
...@@ -14,7 +14,7 @@ function dynare_command_options_estimation() ...@@ -14,7 +14,7 @@ function dynare_command_options_estimation()
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2019 Dynare Team % Copyright (C) 2003-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -225,7 +225,7 @@ dynare_gui_.estimation.solver{num,4} = 'Use the Anderson-Moore Algorithm (AIM) t ...@@ -225,7 +225,7 @@ dynare_gui_.estimation.solver{num,4} = 'Use the Anderson-Moore Algorithm (AIM) t
num = num+1; num = num+1;
dynare_gui_.estimation.solver{num,1} = 'sylvester'; dynare_gui_.estimation.solver{num,1} = 'sylvester';
dynare_gui_.estimation.solver{num,2} = 'default'; 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.'; 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; num = num+1;
...@@ -242,6 +242,18 @@ dynare_gui_.estimation.solver{num,4} = 'Value used to test if a generalized eige ...@@ -242,6 +242,18 @@ dynare_gui_.estimation.solver{num,4} = 'Value used to test if a generalized eige
%% Group 4: MH_options %% Group 4: MH_options
num = 1; 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,1} = 'mh_conf_sig';
dynare_gui_.estimation.MH_options{num,2} = '0.9'; dynare_gui_.estimation.MH_options{num,2} = '0.9';
dynare_gui_.estimation.MH_options{num,3} = 'DOUBLE'; dynare_gui_.estimation.MH_options{num,3} = 'DOUBLE';
...@@ -289,6 +301,18 @@ dynare_gui_.estimation.MH_options{num,2} = '2*mh_scale'; ...@@ -289,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,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.'; 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; num = num+1;
dynare_gui_.estimation.MH_options{num,1} = 'mh_recover'; dynare_gui_.estimation.MH_options{num,1} = 'mh_recover';
dynare_gui_.estimation.MH_options{num,2} = 0; dynare_gui_.estimation.MH_options{num,2} = 0;
...@@ -308,11 +332,10 @@ dynare_gui_.estimation.MH_options{num,3} = 'check_option'; ...@@ -308,11 +332,10 @@ 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. Shouldn’t be used together with mh_recover.'; dynare_gui_.estimation.MH_options{num,4} = 'Tells Dynare to add to previous Metropolis-Hastings simulations instead of starting from scratch. Shouldn’t be used together with mh_recover.';
num = num+1; num = num+1;
dynare_gui_.estimation.MH_options{num,1} = 'mcmc_jumping_covariance'; dynare_gui_.estimation.MH_options{num,1} = 'load_results_after_load_mh';
dynare_gui_.estimation.MH_options{num,2} = 'hessian'; dynare_gui_.estimation.MH_options{num,2} = 0;
dynare_gui_.estimation.MH_options{num,3} = {'hessian','prior_variance','identity_matrix','FILENAME'}; %special dynare_gui_.estimation.MH_options{num,3} = 'check_option';
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.'; 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; num = num+1;
dynare_gui_.estimation.MH_options{num,1} = 'nodiagnostic'; dynare_gui_.estimation.MH_options{num,1} = 'nodiagnostic';
...@@ -333,33 +356,28 @@ dynare_gui_.estimation.MH_options{num,3} = '[DOUBLE DOUBLE]'; %special ...@@ -333,33 +356,28 @@ dynare_gui_.estimation.MH_options{num,3} = '[DOUBLE DOUBLE]'; %special
dynare_gui_.estimation.MH_options{num,4} = 'Percentage of MCMC draws at the beginning and end of the MCMC chain taken to compute the Geweke (1992,1999) convergence diagnostics (requires [mh nblocks]=1) after discarding the first [mh drop], page 54 percent of draws as a burnin. Default: [0.2 0.5].'; dynare_gui_.estimation.MH_options{num,4} = 'Percentage of MCMC draws at the beginning and end of the MCMC chain taken to compute the Geweke (1992,1999) convergence diagnostics (requires [mh nblocks]=1) after discarding the first [mh drop], page 54 percent of draws as a burnin. Default: [0.2 0.5].';
num = num+1; num = num+1;
dynare_gui_.estimation.MH_options{num,1} = 'use_tarb'; dynare_gui_.estimation.MH_options{num,1} = 'raftery_lewis_diagnostics';
dynare_gui_.estimation.MH_options{num,2} = 0; dynare_gui_.estimation.MH_options{num,2} = 0;
dynare_gui_.estimation.MH_options{num,3} = 'check_option'; dynare_gui_.estimation.MH_options{num,3} = 'check_option';
dynare_gui_.estimation.MH_options{num,4} = 'Instructs Dynare to use the Tailored randomized block (TaRB) Metropolis-Hastings algorithm proposed by Chib and Ramamurthy (2010) instead of the standard Random-Walk Metropolis-Hastings.'; dynare_gui_.estimation.MH_options{num,4} = 'Triggers the computation of the Raftery and Lewis (1992) convergence diagnostics. The goal is deliver the number of draws required to estimate a particular quantile of the CDF q with precision r with a probability s. Typically, one wants to estimate the q=0.025 percentile (corresponding to a 95 percent HPDI) with a precision of 0.5 percent (r=0.005) with 95 percent certainty (s=0.95). The defaults can be changed via raftery_lewis_qrs.';
num = num+1; num = num+1;
dynare_gui_.estimation.MH_options{num,1} = 'tarb_new_block_probability'; dynare_gui_.estimation.MH_options{num,1} = 'raftery_lewis_qrs';
dynare_gui_.estimation.MH_options{num,2} = '0.25'; dynare_gui_.estimation.MH_options{num,2} = '[0.025 0.005 0.95]';
dynare_gui_.estimation.MH_options{num,3} = 'DOUBLE'; dynare_gui_.estimation.MH_options{num,3} = '[DOUBLE DOUBLE DOUBLE]'; %special
dynare_gui_.estimation.MH_options{num,4} = 'Specifies the probability of the next parameter belonging to a new block when the random blocking in the TaRB Metropolis-Hastings algorithm is conducted. The higher this number, the smaller is the average block size and the more random blocks are formed during each parameter sweep. Default: 0.25.'; dynare_gui_.estimation.MH_options{num,4} = 'Sets the quantile of the CDF q that is estimated with precision r with a probability s in the Raftery and Lewis (1992) convergence diagnostics. Default: [0.025 0.005 0.95].';
num = num+1; num = num+1;
dynare_gui_.estimation.MH_options{num,1} = 'tarb_mode_compute'; dynare_gui_.estimation.MH_options{num,1} = 'posterior_sampling_method';
dynare_gui_.estimation.MH_options{num,2} = '4'; dynare_gui_.estimation.MH_options{num,2} = 'random_walk_metropolis_hastings';
dynare_gui_.estimation.MH_options{num,3} = 'INTEGER'; dynare_gui_.estimation.MH_options{num,3} = {'random_walk_metropolis_hastings', 'tailored_random_block_metropolis_hastings', 'independent_metropolis_hastings', 'slice'};
dynare_gui_.estimation.MH_options{num,4} = 'Specifies the mode-finder run in every iteration for every block of the TaRB Metropolis-Hastings algorithm. See [mode compute]. Default: 4.'; dynare_gui_.estimation.MH_options{num,4} = 'Tells Dynare which sampler method should be used to sample from the posterior distribution during Bayesian estimation. The default setting is the standard Random-Walk Metropolis-Hastings. The following alternative methods are available: Tailored randomized block (TaRB) Metropolis-Hastings algorithm proposed by Chib and Ramamurthy (2010), Independent Metropolis-Hastings algorithm where the proposal distribution does not depend on the state of the chain, Slice sampler of Planas, Ratto, and Rossi (2015). (Note that [slice] is incompatible with prior_trunc=0.)';
% There is no field in options_ structure for tarb_optim
% num = num+1;
% dynare_gui_.estimation.MH_options{num,1} = 'tarb_optim';
% dynare_gui_.estimation.MH_options{num,2} = '';
% dynare_gui_.estimation.MH_options{num,3} = 'INTEGER';
% dynare_gui_.estimation.MH_options{num,4} = 'Specifies the options for the mode-finder used in the TaRB Metropolis-Hastings algorithm. See [optim].';
num = num+1;
dynare_gui_.estimation.MH_options{num,1} = 'posterior_sampler_options';
dynare_gui_.estimation.MH_options{num,2} = '';
dynare_gui_.estimation.MH_options{num,3} = '(NAME, VALUE, ...)'; % 'special'
dynare_gui_.estimation.MH_options{num,4} = 'A list of NAME and VALUE pairs. Can be used to set options for the posterior sampling methods. The set of available options depends on the selected samping routine (ie on the value of option [posterior_sampling_method]).';
%% Group 5: filter %% Group 5: filter
num = 1; num = 1;
...@@ -410,6 +428,18 @@ dynare_gui_.estimation.filter{num,2} = '1'; ...@@ -410,6 +428,18 @@ dynare_gui_.estimation.filter{num,2} = '1';
dynare_gui_.estimation.filter{num,3} = 'INTEGER'; 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.'; 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; num = num+1;
dynare_gui_.estimation.filter{num,1} = 'diffuse_filter'; dynare_gui_.estimation.filter{num,1} = 'diffuse_filter';
dynare_gui_.estimation.filter{num,2} = 0; dynare_gui_.estimation.filter{num,2} = 0;
...@@ -435,7 +465,6 @@ dynare_gui_.estimation.filter{num,2} = '1e-16'; ...@@ -435,7 +465,6 @@ dynare_gui_.estimation.filter{num,2} = '1e-16';
dynare_gui_.estimation.filter{num,3} = 'DOUBLE'; 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.'; 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 %% Group 6: postprocessing
num = 1; num = 1;
dynare_gui_.estimation.postprocessing{num,1} = 'bayesian_irf'; dynare_gui_.estimation.postprocessing{num,1} = 'bayesian_irf';
...@@ -463,8 +492,8 @@ dynare_gui_.estimation.postprocessing{num,4} = 'Saves the contemporaneous correl ...@@ -463,8 +492,8 @@ dynare_gui_.estimation.postprocessing{num,4} = 'Saves the contemporaneous correl
num = num+1; num = num+1;
dynare_gui_.estimation.postprocessing{num,1} = 'no_posterior_kernel_density'; dynare_gui_.estimation.postprocessing{num,1} = 'no_posterior_kernel_density';
dynare_gui_.estimation.postprocessing{num,2} = '1'; % no default values in Reference Manual !!! dynare_gui_.estimation.postprocessing{num,2} = 0;
dynare_gui_.estimation.postprocessing{num,3} = 'INTEGER'; %type is check option in Reference Manual !!! dynare_gui_.estimation.postprocessing{num,3} = 'check_option';
dynare_gui_.estimation.postprocessing{num,4} = 'Shuts off the computation of the kernel density estimator for the posterior objects(see [density-field]).'; dynare_gui_.estimation.postprocessing{num,4} = 'Shuts off the computation of the kernel density estimator for the posterior objects(see [density-field]).';
num = num+1; num = num+1;
...@@ -521,26 +550,35 @@ dynare_gui_.estimation.postprocessing{num,2} = '40'; ...@@ -521,26 +550,35 @@ dynare_gui_.estimation.postprocessing{num,2} = '40';
dynare_gui_.estimation.postprocessing{num,3} = 'INTEGER'; 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.'; 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;
% num = num+1; dynare_gui_.estimation.postprocessing{num,1} = 'irf_shocks';
% dynare_gui_.estimation.postprocessing{num,1} = 'irf_shocks'; dynare_gui_.estimation.postprocessing{num,2} = '';
% dynare_gui_.estimation.postprocessing{num,2} = ''; dynare_gui_.estimation.postprocessing{num,3} = '( VARIABLE_NAME [[,] VARIABLE_NAME ...] )'; % special
% 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].';
% 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; num = num+1;
dynare_gui_.estimation.postprocessing{num,1} = 'proposal_approximation'; dynare_gui_.estimation.postprocessing{num,1} = 'proposal_approximation';
dynare_gui_.estimation.postprocessing{num,2} = 'cubature'; dynare_gui_.estimation.postprocessing{num,2} = 'unscented';
dynare_gui_.estimation.postprocessing{num,3} = {'cubature','montecarlo','unscented'}; dynare_gui_.estimation.postprocessing{num,3} = {'unscented','cubature','montecarlo'};
dynare_gui_.estimation.postprocessing{num,4} = 'Sets the method for approximating the proposal distribution. Possible values for OPTION are: cubature, montecarlo and unscented. Default value is cubature.'; dynare_gui_.estimation.postprocessing{num,4} = 'Sets the method for approximating the proposal distribution. Possible values for OPTION are: cubature, montecarlo and unscented. Default value is cubature.';
num = num+1; num = num+1;
dynare_gui_.estimation.postprocessing{num,1} = 'distribution_approximation'; dynare_gui_.estimation.postprocessing{num,1} = 'distribution_approximation';
dynare_gui_.estimation.postprocessing{num,2} = 'cubature'; dynare_gui_.estimation.postprocessing{num,2} = 'unscented';
dynare_gui_.estimation.postprocessing{num,3} = {'cubature','montecarlo','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.'; 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 %% Group 7: Particle filter
num = 1; num = 1;
...@@ -549,35 +587,29 @@ dynare_gui_.estimation.Particle_filter{num,2} = '5000'; %default is 1000 in R ...@@ -549,35 +587,29 @@ dynare_gui_.estimation.Particle_filter{num,2} = '5000'; %default is 1000 in R
dynare_gui_.estimation.Particle_filter{num,3} = 'INTEGER'; dynare_gui_.estimation.Particle_filter{num,3} = 'INTEGER';
dynare_gui_.estimation.Particle_filter{num,4} = 'Number of particles used when evaluating the likelihood of a non linear state space model. Default: 1000.'; dynare_gui_.estimation.Particle_filter{num,4} = 'Number of particles used when evaluating the likelihood of a non linear state space model. Default: 1000.';
num = num+1; num = num+1;
dynare_gui_.estimation.Particle_filter{num,1} = 'resampling'; dynare_gui_.estimation.Particle_filter{num,1} = 'resampling';
dynare_gui_.estimation.Particle_filter{num,2} = ''; %default is systematic ??? dynare_gui_.estimation.Particle_filter{num,2} = 'systematic';
dynare_gui_.estimation.Particle_filter{num,3} = {'','none','systematic','generic'}; dynare_gui_.estimation.Particle_filter{num,3} = {'systematic','none','generic'};
dynare_gui_.estimation.Particle_filter{num,4} = 'Determines if resampling of the particles is done. Possible values for OPTION are: none, systematic and generic.'; dynare_gui_.estimation.Particle_filter{num,4} = 'Determines if resampling of the particles is done. Possible values for OPTION are: none, systematic and generic.';
num = num+1; num = num+1;
dynare_gui_.estimation.Particle_filter{num,1} = 'resampling_threshold'; dynare_gui_.estimation.Particle_filter{num,1} = 'resampling_threshold';
dynare_gui_.estimation.Particle_filter{num,2} = ''; % default is 0.5 ??? dynare_gui_.estimation.Particle_filter{num,2} = ''; % default is 0.5 ???
dynare_gui_.estimation.Particle_filter{num,3} = 'DOUBLE'; dynare_gui_.estimation.Particle_filter{num,3} = 'DOUBLE';
dynare_gui_.estimation.Particle_filter{num,4} = 'A real number between zero and one. The resampling step is triggered as soon as the effective number of particles is less than this number times the total number of particles (as set by [number of particles]). This option is effective if and only if option [resampling] has value generic.'; dynare_gui_.estimation.Particle_filter{num,4} = 'A real number between zero and one. The resampling step is triggered as soon as the effective number of particles is less than this number times the total number of particles (as set by [number of particles]). This option is effective if and only if option [resampling] has value generic.';
num = num+1; num = num+1;
dynare_gui_.estimation.Particle_filter{num,1} = 'resampling_method'; dynare_gui_.estimation.Particle_filter{num,1} = 'resampling_method';
dynare_gui_.estimation.Particle_filter{num,2} = ''; %default is kitagawa??? dynare_gui_.estimation.Particle_filter{num,2} = 'kitagawa';
dynare_gui_.estimation.Particle_filter{num,3} = {'kitagawa','stratified','smooth'}; dynare_gui_.estimation.Particle_filter{num,3} = {'kitagawa','stratified','smooth'};
dynare_gui_.estimation.Particle_filter{num,4} = 'Sets the resampling method. Possible values for OPTION are: kitagawa, stratified and smooth.'; dynare_gui_.estimation.Particle_filter{num,4} = 'Sets the resampling method. Possible values for OPTION are: kitagawa, stratified and smooth.';
num = num+1; num = num+1;
dynare_gui_.estimation.Particle_filter{num,1} = 'filter_algorithm'; dynare_gui_.estimation.Particle_filter{num,1} = 'filter_algorithm';
dynare_gui_.estimation.Particle_filter{num,2} = ''; dynare_gui_.estimation.Particle_filter{num,2} = 'sis';
dynare_gui_.estimation.Particle_filter{num,3} = {'','sis','apf','gf','gmf','cpf'}; dynare_gui_.estimation.Particle_filter{num,3} = {'sis','apf','gf','gmf','cpf', 'nlkf'};
dynare_gui_.estimation.Particle_filter{num,4} = 'Sets the particle filter algorithm. Possible values for OPTION are: sis, apf, gf, gmf and cpf.'; dynare_gui_.estimation.Particle_filter{num,4} = 'Sets the particle filter algorithm. Possible values for OPTION are: sis, apf, gf, gmf, cpf, and nlkf.';
%% Group 8: output %% Group 8: output
...@@ -599,6 +631,12 @@ dynare_gui_.estimation.output{num,2} = 0; ...@@ -599,6 +631,12 @@ dynare_gui_.estimation.output{num,2} = 0;
dynare_gui_.estimation.output{num,3} = 'check_option'; dynare_gui_.estimation.output{num,3} = 'check_option';
dynare_gui_.estimation.output{num,4} = 'Do not display the graphs, but still save them to disk (unless nograph is used).'; dynare_gui_.estimation.output{num,4} = 'Do not display the graphs, but still save them to disk (unless nograph is used).';
num = num+1;
dynare_gui_.estimation.output{num,1} = 'posterior_nograph';
dynare_gui_.estimation.output{num,2} = 0;
dynare_gui_.estimation.output{num,3} = 'check_option';
dynare_gui_.estimation.output{num,4} = 'Suppresses the generation of graphs associated with Bayesian IRFs (bayesian_irf), posterior smoothed objects (smoother), and posterior forecasts (forecast).';
num = num+1; num = num+1;
dynare_gui_.estimation.output{num,1} = 'graph_format'; dynare_gui_.estimation.output{num,1} = 'graph_format';
dynare_gui_.estimation.output{num,2} = 'eps'; dynare_gui_.estimation.output{num,2} = 'eps';
......
...@@ -14,7 +14,7 @@ function dynare_command_options_sensitivity() ...@@ -14,7 +14,7 @@ function dynare_command_options_sensitivity()
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2019 Dynare Team % Copyright (C) 2019-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -44,19 +44,19 @@ dynare_gui_.sensitivity.sampling{num,4} = 'Size of the Monte-Carlo sample.'; % a ...@@ -44,19 +44,19 @@ dynare_gui_.sensitivity.sampling{num,4} = 'Size of the Monte-Carlo sample.'; % a
num = num + 1; num = num + 1;
dynare_gui_.sensitivity.sampling{num,1} = 'ilptau'; dynare_gui_.sensitivity.sampling{num,1} = 'ilptau';
dynare_gui_.sensitivity.sampling{num,2} = 1; dynare_gui_.sensitivity.sampling{num,2} = 1;
dynare_gui_.sensitivity.sampling{num,3} = 'check_option'; dynare_gui_.sensitivity.sampling{num,3} = {'1', '0'};
dynare_gui_.sensitivity.sampling{num,4} = 'If equal to 1 use lptau quasi-Monte-Carlo. Otherwise use LHS Monte-Carlo.'; dynare_gui_.sensitivity.sampling{num,4} = 'If equal to 1 use lptau quasi-Monte-Carlo. Otherwise use LHS Monte-Carlo.';
num = num + 1; num = num + 1;
dynare_gui_.sensitivity.sampling{num,1} = 'pprior'; dynare_gui_.sensitivity.sampling{num,1} = 'pprior';
dynare_gui_.sensitivity.sampling{num,2} = 1; dynare_gui_.sensitivity.sampling{num,2} = 1;
dynare_gui_.sensitivity.sampling{num,3} = 'check_option'; dynare_gui_.sensitivity.sampling{num,3} = {'1', '0'};
dynare_gui_.sensitivity.sampling{num,4} = 'If equal to 1, sample from the prior distributions. If equal to 0, sample from the multivariate normal.'; dynare_gui_.sensitivity.sampling{num,4} = 'If equal to 1, sample from the prior distributions. If equal to 0, sample from the multivariate normal.';
num = num + 1; num = num + 1;
dynare_gui_.sensitivity.sampling{num,1} = 'prior_range'; dynare_gui_.sensitivity.sampling{num,1} = 'prior_range';
dynare_gui_.sensitivity.sampling{num,2} = 1; dynare_gui_.sensitivity.sampling{num,2} = 1;
dynare_gui_.sensitivity.sampling{num,3} = 'check_option'; dynare_gui_.sensitivity.sampling{num,3} = {'1', '0'};
dynare_gui_.sensitivity.sampling{num,4} = 'If equal to 1, sample uniformly from prior ranges. If equal to 0, sample from prior distributions.'; dynare_gui_.sensitivity.sampling{num,4} = 'If equal to 1, sample uniformly from prior ranges. If equal to 0, sample from prior distributions.';
num = num + 1; num = num + 1;
...@@ -92,8 +92,8 @@ dynare_gui_.sensitivity.sampling{num,4} = 'When pprior=0 and ppost=0, allows for ...@@ -92,8 +92,8 @@ dynare_gui_.sensitivity.sampling{num,4} = 'When pprior=0 and ppost=0, allows for
%% Group 2: stability mapping %% Group 2: stability mapping
num = 1; num = 1;
dynare_gui_.sensitivity.stability_mapping{num,1} = 'stab'; 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,3} = {'1', '0'};
dynare_gui_.sensitivity.stability_mapping{num,4} = 'If equal to 1, perform stability mapping. If equal to 0, do not perform stability mapping.'; dynare_gui_.sensitivity.stability_mapping{num,4} = 'If equal to 1, perform stability mapping. If equal to 0, do not perform stability mapping.';
num = num + 1; num = num + 1;
......
...@@ -68,6 +68,12 @@ dynare_gui_.simul.solver{num,2} = '1e-5'; ...@@ -68,6 +68,12 @@ dynare_gui_.simul.solver{num,2} = '1e-5';
dynare_gui_.simul.solver{num,3} = 'DOUBLE'; dynare_gui_.simul.solver{num,3} = 'DOUBLE';
dynare_gui_.simul.solver{num,4} = 'Convergence criterion for termination based on change in function argument'; 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; num = num+1;
dynare_gui_.simul.solver{num,1} = 'stack_solve_algo'; dynare_gui_.simul.solver{num,1} = 'stack_solve_algo';
dynare_gui_.simul.solver{num,2} = '0'; dynare_gui_.simul.solver{num,2} = '0';
......
...@@ -14,7 +14,7 @@ function dynare_command_options_stoch_simul() ...@@ -14,7 +14,7 @@ function dynare_command_options_stoch_simul()
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2018 Dynare Team % Copyright (C) 2003-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -85,11 +85,11 @@ dynare_gui_.stoch_simul.irf{num,2} = '1e-10'; ...@@ -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,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.'; 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; num = num+1;
% dynare_gui_.stoch_simul.irf{num,1} = 'irf_shocks'; dynare_gui_.stoch_simul.irf{num,1} = 'irf_shocks';
% dynare_gui_.stoch_simul.irf{num,2} = ''; dynare_gui_.stoch_simul.irf{num,2} = '';
% dynare_gui_.stoch_simul.irf{num,3} = 'list'; 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.'; dynare_gui_.stoch_simul.irf{num,4} = 'The exogenous variables for which to compute IRFs. Default: all.';
num = num+1; num = num+1;
dynare_gui_.stoch_simul.irf{num,1} = 'relative_irf'; dynare_gui_.stoch_simul.irf{num,1} = 'relative_irf';
...@@ -236,6 +236,12 @@ dynare_gui_.stoch_simul.filter{num,2} = '[6,32]'; ...@@ -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,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].'; 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 %% Group 6: Output
num = 1; num = 1;
......
...@@ -12,7 +12,7 @@ function status = set_command_option(name, value) ...@@ -12,7 +12,7 @@ function status = set_command_option(name, value)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2018 Dynare Team % Copyright (C) 2003-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -48,32 +48,33 @@ try ...@@ -48,32 +48,33 @@ try
options_.lyapunov_db = 0; options_.lyapunov_db = 0;
options_.lyapunov_srs = 0; options_.lyapunov_srs = 0;
if strcmp(value, 'fixed_point') if value == 3 % fixed_point
options_.lyapunov_fp = 1; options_.lyapunov_fp = 1;
elseif strcmp(value, 'doubling') elseif value == 4 %doubling
options_.lyapunov_db = 1; options_.lyapunov_db = 1;
elseif strcmp(value, 'square_root_solver') elseif value == 5 %square_root_solver
options_.lyapunov_srs = 1; options_.lyapunov_srs = 1;
end end
case 'sylvester' case 'sylvester'
if strcmp(value, 'default')
options_.sylvester_fp = 0; options_.sylvester_fp = 0;
else
if value == 2 %fixed_point
options_.sylvester_fp = 1; options_.sylvester_fp = 1;
end end
case 'dr' case 'dr'
options_.dr_cycle_reduction = 0; options_.dr_cycle_reduction = 0;
options_.dr_logarithmic_reduction = 0; options_.dr_logarithmic_reduction = 0;
if strcmp(value, 'cycle_reduction') if value == 2
options_.dr_cycle_reduction = 1; options_.dr_cycle_reduction = 1;
elseif strcmp(value, 'logarithmic_reduction') elseif value == 3
options_.dr_logarithmic_reduction = 1; options_.dr_logarithmic_reduction = 1;
end end
case 'first_obs' case 'first_obs'
options_.first_obs = value; options_.first_obs = str2num(value);
case 'use_bandpass_filter' case 'use_bandpass_filter'
options_.bandpass.indicator = value; options_.bandpass.indicator = value;
...@@ -90,11 +91,130 @@ try ...@@ -90,11 +91,130 @@ try
case 'consider_only_observed' case 'consider_only_observed'
return; return;
case 'mode_compute'
if ~isempty(str2num(value))
options_.mode_compute = str2num(value);
else
options_.mode_compute = value;
end
case 'filter_step_ahead' case 'filter_step_ahead'
options_.filter_step_ahead = eval(value); options_.filter_step_ahead = str2num(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
case 'mh_recover'
options_.mh_recover = logical(value);
case 'raftery_lewis_diagnostics'
options_.convergence.rafterylewis.indicator = logical(value);
case 'raftery_lewis_qrs'
options_.convergence.rafterylewis.qrs = str2num(value);
case 'posterior_sampling_method'
if value == 2
options_.posterior_sampler_options.posterior_sampling_method = 'tailored_random_block_metropolis_hastings';
elseif value == 3
options_.posterior_sampler_options.posterior_sampling_method = 'independent_metropolis_hastings';
elseif value == 4
options_.posterior_sampler_options.posterior_sampling_method = 'slice';
end
case 'posterior_sampler_options'
options_.posterior_sampler_options.sampling_opt = value;
case 'optim'
options_.optim_opt = value;
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
case 'filter_algorithm'
if value == 2
options_.particle.filter_algorithm = 'apf';
elseif value == 3
options_.particle.filter_algorithm = 'gf';
elseif value == 4
options_.particle.filter_algorithm = 'gmf';
elseif value == 5
options_.particle.filter_algorithm = 'cpf';
elseif value == 6
options_.particle.filter_algorithm = 'nlkf';
end
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 otherwise
options_.(gui_auxiliary.command_option_mapping(name)) = value; if isnumeric(value)
eval(['options_.' gui_auxiliary.command_option_mapping(name) '=' num2str(value) ';']);
else
eval_expr = sprintf("options_.%s='%s';", gui_auxiliary.command_option_mapping(name), value);
eval(eval_expr);
end
end end
catch catch
status = 0; status = 0;
......
...@@ -34,17 +34,7 @@ function [newTab, created] = add_tab(hObject, title) ...@@ -34,17 +34,7 @@ function [newTab, created] = add_tab(hObject, title)
handles = guidata(hObject); handles = guidata(hObject);
if isfield(handles, 'tabGroup') == 0 if isfield(handles, 'tabGroup') == 0
handles = createTabGroup(handles, hObject);
hTabGroup = uitabgroup(handles.figure1,'Position',[0 0 1 1]); %, 'SelectionChangeFcn', {@selection_tab_changed});
panel = handles.uipanel_welcome;
set(panel,'Visible','off');
drawnow;
handles.tabGroup = hTabGroup;
setappdata(0,'tabGroup', hTabGroup);
% Update handles structure
guidata(hObject, handles);
end end
created = 1; created = 1;
...@@ -55,10 +45,11 @@ tab = checkIfExistsTab(tabGroup, title); ...@@ -55,10 +45,11 @@ tab = checkIfExistsTab(tabGroup, title);
if ~isempty(tab) if ~isempty(tab)
% close existing tab so that it'll be redrawn % close existing tab so that it'll be redrawn
gui_tabs.delete_tab(tab); gui_tabs.delete_tab(tab);
% set(handles.tabGroup, 'SelectedTab' , tab); tabGroup = getappdata(0, 'tabGroup');
% newTab = tab; if isempty(tabGroup)
% created = 0; handles = createTabGroup(handles, hObject);
% return; tabGroup = getappdata(0, 'tabGroup');
end
end end
newTab = uitab(handles.tabGroup, 'Title', title); newTab = uitab(handles.tabGroup, 'Title', title);
...@@ -80,3 +71,16 @@ setappdata(0, 'tabGroup', tabGroup); ...@@ -80,3 +71,16 @@ setappdata(0, 'tabGroup', tabGroup);
end end
end end
end end
function handles = createTabGroup(handles, hObject)
hTabGroup = uitabgroup(handles.figure1,'Position',[0 0 1 1]); %, 'SelectionChangeFcn', {@selection_tab_changed});
panel = handles.uipanel_welcome;
set(panel,'Visible','off');
drawnow;
handles.tabGroup = hTabGroup;
setappdata(0,'tabGroup', hTabGroup);
% Update handles structure
guidata(hObject, handles);
end
\ No newline at end of file
...@@ -14,7 +14,7 @@ function new_handles = create_endo_vars(handles, command) ...@@ -14,7 +14,7 @@ function new_handles = create_endo_vars(handles, command)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2019 Dynare Team % Copyright (C) 2019-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -36,7 +36,6 @@ global model_settings oo_ ys0_ ...@@ -36,7 +36,6 @@ global model_settings oo_ ys0_
handles.varsTabGroup = uitabgroup(handles.uipanelVars, 'Position', [0 0 1 1]); handles.varsTabGroup = uitabgroup(handles.uipanelVars, 'Position', [0 0 1 1]);
varidxs = find([model_settings.variables{:, 4}]); varidxs = find([model_settings.variables{:, 4}]);
nvars = length(varidxs);
column_names = {'Active', 'Name'}; column_names = {'Active', 'Name'};
switch command switch command
case 'perfect_foresight' case 'perfect_foresight'
...@@ -47,7 +46,9 @@ switch command ...@@ -47,7 +46,9 @@ switch command
column_names = {'Active', 'Name', 'Long Name'}; column_names = {'Active', 'Name', 'Long Name'};
case 'forecast' case 'forecast'
column_names = {'Active', 'Name', 'Initial Condition', 'New Value'}; column_names = {'Active', 'Name', 'Initial Condition', 'New Value'};
varidxs = 1:size(model_settings.variables,1);
end end
nvars = length(varidxs);
editable = true(1, size(column_names, 2)); editable = true(1, size(column_names, 2));
editable(2) = false; editable(2) = false;
data = cell(nvars, size(column_names, 2)); data = cell(nvars, size(column_names, 2));
......
...@@ -32,7 +32,7 @@ tabs = get(tabGroup,'Children'); ...@@ -32,7 +32,7 @@ tabs = get(tabGroup,'Children');
% Get handles structure % Get handles structure
handles = guidata(hTab); handles = guidata(hTab);
if(size(tabs,1)==1) if size(tabs,1) == 1
delete(tabGroup); delete(tabGroup);
rmappdata(0,'tabGroup'); rmappdata(0,'tabGroup');
handles = rmfield(handles, 'tabGroup'); handles = rmfield(handles, 'tabGroup');
......
...@@ -13,7 +13,7 @@ function comm_str = command_string(comm_name, comm) ...@@ -13,7 +13,7 @@ function comm_str = command_string(comm_name, comm)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2019 Dynare Team % Copyright (C) 2003-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -33,7 +33,7 @@ function comm_str = command_string(comm_name, comm) ...@@ -33,7 +33,7 @@ function comm_str = command_string(comm_name, comm)
global project_info global project_info
if strcmp(comm_name, 'dynare') if strcmp(comm_name, 'dynare')
comm_str = [comm_name ' ' project_info.mod_file ' onlymodel ']; comm_str = [comm_name ' ' project_info.mod_file ' gui -DGUI '];
if project_info.project_model_stochastic if project_info.project_model_stochastic
comm_str = [comm_str 'stochastic ']; comm_str = [comm_str 'stochastic '];
end end
......
...@@ -12,7 +12,7 @@ function menu_options(oid, status) ...@@ -12,7 +12,7 @@ function menu_options(oid, status)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2019 Dynare Team % Copyright (C) 2003-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -29,7 +29,7 @@ function menu_options(oid, status) ...@@ -29,7 +29,7 @@ function menu_options(oid, status)
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % 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')); handles = guihandles(getappdata(0,'main_figure'));
...@@ -56,6 +56,9 @@ switch oid ...@@ -56,6 +56,9 @@ switch oid
handles.estimation_parameters_shocks.Enable = status; handles.estimation_parameters_shocks.Enable = status;
handles.estimation_run_calibrated_smoother.Enable = status; handles.estimation_run_calibrated_smoother.Enable = status;
handles.estimation_run.Enable = status; handles.estimation_run.Enable = status;
if project_info.estimation_run
handles.estimation_run_smoother2histval.Enable = status;
end
case 'stochastic' case 'stochastic'
handles.model_export.Enable = status; handles.model_export.Enable = status;
...@@ -68,6 +71,8 @@ switch oid ...@@ -68,6 +71,8 @@ switch oid
case 'sensitivity' case 'sensitivity'
handles.model_export.Enable = status; handles.model_export.Enable = status;
handles.sensitivity_analysis.Enable = status; handles.sensitivity_analysis.Enable = status;
handles.irf_calibration.Enable = status;
handles.moment_calibration.Enable = status;
case 'output' case 'output'
if strcmpi(status, 'off') if strcmpi(status, 'off')
...@@ -105,6 +110,9 @@ switch oid ...@@ -105,6 +110,9 @@ switch oid
case 'epilogue' case 'epilogue'
handles.post_processing_epilogue.Enable = status; handles.post_processing_epilogue.Enable = status;
case 'posterior'
handles.post_processing_posterior.Enable = status;
otherwise otherwise
error(['menu option: ' oid ' not handled']); error(['menu option: ' oid ' not handled']);
end end
......
This diff is collapsed.
...@@ -183,6 +183,23 @@ handles.pushbuttonCloseAll = uicontrol( ... ...@@ -183,6 +183,23 @@ handles.pushbuttonCloseAll = uicontrol( ...
'HorizontalAlignment', 'left',... 'HorizontalAlignment', 'left',...
'Callback', {@checkCommOption_Callback,'filter_step_ahead'}); '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; num = num+1;
uicontrol( ... uicontrol( ...
'Parent', handles.uipanelResults, ... 'Parent', handles.uipanelResults, ...
...@@ -203,6 +220,122 @@ handles.pushbuttonCloseAll = uicontrol( ... ...@@ -203,6 +220,122 @@ handles.pushbuttonCloseAll = uicontrol( ...
model_settings.calib_smoother.parameter_set = 'calibration'; 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; num = num+2;
uicontrol( ... uicontrol( ...
'Parent', handles.uipanelResults, ... 'Parent', handles.uipanelResults, ...
...@@ -242,6 +375,8 @@ handles.pushbuttonCloseAll = uicontrol( ... ...@@ -242,6 +375,8 @@ handles.pushbuttonCloseAll = uicontrol( ...
end end
switch option_name switch option_name
case 'filtered_vars'
comm_options.filtered_vars = value;
case 'filter_step_ahead' case 'filter_step_ahead'
if ~isempty(value) if ~isempty(value)
num_value = str2num(value); num_value = str2num(value);
...@@ -261,8 +396,24 @@ handles.pushbuttonCloseAll = uicontrol( ... ...@@ -261,8 +396,24 @@ handles.pushbuttonCloseAll = uicontrol( ...
comm_options = rmfield(comm_options,'filter_step_ahead'); comm_options = rmfield(comm_options,'filter_step_ahead');
end end
end end
case 'filtered_vars' case 'prefilter'
comm_options.filtered_vars = value; 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' case 'select_all_vars'
if value if value
handles.consider_only_observed.Value = false; handles.consider_only_observed.Value = false;
...@@ -273,8 +424,6 @@ handles.pushbuttonCloseAll = uicontrol( ... ...@@ -273,8 +424,6 @@ handles.pushbuttonCloseAll = uicontrol( ...
handles.select_all_vars.Value = false; handles.select_all_vars.Value = false;
end end
select_only_observed(value); select_only_observed(value);
case 'parameter_set'
comm_options.parameter_set = hObject.String{value};
end end
comm_str = gui_tools.command_string('calib_smoother', comm_options); comm_str = gui_tools.command_string('calib_smoother', comm_options);
handles.calib_smoother.String = comm_str; handles.calib_smoother.String = comm_str;
...@@ -354,7 +503,15 @@ handles.pushbuttonCloseAll = uicontrol( ... ...@@ -354,7 +503,15 @@ handles.pushbuttonCloseAll = uicontrol( ...
handles.endoTable.Data(:,1) = {false}; handles.endoTable.Data(:,1) = {false};
handles.filtered_vars.Value = 0; handles.filtered_vars.Value = 0;
handles.filter_step_ahead.String = ''; handles.filter_step_ahead.String = '';
handles.prefilter.Value = 0;
handles.parameter_set.Value = 1; 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.select_all_vars.Value =0;
handles.consider_only_observed.Value = 0; handles.consider_only_observed.Value = 0;
model_settings.calib_smoother = struct(); model_settings.calib_smoother = struct();
......
function gui_close_project() function gui_close_project(clear_dynare_vars)
% function gui_close_project() % function gui_close_project()
% closes current project Dynare_GUI project file % closes current project Dynare_GUI project file
% %
...@@ -11,7 +11,7 @@ function gui_close_project() ...@@ -11,7 +11,7 @@ function gui_close_project()
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2019 Dynare Team % Copyright (C) 2003-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -28,7 +28,7 @@ function gui_close_project() ...@@ -28,7 +28,7 @@ function gui_close_project()
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global project_info model_settings global project_info
gui_tools.project_log_entry('Project Close', ['project_name = ' project_info.project_name '; project_folder=' project_info.project_folder]) gui_tools.project_log_entry('Project Close', ['project_name = ' project_info.project_name '; project_folder=' project_info.project_folder])
...@@ -47,10 +47,11 @@ gui_tabs.close_all(); ...@@ -47,10 +47,11 @@ gui_tabs.close_all();
%disable menu options %disable menu options
gui_set_menus(false); gui_set_menus(false);
clearvars -global evalin('base', 'clear project_info model_settings');
evalin('global', 'clear M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_'); if clear_dynare_vars
evalin('global', 'clear project_info model_settings'); evalin('base', 'clear M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_');
clear_persistent_variables(fileparts(which('dynare')), true) clear_persistent_variables(fileparts(which('dynare')), true)
end
% remove appdata % remove appdata
if isappdata(0, 'estimation') if isappdata(0, 'estimation')
......
function gui_cond_forecast_preliminary(tabId, hObject) function gui_cond_forecast_preliminary(tabId, hObject, handles)
% function gui_cond_forecast(tabId) % function gui_cond_forecast(tabId)
% interface for the DYNARE imcforecast command % interface for the DYNARE imcforecast command
% %
......
...@@ -11,7 +11,7 @@ function status = gui_create_model_settings() ...@@ -11,7 +11,7 @@ function status = gui_create_model_settings()
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2019 Dynare Team % Copyright (C) 2003-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -28,8 +28,7 @@ function status = gui_create_model_settings() ...@@ -28,8 +28,7 @@ function status = gui_create_model_settings()
% You should have received a copy of the GNU General Public License % You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>. % along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global M_ ex0_ oo_ global M_ ex0_ oo_ project_info model_settings
global project_info model_settings
model_settings = struct(); model_settings = struct();
...@@ -90,9 +89,9 @@ setappdata(0, 'model_settings', model_settings); ...@@ -90,9 +89,9 @@ setappdata(0, 'model_settings', model_settings);
function create_shocks_cell_array() function create_shocks_cell_array()
if project_info.project_model_stochastic if project_info.project_model_stochastic
model_settings.shocks = cell(M_.exo_nbr, 10);
else
model_settings.shocks = cell(M_.exo_nbr, 8); model_settings.shocks = cell(M_.exo_nbr, 8);
else
model_settings.shocks = cell(M_.exo_nbr, 6);
end end
model_settings.shocks(:, 1) = M_.exo_names; model_settings.shocks(:, 1) = M_.exo_names;
model_settings.shocks(:, 2) = M_.exo_names_tex; model_settings.shocks(:, 2) = M_.exo_names_tex;
...@@ -105,7 +104,6 @@ setappdata(0, 'model_settings', model_settings); ...@@ -105,7 +104,6 @@ setappdata(0, 'model_settings', model_settings);
model_settings.shocks(:, 6) = {''}; % STD model_settings.shocks(:, 6) = {''}; % STD
col = 7; col = 7;
else else
%TODO: check with Dynare team - how to display initval for deterministic case
if ~isempty(ex0_) if ~isempty(ex0_)
model_settings.shocks(:, 4) = num2cell(ex0_); model_settings.shocks(:, 4) = num2cell(ex0_);
else else
...@@ -113,9 +111,20 @@ setappdata(0, 'model_settings', model_settings); ...@@ -113,9 +111,20 @@ setappdata(0, 'model_settings', model_settings);
end end
col = 5; col = 5;
end end
model_settings.shocks(:, col) = {true};
model_settings.shocks(:, col+1) = {'All'}; if isfield(M_, 'shock_groups')
model_settings.shocks(:, col+2) = {true}; fn = fieldnames(M_.shock_groups);
model_settings.shocks(:, col+3) = {''}; for i = 1:length(fn)
gn = fieldnames(M_.shock_groups.(fn{i}));
for j = 1:length(gn)
sn = M_.shock_groups.(fn{i}).(gn{j}).shocks;
for k = 1:length(sn)
idx = find(strcmp(model_settings.shocks(:,1), sn{k}));
model_settings.shocks{idx, col} = fn{i};
model_settings.shocks{idx, col+1} = M_.shock_groups.(fn{i}).(gn{j}).label;
end
end
end
end
end end
end end
...@@ -13,7 +13,7 @@ function fHandle= gui_define_comm_options(comm, comm_name) ...@@ -13,7 +13,7 @@ function fHandle= gui_define_comm_options(comm, comm_name)
% SPECIAL REQUIREMENTS % SPECIAL REQUIREMENTS
% none % none
% Copyright (C) 2003-2019 Dynare Team % Copyright (C) 2003-2020 Dynare Team
% %
% This file is part of Dynare. % This file is part of Dynare.
% %
...@@ -186,16 +186,18 @@ handles.pushbuttonReset = uicontrol( ... ...@@ -186,16 +186,18 @@ handles.pushbuttonReset = uicontrol( ...
'HorizontalAlignment', 'left',... 'HorizontalAlignment', 'left',...
'Visible', visible); 'Visible', visible);
elseif strcmp(option_type, 'popupmenu') elseif strcmp(option_type, 'popupmenu')
tab_handles.values(ii) = uicontrol( ... % commented in commit after a290b22 because `popupOptions`
'Parent', tabs_panel, ... % variable does not exist
'Style', 'popupmenu', ... % tab_handles.values(ii) = uicontrol( ...
'String', popupOptions, ... % 'Parent', tabs_panel, ...
'Units', 'characters', 'BackgroundColor', special_color,... % 'Style', 'popupmenu', ...
'Position', [h_space*2+width_name new_top-ii*2 width_value 1.5], ... % 'String', popupOptions, ...
'TooltipString', option_type,... % 'Units', 'characters', 'BackgroundColor', special_color,...
'Value', 1, ... % 'Position', [h_space*2+width_name new_top-ii*2 width_value 1.5], ...
'HorizontalAlignment', 'left',... % 'TooltipString', option_type,...
'Visible', visible); % 'Value', 1, ...
% 'HorizontalAlignment', 'left',...
% 'Visible', visible);
elseif iscell(option_type) elseif iscell(option_type)
tab_handles.values(ii) = uicontrol('Parent', tabs_panel, ... tab_handles.values(ii) = uicontrol('Parent', tabs_panel, ...
'Style', 'popup',... 'Style', 'popup',...
...@@ -234,12 +236,14 @@ handles.pushbuttonReset = uicontrol( ... ...@@ -234,12 +236,14 @@ handles.pushbuttonReset = uicontrol( ...
tab_handles.values(ii).String = num2str(user_defined_options.(group{ii,1}), 15); tab_handles.values(ii).String = num2str(user_defined_options.(group{ii,1}), 15);
elseif strcmp(option_type, '[INTEGER1:INTEGER2]') ... elseif strcmp(option_type, '[INTEGER1:INTEGER2]') ...
|| strcmp(option_type, 'INTEGER or [INTEGER1:INTEGER2]') ... || strcmp(option_type, 'INTEGER or [INTEGER1:INTEGER2]') ...
|| strcmp(option_type, '[DOUBLE DOUBLE') || strcmp(option_type, '[DOUBLE DOUBLE]') ...
tab_handles.values(ii).Value = str2num(user_defined_options.(group{ii,1})); || strcmp(option_type, '[DOUBLE 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}); tab_handles.values(ii).String = user_defined_options.(group{ii,1});
elseif strcmp(option_type, 'eps, pdf, fig, none') ... elseif strcmp(option_type, 'eps, pdf, fig, none') ...
|| strcmp(option_type, 'FILENAME') ... || 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}); tab_handles.values(ii).String = user_defined_options.(group{ii,1});
end end
elseif iscell(option_type) elseif iscell(option_type)
...@@ -251,7 +255,7 @@ handles.pushbuttonReset = uicontrol( ... ...@@ -251,7 +255,7 @@ handles.pushbuttonReset = uicontrol( ...
defaultString = group{ii,2}; defaultString = group{ii,2};
if strcmp(option_type, 'popupmenu') if strcmp(option_type, 'popupmenu')
defaultString = popupOptions{userDefaultValue}; %defaultString = popupOptions{userDefaultValue};
end end
if ~ischar(defaultString) && isnumeric(defaultString) if ~ischar(defaultString) && isnumeric(defaultString)
defaultString = num2str(defaultString); defaultString = num2str(defaultString);
...@@ -319,6 +323,8 @@ handles.pushbuttonReset = uicontrol( ... ...@@ -319,6 +323,8 @@ handles.pushbuttonReset = uicontrol( ...
file_types = {'*.m';'*.mat';'*.xls';'*.xlsx';'*.csv'}; file_types = {'*.m';'*.mat';'*.xls';'*.xlsx';'*.csv'};
case 'mode_file' case 'mode_file'
file_types = {'*.mat'}; file_types = {'*.mat'};
case 'mcmc_jumping_covariance_file'
file_types = {'*.mat'};
end end
[fileName,pathName] = uigetfile(file_types,sprintf('Select %s ...', option_name)); [fileName,pathName] = uigetfile(file_types,sprintf('Select %s ...', option_name));
...@@ -347,7 +353,7 @@ handles.pushbuttonReset = uicontrol( ... ...@@ -347,7 +353,7 @@ handles.pushbuttonReset = uicontrol( ...
return return
end end
switch option_type switch option_type
case {'INTEGER', 'INTEGER or [INTEGER1:INTEGER2]','[INTEGER1:INTEGER2]', 'DOUBLE', '[DOUBLE DOUBLE]', '[INTEGER1 INTEGER2 ...]', ... case {'INTEGER', 'INTEGER or [INTEGER1:INTEGER2]','[INTEGER1:INTEGER2]', 'DOUBLE', '[DOUBLE DOUBLE]', '[DOUBLE DOUBLE DOUBLE]', '[INTEGER1 INTEGER2 ...]', ...
'INTEGER or [INTEGER1:INTEGER2] or [INTEGER1 INTEGER2 ...]', '[INTEGER1:INTEGER2] or [INTEGER1 INTEGER2 ...]'} 'INTEGER or [INTEGER1:INTEGER2] or [INTEGER1 INTEGER2 ...]', '[INTEGER1:INTEGER2] or [INTEGER1 INTEGER2 ...]'}
[num, status] = str2num(value); [num, status] = str2num(value);
if strcmp(option_type,'[DOUBLE DOUBLE]') if strcmp(option_type,'[DOUBLE DOUBLE]')
...@@ -355,6 +361,11 @@ handles.pushbuttonReset = uicontrol( ... ...@@ -355,6 +361,11 @@ handles.pushbuttonReset = uicontrol( ...
status = 0; status = 0;
end end
end end
if strcmp(option_type,'[DOUBLE DOUBLE DOUBLE]')
if(size(num,1)~= 1 || size(num,2)~= 3)
status = 0;
end
end
if strcmp(option_type,'[INTEGER1 INTEGER2 ...]') if strcmp(option_type,'[INTEGER1 INTEGER2 ...]')
if(size(num,1)~= 1 || size(num,2) < 2) if(size(num,1)~= 1 || size(num,2) < 2)
status = 0; status = 0;
......