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

Target

Select target project
  • Dynare/matlab-gui
  • DoraK/matlab-gui
  • rattoma/matlab-gui
3 results
Select Git revision
Show changes
Commits on Source (75)
Showing
with 953 additions and 373 deletions
......@@ -23,3 +23,6 @@ checksum
*.dproj
examples/**/*
gemc-dynare4.6/*
old_gemc-dynare4.6/*
......@@ -12,7 +12,7 @@ function mapping = command_option_mapping(name)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-2018 Dynare Team
% Copyright (C) 2003-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -65,12 +65,15 @@ switch name
case 'mode_check_number_of_points'
mapping = 'mode_check.number_of_points';
case 'optim'
mapping = 'optim_opt';
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';
......@@ -80,39 +83,18 @@ switch name
case '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'
mapping = 'estimation.moments_posterior_density.indicator';
case 'proposal_approximation'
mapping = 'particle.proposal_approximation';
case 'distribution_approximation'
mapping = 'particle.distribution_approximation';
case 'nonlinear_filter_initialization'
mapping = 'nonlinear_filter';
case 'number_of_particles'
mapping = 'particle.number_of_particles';
case 'resampling'
mapping = 'particle.resampling.status';
case 'resampling_threshold'
mapping = 'particle.resampling.threshold';
case 'resampling_method'
mapping = 'particle.resampling.method';
case 'filter_algorithm'
mapping = 'particle.filter_algorithm';
case 'tex'
mapping = 'TeX';
......
......@@ -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.
%
......
......@@ -14,7 +14,7 @@ function dynare_command_options_dynare()
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-2019 Dynare Team
% Copyright (C) 2003-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -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 ' ...
'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;
dynare_gui_.dynare.setup{num,1} = 'compute_xrefs';
dynare_gui_.dynare.setup{num,2} = 0;
......
......@@ -14,7 +14,7 @@ function dynare_command_options_estimation()
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-2019 Dynare Team
% Copyright (C) 2003-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -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;
......@@ -242,6 +242,18 @@ dynare_gui_.estimation.solver{num,4} = 'Value used to test if a generalized eige
%% Group 4: MH_options
num = 1;
dynare_gui_.estimation.MH_options{num,1} = 'mcmc_jumping_covariance';
dynare_gui_.estimation.MH_options{num,2} = 'hessian';
dynare_gui_.estimation.MH_options{num,3} = {'hessian','prior_variance','identity_matrix','FILENAME'}; %special
dynare_gui_.estimation.MH_options{num,4} = 'Tells Dynare which covariance to use for the proposal density of the MCMC sampler. mcmc_jumping_covariance can be one of the following: hessian,prior_variance,identity_matrix or FILENAME. Default value is hessian.';
num = num+1;
dynare_gui_.estimation.MH_options{num,1} = 'mcmc_jumping_covariance_file';
dynare_gui_.estimation.MH_options{num,2} = '';
dynare_gui_.estimation.MH_options{num,3} = 'FILENAME';
dynare_gui_.estimation.MH_options{num,4} = 'Tells Dynare which file with a jumping covariance matrix to use. Stored in a .mat file. Should be specified if mcmc_jumping_covariance=FILENAME';
num = num+1;
dynare_gui_.estimation.MH_options{num,1} = 'mh_conf_sig';
dynare_gui_.estimation.MH_options{num,2} = '0.9';
dynare_gui_.estimation.MH_options{num,3} = 'DOUBLE';
......@@ -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,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;
......@@ -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.';
num = num+1;
dynare_gui_.estimation.MH_options{num,1} = 'mcmc_jumping_covariance';
dynare_gui_.estimation.MH_options{num,2} = 'hessian';
dynare_gui_.estimation.MH_options{num,3} = {'hessian','prior_variance','identity_matrix','FILENAME'}; %special
dynare_gui_.estimation.MH_options{num,4} = 'Tells Dynare which covariance to use for the proposal density of the MCMC sampler. mcmc_jumping_covariance can be one of the following: hessian,prior_variance,identity_matrix or FILENAME. Default value is hessian.';
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';
......@@ -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].';
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,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;
dynare_gui_.estimation.MH_options{num,1} = 'tarb_new_block_probability';
dynare_gui_.estimation.MH_options{num,2} = '0.25';
dynare_gui_.estimation.MH_options{num,3} = 'DOUBLE';
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,1} = 'raftery_lewis_qrs';
dynare_gui_.estimation.MH_options{num,2} = '[0.025 0.005 0.95]';
dynare_gui_.estimation.MH_options{num,3} = '[DOUBLE DOUBLE DOUBLE]'; %special
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;
dynare_gui_.estimation.MH_options{num,1} = 'tarb_mode_compute';
dynare_gui_.estimation.MH_options{num,2} = '4';
dynare_gui_.estimation.MH_options{num,3} = 'INTEGER';
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.';
% 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].';
dynare_gui_.estimation.MH_options{num,1} = 'posterior_sampling_method';
dynare_gui_.estimation.MH_options{num,2} = 'random_walk_metropolis_hastings';
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} = '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.)';
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
num = 1;
......@@ -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';
......@@ -463,8 +492,8 @@ dynare_gui_.estimation.postprocessing{num,4} = 'Saves the contemporaneous correl
num = num+1;
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,3} = 'INTEGER'; %type is check option in Reference Manual !!!
dynare_gui_.estimation.postprocessing{num,2} = 0;
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]).';
num = num+1;
......@@ -521,26 +550,35 @@ 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';
dynare_gui_.estimation.postprocessing{num,2} = 'cubature';
dynare_gui_.estimation.postprocessing{num,3} = {'cubature','montecarlo','unscented'};
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 proposal distribution. Possible values for OPTION are: cubature, montecarlo and unscented. Default value is cubature.';
num = num+1;
dynare_gui_.estimation.postprocessing{num,1} = 'distribution_approximation';
dynare_gui_.estimation.postprocessing{num,2} = 'cubature';
dynare_gui_.estimation.postprocessing{num,3} = {'cubature','montecarlo','unscented'};
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;
......@@ -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,4} = 'Number of particles used when evaluating the likelihood of a non linear state space model. Default: 1000.';
num = num+1;
dynare_gui_.estimation.Particle_filter{num,1} = 'resampling';
dynare_gui_.estimation.Particle_filter{num,2} = ''; %default is systematic ???
dynare_gui_.estimation.Particle_filter{num,3} = {'','none','systematic','generic'};
dynare_gui_.estimation.Particle_filter{num,2} = 'systematic';
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.';
num = num+1;
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,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.';
num = num+1;
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,4} = 'Sets the resampling method. Possible values for OPTION are: kitagawa, stratified and smooth.';
num = num+1;
dynare_gui_.estimation.Particle_filter{num,1} = 'filter_algorithm';
dynare_gui_.estimation.Particle_filter{num,2} = '';
dynare_gui_.estimation.Particle_filter{num,3} = {'','sis','apf','gf','gmf','cpf'};
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,2} = 'sis';
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, cpf, and nlkf.';
%% Group 8: output
......@@ -599,6 +631,12 @@ dynare_gui_.estimation.output{num,2} = 0;
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).';
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;
dynare_gui_.estimation.output{num,1} = 'graph_format';
dynare_gui_.estimation.output{num,2} = 'eps';
......
......@@ -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.
%
......@@ -44,19 +44,19 @@ dynare_gui_.sensitivity.sampling{num,4} = 'Size of the Monte-Carlo sample.'; % a
num = num + 1;
dynare_gui_.sensitivity.sampling{num,1} = 'ilptau';
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.';
num = num + 1;
dynare_gui_.sensitivity.sampling{num,1} = 'pprior';
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.';
num = num + 1;
dynare_gui_.sensitivity.sampling{num,1} = 'prior_range';
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.';
num = num + 1;
......@@ -92,8 +92,8 @@ 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,3} = 'check_option';
dynare_gui_.sensitivity.stability_mapping{num,2} = 1;
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.';
num = num + 1;
......
......@@ -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';
......
......@@ -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;
......
......@@ -12,7 +12,7 @@ function status = set_command_option(name, value)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-2018 Dynare Team
% Copyright (C) 2003-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -48,32 +48,33 @@ try
options_.lyapunov_db = 0;
options_.lyapunov_srs = 0;
if strcmp(value, 'fixed_point')
if value == 3 % fixed_point
options_.lyapunov_fp = 1;
elseif strcmp(value, 'doubling')
elseif value == 4 %doubling
options_.lyapunov_db = 1;
elseif strcmp(value, 'square_root_solver')
elseif value == 5 %square_root_solver
options_.lyapunov_srs = 1;
end
case 'sylvester'
if strcmp(value, 'default')
options_.sylvester_fp = 0;
else
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
case 'first_obs'
options_.first_obs = value;
options_.first_obs = str2num(value);
case 'use_bandpass_filter'
options_.bandpass.indicator = value;
......@@ -90,11 +91,130 @@ try
case 'consider_only_observed'
return;
case 'mode_compute'
if ~isempty(str2num(value))
options_.mode_compute = str2num(value);
else
options_.mode_compute = value;
end
case 'filter_step_ahead'
options_.filter_step_ahead = eval(value);
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
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
catch
status = 0;
......
......@@ -34,17 +34,7 @@ function [newTab, created] = add_tab(hObject, title)
handles = guidata(hObject);
if isfield(handles, 'tabGroup') == 0
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);
handles = createTabGroup(handles, hObject);
end
created = 1;
......@@ -55,10 +45,11 @@ tab = checkIfExistsTab(tabGroup, title);
if ~isempty(tab)
% close existing tab so that it'll be redrawn
gui_tabs.delete_tab(tab);
% set(handles.tabGroup, 'SelectedTab' , tab);
% newTab = tab;
% created = 0;
% return;
tabGroup = getappdata(0, 'tabGroup');
if isempty(tabGroup)
handles = createTabGroup(handles, hObject);
tabGroup = getappdata(0, 'tabGroup');
end
end
newTab = uitab(handles.tabGroup, 'Title', title);
......@@ -80,3 +71,16 @@ setappdata(0, 'tabGroup', tabGroup);
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)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2019 Dynare Team
% Copyright (C) 2019-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -36,7 +36,6 @@ global model_settings oo_ ys0_
handles.varsTabGroup = uitabgroup(handles.uipanelVars, 'Position', [0 0 1 1]);
varidxs = find([model_settings.variables{:, 4}]);
nvars = length(varidxs);
column_names = {'Active', 'Name'};
switch command
case 'perfect_foresight'
......@@ -47,7 +46,9 @@ switch command
column_names = {'Active', 'Name', 'Long Name'};
case 'forecast'
column_names = {'Active', 'Name', 'Initial Condition', 'New Value'};
varidxs = 1:size(model_settings.variables,1);
end
nvars = length(varidxs);
editable = true(1, size(column_names, 2));
editable(2) = false;
data = cell(nvars, size(column_names, 2));
......
......@@ -32,7 +32,7 @@ tabs = get(tabGroup,'Children');
% Get handles structure
handles = guidata(hTab);
if(size(tabs,1)==1)
if size(tabs,1) == 1
delete(tabGroup);
rmappdata(0,'tabGroup');
handles = rmfield(handles, 'tabGroup');
......
......@@ -13,7 +13,7 @@ function comm_str = command_string(comm_name, comm)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-2019 Dynare Team
% Copyright (C) 2003-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -33,7 +33,7 @@ function comm_str = command_string(comm_name, comm)
global project_info
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
comm_str = [comm_str 'stochastic '];
end
......
......@@ -12,7 +12,7 @@ function menu_options(oid, status)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-2019 Dynare Team
% Copyright (C) 2003-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -29,7 +29,7 @@ function menu_options(oid, status)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global M_ oo_ project_info
global oo_ project_info
handles = guihandles(getappdata(0,'main_figure'));
......@@ -56,6 +56,9 @@ switch oid
handles.estimation_parameters_shocks.Enable = status;
handles.estimation_run_calibrated_smoother.Enable = status;
handles.estimation_run.Enable = status;
if project_info.estimation_run
handles.estimation_run_smoother2histval.Enable = status;
end
case 'stochastic'
handles.model_export.Enable = status;
......@@ -68,6 +71,8 @@ switch oid
case 'sensitivity'
handles.model_export.Enable = status;
handles.sensitivity_analysis.Enable = status;
handles.irf_calibration.Enable = status;
handles.moment_calibration.Enable = status;
case 'output'
if strcmpi(status, 'off')
......@@ -105,6 +110,9 @@ switch oid
case 'epilogue'
handles.post_processing_epilogue.Enable = status;
case 'posterior'
handles.post_processing_posterior.Enable = status;
otherwise
error(['menu option: ' oid ' not handled']);
end
......
......@@ -17,7 +17,7 @@ function varargout = dynare_gui(varargin)
% stop. All inputs are passed to dynare_gui_OpeningFcn via varargin.
%
%
% Copyright (C) 2003-2019 Dynare Team
% Copyright (C) 2003-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -34,6 +34,8 @@ function varargout = dynare_gui(varargin)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
evalin('base', 'global dynare_gui_ project_info model_settings');
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', 1, ...
'gui_OpeningFcn', @dynare_gui_OpeningFcn, ...
......@@ -72,7 +74,7 @@ setappdata(0, 'special_color', 'white');
setappdata(0, 'main_figure', hObject);
warning_config();
dynareroot = dynare_config('', false);
dynareroot = dynare_config();
setappdata(0, 'dynare_gui_root', [fileparts(which('dynare_gui')) filesep]);
......@@ -95,9 +97,9 @@ end
function project_new_Callback(hObject, ~, ~)
global M_ oo_ options_
global project_info model_settings
global project_info
%% Reset GUI data
% Reset GUI data
if ~isempty(project_info)
% Close existing project
if isstruct(project_info) ...
......@@ -105,14 +107,10 @@ if ~isempty(project_info)
&& isfield(project_info, 'project_name') ...
&& ~isempty(project_info.project_name)
try
gui_close_project();
gui_close_project(true);
catch
end
end
else
if ~isempty(model_settings)
evalin('global', 'clear model_settings')
end
end
gui_set_project_info()
......@@ -123,7 +121,7 @@ if (exist('M_', 'var') && isstruct(M_)) || (exist('oo_', 'var') && isstruct(oo_)
'It seems like you have already run dynare. Do you want to use the output in the workspace?', ...
'DynareGUI', 'Yes', 'No', 'Yes');
if strcmp(answer, 'No')
evalin('global', 'clear M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_');
evalin('base', 'clear M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_');
else
if ~(exist([M_.fname filesep 'model' filesep 'json' filesep 'modfile-original.json'], 'file') == 2 ...
&& exist([M_.fname filesep 'model' filesep 'json' filesep 'modfile.json'], 'file') == 2)
......@@ -137,26 +135,26 @@ if (exist('M_', 'var') && isstruct(M_)) || (exist('oo_', 'var') && isstruct(oo_)
project_info.observed_variables_set = true;
end
if project_info.project_model_stochastic
if isfield(oo_, 'dr') && isfield(oo_, 'mean') && isfield(oo_, 'var') && isfield(oo_, 'autocorr')
if oo_.gui.ran_stoch_simul
project_info.stochastic_simulation_run = true;
end
if isfield(oo_, 'datafile') || isfield(oo_, 'dataset')
project_info.observed_variables_set = true;
end
if isfield(oo_, 'SmoothedVariables')
if oo_.gui.ran_calib_smoother
project_info.calibrated_smoother_run = true;
end
if isfield(oo_, 'dr') && isfield(oo_.dr, 'ghu')
if oo_.gui.ran_estimation
project_info.estimation_run = true;
end
if isfield(oo_, 'shock_decomposition') && ~isempty(oo_.shock_decomposition)
if oo_.gui.ran_shock_decomposition
project_info.shock_decomposition_run = true;
end
if isfield(oo_, 'realtime_shock_decomposition') && ~isempty(oo_.realtime_shock_decomposition)
if oo_.gui.ran_realtime_shock_decomposition
project_info.realtime_shock_decomposition_run = true;
end
else
if isfield(oo_, 'endo_simul') || isfield(oo_, 'exo_simul')
if oo_.gui.ran_perfect_foresight
project_info.deterministic_simulation_run = true;
end
end
......@@ -167,7 +165,7 @@ gui_project(addTab(hObject, 'New project'), 'New');
end
% --------------------------------------------------------------------
function project_open_Callback(varargin)
function project_open_Callback(hObject, ~, ~)
% hObject handle to project_open (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
......@@ -180,17 +178,17 @@ if isstruct(project_info) ...
&& isfield(project_info, 'project_name') ...
&& ~isempty(project_info.project_name)
try
gui_close_project();
gui_close_project(true);
catch
end
end
gui_open_project(varargin{1});
gui_open_project(hObject);
end
% --------------------------------------------------------------------
function project_close_Callback(~, ~, ~)
gui_close_project();
gui_close_project(false);
end
% --------------------------------------------------------------------
......@@ -226,7 +224,9 @@ fns = fieldnames(appdata);
for ii = 1:numel(fns)
rmappdata(0,fns{ii});
end
evalin('base','clear');
clear('global', 'project_info')
clear('global', 'model_settings')
clear('global', 'dynare_gui_')
close force
end
......@@ -276,15 +276,20 @@ gui_estim_params(addTab(hObject, 'Est. params & shocks '));
end
% --------------------------------------------------------------------
function estimation_run_Callback(hObject, ~, ~)
function estimation_run_Callback(hObject, ~, handles)
possibly_create_model_settings();
gui_estimation(addTab(hObject, 'Estimation '));
gui_estimation(addTab(hObject, 'Estimation ', handles));
end
% --------------------------------------------------------------------
function estimation_run_calibrated_smoother_Callback(hObject, ~, ~)
function estimation_run_calibrated_smoother_Callback(hObject, ~, handles)
possibly_create_model_settings();
gui_calib_smoother(addTab(hObject, 'Calib. smoother ', handles));
end
function estimation_run_smoother2histval_Callback(hObject, ~, handles)
possibly_create_model_settings();
gui_calib_smoother(addTab(hObject, 'Calib. smoother '));
gui_smoother2histval(addTab(hObject, 'Smoother2Histval ', handles));
end
function possibly_create_model_settings()
......@@ -295,53 +300,66 @@ end
% Simulation!
% --------------------------------------------------------------------
function simulation_stochastic_Callback(hObject, ~, ~)
function simulation_stochastic_Callback(hObject, ~, handles)
possibly_create_model_settings();
gui_stoch_simulation(addTab(hObject, 'Stoch simul. '));
gui_stoch_simulation(addTab(hObject, 'Stoch simul. ', handles));
end
% --------------------------------------------------------------------
function simulation_deterministic_Callback(hObject, ~, ~)
function simulation_deterministic_Callback(hObject, ~, handles)
possibly_create_model_settings();
gui_determ_simulation(addTab(hObject, 'Determ simul. ', handles));
end
function sensitivity_analysis_Callback(hObject, ~, handles)
possibly_create_model_settings();
gui_sensitivity_analysis(addTab(hObject, 'Sensitivity', handles));
end
function irf_calibration_Callback(hObject, ~, handles)
possibly_create_model_settings();
gui_determ_simulation(addTab(hObject, 'Determ simul. '));
gui_irf_calibration(addTab(hObject, 'IRF Calibration', handles));
end
function sensitivity_analysis_Callback(hObject, ~, ~)
function moment_calibration_Callback(hObject, ~, handles)
possibly_create_model_settings();
gui_sensitivity_analysis(addTab(hObject, 'Sensitivity'));
gui_moment_calibration(addTab(hObject, 'Moment Calibration', handles));
end
% Output!
function output_shock_decomposition_Callback(hObject, ~, ~)
gui_shock_decomposition(addTab(hObject, 'Shock decomp. '));
function output_shock_decomposition_Callback(hObject, ~, handles)
gui_shock_decomposition(addTab(hObject, 'Shock decomp. ', handles));
end
% --------------------------------------------------------------------
function output_realtime_shock_decomposition_Callback(hObject, ~, ~)
gui_realtime_shock_decomposition(addTab(hObject, 'Realtime shock decomp. '));
function output_realtime_shock_decomposition_Callback(hObject, ~, handles)
gui_realtime_shock_decomposition(addTab(hObject, 'Realtime shock decomp. ', handles));
end
% --------------------------------------------------------------------
function output_plot_shock_decomposition_Callback(hObject, ~, ~)
gui_plot_shock_decomposition(addTab(hObject, 'Plot shock decomp. '));
function output_plot_shock_decomposition_Callback(hObject, ~, handles)
gui_plot_shock_decomposition(addTab(hObject, 'Plot shock decomp. ', handles));
end
% --------------------------------------------------------------------
function output_conditional_forecast_Callback(hObject, ~)
gui_cond_forecast_preliminary(addTab(hObject, 'Prelim. Cond. forecast '), hObject);
function output_conditional_forecast_Callback(hObject, ~, handles)
gui_cond_forecast_preliminary(addTab(hObject, 'Prelim. Cond. forecast ', handles), hObject, handles);
end
% --------------------------------------------------------------------
function output_forecast_Callback(hObject, ~, ~)
gui_forecast(addTab(hObject, 'Forecast '));
function output_forecast_Callback(hObject, ~, handles)
gui_forecast(addTab(hObject, 'Forecast ', handles));
end
function post_processing_epilogue_Callback(hObject, ~, ~)
gui_epilogue(addTab(hObject, 'Epilogue'));
function post_processing_epilogue_Callback(hObject, ~, handles)
gui_epilogue(addTab(hObject, 'Epilogue', handles));
end
function post_processing_posterior_Callback(hObject, ~, handles)
gui_posterior_distribution(addTab(hObject, 'Posterior distribution', handles));
end
% --------------------------------------------------------------------
function help_product_help_Callback(varargin)
function help_product_help_Callback(~, ~, ~)
path = [getappdata(0, 'dynare_gui_root') filesep 'resources' filesep 'html' filesep 'index.html'];
if exist(path, 'file') == 2
open(path);
......@@ -352,9 +370,10 @@ end
end
% --------------------------------------------------------------------
function help_dynare_manual_Callback(varargin)
function help_dynare_manual_Callback(~, ~, ~)
global dynareroot
html_man_file = [dynareroot '..' filesep 'doc', filesep, 'dynare.html', filesep, 'index.html'];
ind = strfind(dynareroot, [filesep 'matlab']);
html_man_file = [dynareroot(1:ind), 'doc', filesep, 'dynare.html', filesep, 'index.html'];
if exist(html_man_file, 'file') == 2
open(html_man_file);
else
......@@ -364,11 +383,11 @@ end
end
% --------------------------------------------------------------------
function help_about_Callback(varargin)
gui_about(addTab(varargin{1}, 'About Dynare GUI'));
function help_about_Callback(hObject, ~, handles)
gui_about(addTab(hObject, 'About Dynare GUI ', handles));
end
function newTab = addTab(hObject, title)
function newTab = addTab(hObject, title, ~)
newTab = gui_tabs.add_tab(hObject, title);
end
......@@ -405,192 +424,325 @@ h1 = figure(...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata}, ...
'CloseRequestFcn', @(hObject,eventdata)dynare_gui('project_exit_Callback',hObject,eventdata,guidata(hObject)));
appdata = [];
appdata.lastValidTag = 'uitoolbar1';
uitoolbar(...
'Parent',h1,...
'Visible','off',...
'Tag','uitoolbar1');
'Tag','uitoolbar1',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'project';
h3 = uimenu(...
'Parent',h1,...
'Accelerator','M',...
'Label','Project',...
'Tag','project');
'Tag','project',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'project_new';
uimenu(...
'Parent',h3,...
'Callback', @project_new_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('project_new_Callback',hObject,eventdata,guidata(hObject)),...
'Label','New Project ...',...
'Tag','project_new',...
'Accelerator','n');
'Accelerator','n',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'project_open';
uimenu(...
'Parent',h3,...
'Callback', @project_open_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('project_open_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Open Project ...',...
'Tag','project_open',...
'Accelerator','o');
'Accelerator','o',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'project_close';
uimenu(...
'Parent',h3,...
'Enable','off',...
'Separator','on',...
'Callback', @project_close_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('project_close_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Close Project',...
'Tag','project_close',...
'Accelerator','w');
'Accelerator','w',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'project_save';
uimenu(...
'Parent',h3,...
'Enable','off',...
'Callback', @project_save_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('project_save_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Save Project',...
'Tag','project_save',...
'Accelerator','s');
'Accelerator','s',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'project_save_as';
uimenu(...
'Parent',h3,...
'Enable','off',...
'Separator','on',...
'Callback', @project_save_as_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('project_save_as_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Save Project As ...',...
'Tag','project_save_as');
'Tag','project_save_as',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'project_exit';
uimenu(...
'Parent',h3,...
'Separator','on',...
'Callback', @project_exit_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('project_exit_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Exit',...
'Tag','project_exit');
'Tag','project_exit',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'model';
h10 = uimenu(...
'Parent',h1,...
'Label','Model',...
'Tag','model');
'Tag','model',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'model_load';
uimenu(...
'Parent',h10,...
'Enable','off',...
'Callback', @model_load_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('model_load_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Load main .mod/.dyn file',...
'Tag','model_load');
'Tag','model_load',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'model_settings';
uimenu(...
'Parent',h10,...
'Enable','off',...
'Separator','on',...
'Callback', @model_settings_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('model_settings_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Model settings ...',...
'Tag','model_settings');
'Tag','model_settings',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'model_save_snapshot';
uimenu(...
'Parent',h10,...
'Enable','off',...
'Separator','on',...
'Callback', @model_save_snapshot_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('model_save_snapshot_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Save model snapshot',...
'Tag','model_save_snapshot');
'Tag','model_save_snapshot',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'model_load_snapshot';
uimenu(...
'Parent',h10,...
'Enable','off',...
'Callback', @model_load_snapshot_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('model_load_snapshot_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Load model snapshot',...
'Tag','model_load_snapshot');
'Tag','model_load_snapshot',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'model_export';
uimenu(...
'Parent',h10,...
'Enable','off',...
'Callback', @model_export_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('model_export_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Export to a .mod file',...
'Tag','model_export');
'Tag','model_export',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'model_logfile';
uimenu(...
'Parent',h10,...
'Enable','off',...
'Separator','on',...
'Callback', @model_logfile_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('model_logfile_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Dynare GUI log file ',...
'Tag','model_logfile');
%
% appdata = [];
% appdata.lastValidTag = 'Untitled_7';
%
% uicontextmenu(...
% 'Parent',h1,...
% 'Callback',@(hObject,eventdata)dynare_gui('Untitled_7_Callback',hObject,eventdata,guidata(hObject)),...
% 'Tag','Untitled_7',...
% 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
'Tag','model_logfile',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'Untitled_7';
uicontextmenu(...
'Parent',h1,...
'Callback',@(hObject,eventdata)dynare_gui('Untitled_7_Callback',hObject,eventdata,guidata(hObject)),...
'Tag','Untitled_7',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'estimation';
h18 = uimenu(...
'Parent',h1,...
'Label','Estimation',...
'Tag','estimation');
'Tag','estimation',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'estimation_observed_variables';
uimenu(...
'Parent',h18,...
'Enable','off',...
'Callback', @estimation_observed_variables_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('estimation_observed_variables_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Observed variables & data file',...
'Tag','estimation_observed_variables');
'Tag','estimation_observed_variables',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'estimation_parameters_shocks';
uimenu(...
'Parent',h18,...
'Enable','off',...
'Callback', @estimation_parameters_shocks_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('estimation_parameters_shocks_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Estimated parameters & shocks ...',...
'Tag','estimation_parameters_shocks');
'Tag','estimation_parameters_shocks',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'estimation_run_calibrated_smoother';
uimenu(...
'Parent',h18,...
'Enable','off',...
'Separator','on',...
'Callback', @estimation_run_calibrated_smoother_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('estimation_run_calibrated_smoother_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Run calibrated smoother',...
'Tag','estimation_run_calibrated_smoother');
'Tag','estimation_run_calibrated_smoother',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'estimation_run_smoother2histval';
uimenu(...
'Parent',h18,...
'Enable','off',...
'Separator','on',...
'Callback',@(hObject,eventdata)dynare_gui('estimation_run_smoother2histval_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Run smoother2histval',...
'Tag','estimation_run_smoother2histval',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'estimation_run';
uimenu(...
'Parent',h18,...
'Enable','off',...
'Callback', @estimation_run_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('estimation_run_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Run estimation',...
'Tag','estimation_run');
'Tag','estimation_run',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'simulation';
h23 = uimenu(...
'Parent',h1,...
'Label','Simulation',...
'Tag','simulation');
'Tag','simulation',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'simulation_stochastic';
uimenu(...
'Parent',h23,...
'Enable','off',...
'Callback', @simulation_stochastic_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('simulation_stochastic_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Stochastic simulation',...
'Tag','simulation_stochastic');
'Tag','simulation_stochastic',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'simulation_deterministic';
uimenu(...
'Parent',h23,...
'Enable','off',...
'Callback', @simulation_deterministic_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('simulation_deterministic_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Deterministic simulation',...
'Tag','simulation_deterministic');
'Tag','simulation_deterministic',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'sensitivity';
h24 = uimenu(...
'Parent',h1,...
'Label','Sensitivity',...
'Tag','sensitivity');
'Tag','sensitivity',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'irf_calibration';
uimenu(...
'Parent',h24,...
'Enable','off',...
'Callback', @sensitivity_analysis_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('irf_calibration_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Irf Calibration',...
'Tag','irf_calibration',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'moment_calibration';
uimenu(...
'Parent',h24,...
'Enable','off',...
'Callback',@(hObject,eventdata)dynare_gui('moment_calibration_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Moment Calibration',...
'Tag','moment_calibration',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'sensitivity_analysis';
uimenu(...
'Parent',h24,...
'Enable','off',...
'Callback',@(hObject,eventdata)dynare_gui('sensitivity_analysis_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Sensitivity Analysis',...
'Tag','sensitivity_analysis');
%
% appdata = [];
% appdata.lastValidTag = 'uipanel_welcome';
'Tag','sensitivity_analysis',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'uipanel_welcome';
h26 = uipanel(...
'Parent',h1,...
......@@ -613,163 +765,251 @@ h_test = uicontrol(...
'FontAngle',get(0,'defaultuicontrolFontAngle'),...
'FontWeight','bold');
% default_char_size = get(h_test,'extent');
default_char_size = get(h_test,'extent');
h_test.Visible = 'Off';
% c_width = default_char_size(3);
% c_height = default_char_size(4);
c_width = default_char_size(3);
c_height = default_char_size(4);
appdata = [];
appdata.lastValidTag = 'text_dyna';
% uicontrol(...
% 'Parent',h26,...
% 'FontUnits',get(0,'defaultuicontrolFontUnits'),...
% 'Units','normalized',...
% 'HorizontalAlignment',get(0,'defaultuicontrolHorizontalAlignment'),...
% 'ListboxTop',get(0,'defaultuicontrolListboxTop'),...
% 'Max',get(0,'defaultuicontrolMax'),...
% 'Min',get(0,'defaultuicontrolMin'),...
% 'SliderStep',get(0,'defaultuicontrolSliderStep'),...
% 'String','DYNARE GUI',...
% 'Style','text',...
% 'Value',get(0,'defaultuicontrolValue'),...
% 'Position',[0.5-c_width*5 0.6 c_width*10 c_height],... %'Position',[60 22.0117647058823 c_width*4 c_height],...
% 'BackgroundColor',[1 1 1],...
% 'Callback',blanks(0),...
% 'Children',[],...
% 'ForegroundColor',get(0,'defaultuicontrolForegroundColor'),...
% 'Enable',get(0,'defaultuicontrolEnable'),...
% 'TooltipString',blanks(0),...
% 'Visible',get(0,'defaultuicontrolVisible'),...
% 'KeyPressFcn',blanks(0),...
% 'KeyReleaseFcn',blanks(0),...
% 'HandleVisibility',get(0,'defaultuicontrolHandleVisibility'),...
% 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ,...
% 'DeleteFcn',blanks(0),...
% 'ButtonDownFcn',blanks(0),...
% 'Tag','text_dyna',...
% 'UserData',[],...
% 'FontSize',28,...
% 'FontName','Tahoma',...
% 'FontAngle',get(0,'defaultuicontrolFontAngle'),...
% 'FontWeight','bold');
%
% uicontrol(...
% 'Parent',h26,...
% 'FontUnits',get(0,'defaultuicontrolFontUnits'),...
% 'Units','normalized',...
% 'HorizontalAlignment','center',...
% 'ListboxTop',get(0,'defaultuicontrolListboxTop'),...
% 'Max',get(0,'defaultuicontrolMax'),...
% 'Min',get(0,'defaultuicontrolMin'),...
% 'SliderStep',get(0,'defaultuicontrolSliderStep'),...
% 'String','Version 0.7',...
% 'Style','text',...
% 'Value',get(0,'defaultuicontrolValue'),...
% 'Position',[0,0.4,1,.1],...
% 'BackgroundColor',[1 1 1],...
% 'Callback',blanks(0),...
% 'Children',[],...
% 'ForegroundColor',get(0,'defaultuicontrolForegroundColor'),...
% 'Enable',get(0,'defaultuicontrolEnable'),...
% 'TooltipString',blanks(0),...
% 'Visible',get(0,'defaultuicontrolVisible'),...
% 'KeyPressFcn',blanks(0),...
% 'KeyReleaseFcn',blanks(0),...
% 'HandleVisibility',get(0,'defaultuicontrolHandleVisibility'),...
% 'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ,...
% 'DeleteFcn',blanks(0),...
% 'ButtonDownFcn',blanks(0),...
% 'Tag','text_version',...
% 'UserData',[],...
% 'FontSize',12,...
% 'FontName',get(0,'defaultuicontrolFontName'),...
% 'FontAngle',get(0,'defaultuicontrolFontAngle'),...
% 'FontWeight',get(0,'defaultuicontrolFontWeight'));
uicontrol(...
'Parent',h26,...
'FontUnits',get(0,'defaultuicontrolFontUnits'),...
'Units','normalized',...
'HorizontalAlignment',get(0,'defaultuicontrolHorizontalAlignment'),...
'ListboxTop',get(0,'defaultuicontrolListboxTop'),...
'Max',get(0,'defaultuicontrolMax'),...
'Min',get(0,'defaultuicontrolMin'),...
'SliderStep',get(0,'defaultuicontrolSliderStep'),...
'String','DYNARE GUI',...
'Style','text',...
'Value',get(0,'defaultuicontrolValue'),...
'Position',[0.5-c_width*5 0.6 c_width*10 c_height],... %'Position',[60 22.0117647058823 c_width*4 c_height],...
'BackgroundColor',[1 1 1],...
'Callback',blanks(0),...
'Children',[],...
'ForegroundColor',get(0,'defaultuicontrolForegroundColor'),...
'Enable',get(0,'defaultuicontrolEnable'),...
'TooltipString',blanks(0),...
'Visible',get(0,'defaultuicontrolVisible'),...
'KeyPressFcn',blanks(0),...
'KeyReleaseFcn',blanks(0),...
'HandleVisibility',get(0,'defaultuicontrolHandleVisibility'),...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ,...
'DeleteFcn',blanks(0),...
'ButtonDownFcn',blanks(0),...
'Tag','text_dyna',...
'UserData',[],...
'FontSize',28,...
'FontName','Tahoma',...
'FontAngle',get(0,'defaultuicontrolFontAngle'),...
'FontWeight','bold');
appdata = [];
appdata.lastValidTag = 'text_version';
h28 = uicontrol(...
'Parent',h26,...
'FontUnits',get(0,'defaultuicontrolFontUnits'),...
'Units','normalized',...
'HorizontalAlignment','center',...
'ListboxTop',get(0,'defaultuicontrolListboxTop'),...
'Max',get(0,'defaultuicontrolMax'),...
'Min',get(0,'defaultuicontrolMin'),...
'SliderStep',get(0,'defaultuicontrolSliderStep'),...
'String','Version 0.7',...
'Style','text',...
'Value',get(0,'defaultuicontrolValue'),...
'Position',[0,0.4,1,.1],...
'BackgroundColor',[1 1 1],...
'Callback',blanks(0),...
'Children',[],...
'ForegroundColor',get(0,'defaultuicontrolForegroundColor'),...
'Enable',get(0,'defaultuicontrolEnable'),...
'TooltipString',blanks(0),...
'Visible',get(0,'defaultuicontrolVisible'),...
'KeyPressFcn',blanks(0),...
'KeyReleaseFcn',blanks(0),...
'HandleVisibility',get(0,'defaultuicontrolHandleVisibility'),...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} ,...
'DeleteFcn',blanks(0),...
'ButtonDownFcn',blanks(0),...
'Tag','text_version',...
'UserData',[],...
'FontSize',12,...
'FontName',get(0,'defaultuicontrolFontName'),...
'FontAngle',get(0,'defaultuicontrolFontAngle'),...
'FontWeight',get(0,'defaultuicontrolFontWeight'));
%set(h28,'Units','normalized');
appdata = [];
appdata.lastValidTag = 'output';
h31 = uimenu(...
'Parent',h1,...
'Label','Output',...
'Tag','output');
'Tag','output',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'output_shocks_dec';
h39 = uimenu(...
'Parent',h31,...
'Enable','off', ...
'Label','Shock Decomposition',...
'Tag','output_shocks_dec');
'Tag','output_shocks_dec',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'output_shocks_decomposition';
uimenu(...
'Parent',h39,...
'Enable','off',...
'Callback', @output_shock_decomposition_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('output_shock_decomposition_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Historical',...
'Tag','output_shocks_decomposition');
'Tag','output_shocks_decomposition',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'output_realtime_shocks_decomposition';
uimenu(...
'Parent',h39,...
'Enable','off',...
'Callback', @output_realtime_shock_decomposition_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('output_realtime_shock_decomposition_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Realtime',...
'Tag','output_realtime_shocks_decomposition');
'Tag','output_realtime_shocks_decomposition',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'output_plot_shocks_decomposition';
uimenu(...
'Parent',h39,...
'Enable','off',...
'Callback', @output_plot_shock_decomposition_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('output_plot_shock_decomposition_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Plot',...
'Tag','output_plot_shocks_decomposition');
'Tag','output_plot_shocks_decomposition',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'output_conditional_forecast';
uimenu(...
'Parent',h31,...
'Enable','off',...
'Callback', @output_conditional_forecast_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('output_conditional_forecast_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Conditional forecast',...
'Tag','output_conditional_forecast');
'Tag','output_conditional_forecast',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'output_forecast';
uimenu(...
'Parent',h31,...
'Enable','off',...
'Callback', @output_forecast_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('output_forecast_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Forecast',...
'Tag','output_forecast');
'Tag','output_forecast',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'post_processing';
h33 = uimenu(...
'Parent',h1,...
'Label','Post-processing',...
'Tag', 'post_processing');
'Tag','post_processing',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'post_processing_epilogue';
uimenu(...
'Parent', h33, ...
'Enable', 'off', ...
'Callback', @post_processing_epilogue_Callback, ...
'Callback', @(hObject,eventdata)dynare_gui('post_processing_epilogue_Callback',hObject,eventdata,guidata(hObject)),...
'Label', 'Epilogue',...
'Tag', 'post_processing_epilogue');
'Tag', 'post_processing_epilogue',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'post_processing_posterior';
uimenu(...
'Parent', h33, ...
'Enable', 'off', ...
'Callback', @(hObject,eventdata)dynare_gui('post_processing_posterior_Callback',hObject,eventdata,guidata(hObject)),...
'Label', 'Posterior distribution',...
'Tag', 'post_processing_posterior',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'help';
h34 = uimenu(...
'Parent',h1,...
'Separator','on',...
'Label','Help',...
'Tag','help');
'Tag','help',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'help_product_help';
uimenu(...
'Parent',h34,...
'Callback', @help_product_help_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('help_product_help_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Dynare GUI help',...
'Tag','help_product_help');
'Tag','help_product_help',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'help_dynare_manual';
uimenu(...
'Parent',h34,...
'Callback', @help_dynare_manual_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('help_dynare_manual_Callback',hObject,eventdata,guidata(hObject)),...
'Label','Dynare reference manual',...
'Tag','help_dynare_manual');
'Tag','help_dynare_manual',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
appdata = [];
appdata.lastValidTag = 'help_about';
uimenu(...
'Parent',h34,...
'Separator','on',...
'Callback', @help_about_Callback, ...
'Callback',@(hObject,eventdata)dynare_gui('help_about_Callback',hObject,eventdata,guidata(hObject)),...
'Label','About Dynare GUI',...
'Tag','help_about');
'Tag','help_about',...
'CreateFcn', {@local_CreateFcn, blanks(0), appdata} );
end
% --- Set application data first then calling the CreateFcn.
function local_CreateFcn(hObject, eventdata, createfcn, appdata)
if ~isempty(appdata)
names = fieldnames(appdata);
for i=1:length(names)
name = char(names(i));
setappdata(hObject, name, getfield(appdata,name));
end
end
if ~isempty(createfcn)
if isa(createfcn,'function_handle')
createfcn(hObject, eventdata);
else
eval(createfcn);
end
end
end
% --- Handles default GUIDE GUI creation and callback dispatch
......
......@@ -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();
......
function gui_close_project()
function gui_close_project(clear_dynare_vars)
% function gui_close_project()
% closes current project Dynare_GUI project file
%
......@@ -11,7 +11,7 @@ function gui_close_project()
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-2019 Dynare Team
% Copyright (C) 2003-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -28,7 +28,7 @@ function gui_close_project()
% You should have received a copy of the GNU General Public License
% 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])
......@@ -47,10 +47,11 @@ gui_tabs.close_all();
%disable menu options
gui_set_menus(false);
clearvars -global
evalin('global', 'clear M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_');
evalin('global', 'clear project_info model_settings');
evalin('base', 'clear project_info model_settings');
if clear_dynare_vars
evalin('base', 'clear M_ options_ oo_ estim_params_ bayestopt_ dataset_ dataset_info estimation_info ys0_ ex0_');
clear_persistent_variables(fileparts(which('dynare')), true)
end
% remove appdata
if isappdata(0, 'estimation')
......
function gui_cond_forecast_preliminary(tabId, hObject)
function gui_cond_forecast_preliminary(tabId, hObject, handles)
% function gui_cond_forecast(tabId)
% interface for the DYNARE imcforecast command
%
......
......@@ -11,7 +11,7 @@ function status = gui_create_model_settings()
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-2019 Dynare Team
% Copyright (C) 2003-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -28,8 +28,7 @@ function status = gui_create_model_settings()
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
global M_ ex0_ oo_
global project_info model_settings
global M_ ex0_ oo_ project_info model_settings
model_settings = struct();
......@@ -90,9 +89,9 @@ setappdata(0, 'model_settings', model_settings);
function create_shocks_cell_array()
if project_info.project_model_stochastic
model_settings.shocks = cell(M_.exo_nbr, 10);
else
model_settings.shocks = cell(M_.exo_nbr, 8);
else
model_settings.shocks = cell(M_.exo_nbr, 6);
end
model_settings.shocks(:, 1) = M_.exo_names;
model_settings.shocks(:, 2) = M_.exo_names_tex;
......@@ -105,7 +104,6 @@ setappdata(0, 'model_settings', model_settings);
model_settings.shocks(:, 6) = {''}; % STD
col = 7;
else
%TODO: check with Dynare team - how to display initval for deterministic case
if ~isempty(ex0_)
model_settings.shocks(:, 4) = num2cell(ex0_);
else
......@@ -113,9 +111,20 @@ setappdata(0, 'model_settings', model_settings);
end
col = 5;
end
model_settings.shocks(:, col) = {true};
model_settings.shocks(:, col+1) = {'All'};
model_settings.shocks(:, col+2) = {true};
model_settings.shocks(:, col+3) = {''};
if isfield(M_, 'shock_groups')
fn = fieldnames(M_.shock_groups);
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
......@@ -13,7 +13,7 @@ function fHandle= gui_define_comm_options(comm, comm_name)
% SPECIAL REQUIREMENTS
% none
% Copyright (C) 2003-2019 Dynare Team
% Copyright (C) 2003-2020 Dynare Team
%
% This file is part of Dynare.
%
......@@ -186,16 +186,18 @@ handles.pushbuttonReset = uicontrol( ...
'HorizontalAlignment', 'left',...
'Visible', visible);
elseif strcmp(option_type, 'popupmenu')
tab_handles.values(ii) = uicontrol( ...
'Parent', tabs_panel, ...
'Style', 'popupmenu', ...
'String', popupOptions, ...
'Units', 'characters', 'BackgroundColor', special_color,...
'Position', [h_space*2+width_name new_top-ii*2 width_value 1.5], ...
'TooltipString', option_type,...
'Value', 1, ...
'HorizontalAlignment', 'left',...
'Visible', visible);
% commented in commit after a290b22 because `popupOptions`
% variable does not exist
% tab_handles.values(ii) = uicontrol( ...
% 'Parent', tabs_panel, ...
% 'Style', 'popupmenu', ...
% 'String', popupOptions, ...
% 'Units', 'characters', 'BackgroundColor', special_color,...
% 'Position', [h_space*2+width_name new_top-ii*2 width_value 1.5], ...
% 'TooltipString', option_type,...
% 'Value', 1, ...
% 'HorizontalAlignment', 'left',...
% 'Visible', visible);
elseif iscell(option_type)
tab_handles.values(ii) = uicontrol('Parent', tabs_panel, ...
'Style', 'popup',...
......@@ -234,12 +236,14 @@ handles.pushbuttonReset = uicontrol( ...
tab_handles.values(ii).String = num2str(user_defined_options.(group{ii,1}), 15);
elseif strcmp(option_type, '[INTEGER1:INTEGER2]') ...
|| strcmp(option_type, 'INTEGER or [INTEGER1:INTEGER2]') ...
|| strcmp(option_type, '[DOUBLE DOUBLE')
tab_handles.values(ii).Value = str2num(user_defined_options.(group{ii,1}));
|| strcmp(option_type, '[DOUBLE DOUBLE]') ...
|| 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});
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)
......@@ -251,7 +255,7 @@ handles.pushbuttonReset = uicontrol( ...
defaultString = group{ii,2};
if strcmp(option_type, 'popupmenu')
defaultString = popupOptions{userDefaultValue};
%defaultString = popupOptions{userDefaultValue};
end
if ~ischar(defaultString) && isnumeric(defaultString)
defaultString = num2str(defaultString);
......@@ -319,6 +323,8 @@ handles.pushbuttonReset = uicontrol( ...
file_types = {'*.m';'*.mat';'*.xls';'*.xlsx';'*.csv'};
case 'mode_file'
file_types = {'*.mat'};
case 'mcmc_jumping_covariance_file'
file_types = {'*.mat'};
end
[fileName,pathName] = uigetfile(file_types,sprintf('Select %s ...', option_name));
......@@ -347,7 +353,7 @@ handles.pushbuttonReset = uicontrol( ...
return
end
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 ...]'}
[num, status] = str2num(value);
if strcmp(option_type,'[DOUBLE DOUBLE]')
......@@ -355,6 +361,11 @@ handles.pushbuttonReset = uicontrol( ...
status = 0;
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(size(num,1)~= 1 || size(num,2) < 2)
status = 0;
......