From c5ab1c7f11aa9c77eb34b75af36abf84077f8d0a Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer <jpfeifer@gmx.de> Date: Sat, 30 Sep 2023 15:49:49 +0200 Subject: [PATCH] Decrease waitbar refresh rates to not clutter the console output --- matlab/check_posterior_sampler_options.m | 8 ++++---- matlab/olsgibbs.m | 2 +- matlab/prior_posterior_statistics_core.m | 5 +++-- matlab/surgibbs.m | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/matlab/check_posterior_sampler_options.m b/matlab/check_posterior_sampler_options.m index 7848cf6ce5..a3f127bd99 100644 --- a/matlab/check_posterior_sampler_options.m +++ b/matlab/check_posterior_sampler_options.m @@ -54,7 +54,7 @@ if init case 'random_walk_metropolis_hastings' posterior_sampler_options.parallel_bar_refresh_rate=50; - posterior_sampler_options.serial_bar_refresh_rate=3; + posterior_sampler_options.serial_bar_refresh_rate=20; posterior_sampler_options.parallel_bar_title='RWMH'; posterior_sampler_options.serial_bar_title='RW Metropolis-Hastings'; @@ -111,8 +111,8 @@ if init end case 'tailored_random_block_metropolis_hastings' - posterior_sampler_options.parallel_bar_refresh_rate=5; - posterior_sampler_options.serial_bar_refresh_rate=1; + posterior_sampler_options.parallel_bar_refresh_rate=50; + posterior_sampler_options.serial_bar_refresh_rate=20; posterior_sampler_options.parallel_bar_title='TaRB-MH'; posterior_sampler_options.serial_bar_title='TaRB Metropolis-Hastings'; @@ -181,7 +181,7 @@ if init case 'independent_metropolis_hastings' posterior_sampler_options.parallel_bar_refresh_rate=50; - posterior_sampler_options.serial_bar_refresh_rate=3; + posterior_sampler_options.serial_bar_refresh_rate=10; posterior_sampler_options.parallel_bar_title='IMH'; posterior_sampler_options.serial_bar_title='Ind. Metropolis-Hastings'; diff --git a/matlab/olsgibbs.m b/matlab/olsgibbs.m index 6d1590cb70..f8ddb684a4 100644 --- a/matlab/olsgibbs.m +++ b/matlab/olsgibbs.m @@ -186,7 +186,7 @@ end hh_fig = dyn_waitbar(0,'Please wait. Gibbs sampler...'); set(hh_fig,'Name','Olsgibbs estimation.'); for i = discarddraws+1:ndraws - if ~mod(i,10) + if ~mod(i,100) dyn_waitbar((i-discarddraws)/(ndraws-discarddraws),hh_fig,'Please wait. Gibbs sampler...'); end % Set conditional distribution of β diff --git a/matlab/prior_posterior_statistics_core.m b/matlab/prior_posterior_statistics_core.m index 273cf0367b..b98d1e950d 100644 --- a/matlab/prior_posterior_statistics_core.m +++ b/matlab/prior_posterior_statistics_core.m @@ -518,8 +518,9 @@ for b=fpar:B end irun(irun_index) = 1; end - - dyn_waitbar((b-fpar+1)/(B-fpar+1),h); + if mod(b-fpar+1, 5)==0 + dyn_waitbar((b-fpar+1)/(B-fpar+1),h); + end end myoutput.ifil=ifil; diff --git a/matlab/surgibbs.m b/matlab/surgibbs.m index 17b9d6c9d6..1528efa45f 100644 --- a/matlab/surgibbs.m +++ b/matlab/surgibbs.m @@ -1,6 +1,6 @@ function ds = surgibbs(ds, param_names, beta0, A, ndraws, discarddraws, thin, eqtags, model_name) -% Implements Gibbs Samipling for SUR +% Implements Gibbs Sampling for SUR % % INPUTS % ds [dseries] data @@ -110,7 +110,7 @@ hh_fig = dyn_waitbar(0,'Please wait. Gibbs sampler...'); set(hh_fig,'Name','Surgibbs estimation.'); residdraws = zeros(floor((ndraws-discarddraws)/thin), nobs, m); for i = 1:ndraws - if ~mod(i,10) + if ~mod(i,100) dyn_waitbar(i/ndraws,hh_fig,'Please wait. Gibbs sampler...'); end % Draw Omega, given X, Y, Beta -- GitLab