Skip to content
Snippets Groups Projects
Commit 54761c5c authored by Dóra Kocsis's avatar Dóra Kocsis
Browse files

add missing estimation options: raftery_lewis_diagnostics, raftery_lewis_qrs, posterior_nograph

parent 038608ff
Branches
No related tags found
1 merge request!16Master
......@@ -337,6 +337,18 @@ dynare_gui_.estimation.MH_options{num,2} = '[0.2 0.5]';
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} = '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} = '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} = '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} = 'posterior_sampling_method';
dynare_gui_.estimation.MH_options{num,2} = 'random_walk_metropolis_hastings';
......@@ -581,6 +593,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';
......
......@@ -117,6 +117,12 @@ try
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';
......@@ -173,6 +179,9 @@ try
options_.particle.proposal_approximation.montecarlo = true;
end
case 'posterior_nograph'
options_.no_graph.posterior = logical(value);
otherwise
if isnumeric(value)
eval(['options_.' gui_auxiliary.command_option_mapping(name) '=' num2str(value) ';']);
......
......@@ -236,7 +236,8 @@ handles.pushbuttonReset = uicontrol( ...
tab_handles.values(ii).String = num2str(user_defined_options.(group{ii,1}), 15);
elseif strcmp(option_type, '[INTEGER1:INTEGER2]') ...
|| strcmp(option_type, 'INTEGER or [INTEGER1:INTEGER2]') ...
|| strcmp(option_type, '[DOUBLE DOUBLE]')
|| 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') ...
......@@ -351,7 +352,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]')
......@@ -359,6 +360,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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment