diff --git a/doc/parallel/parallel.tex b/doc/parallel/parallel.tex index 9dd23b1ae..7fdd48db3 100644 --- a/doc/parallel/parallel.tex +++ b/doc/parallel/parallel.tex @@ -907,7 +907,7 @@ waitbarString = [ '(' int2str(b) '/' int2str(mh_nblck) ') ... if mod(j, 3)==0 & ~whoiam % serial computation - waitbar(prtfrc,hh,waitbarString); + waitbar(prtfrc,hh_fig,waitbarString); elseif mod(j,50)==0 & whoiam, % parallel computation diff --git a/examples/Gali_2015.mod b/examples/Gali_2015.mod index 834b211e5..dd43158cc 100644 --- a/examples/Gali_2015.mod +++ b/examples/Gali_2015.mod @@ -20,7 +20,7 @@ */ /* - * Copyright © 2021 Dynare Team + * Copyright © 2021-2023 Dynare Team * * This file is part of Dynare. * @@ -147,13 +147,13 @@ end; varobs yhat; % Run prior function to get prior slope of the PC based on independent priors -hh=figure('Name','Slope of the Phillips Curve'); +hh_fig=figure('Name','Slope of the Phillips Curve'); prior_function(function='Gali_2015_PC_slope'); PC_slope_vec=cell2mat(oo_.prior_function_results(:,1)); optimal_bandwidth = mh_optimal_bandwidth(PC_slope_vec,length(PC_slope_vec),0,'gaussian'); [density(:,1),density(:,2)] = kernel_density_estimate(PC_slope_vec,512,length(PC_slope_vec),optimal_bandwidth,'gaussian'); -figure(hh) +figure(hh_fig) subplot(3,1,1) plot(density(:,1),density(:,2)); title('Prior') @@ -165,7 +165,7 @@ posterior_function(function='Gali_2015_PC_slope'); PC_slope_vec=cell2mat(oo_.posterior_function_results(:,1)); optimal_bandwidth = mh_optimal_bandwidth(PC_slope_vec,length(PC_slope_vec),0,'gaussian'); [density(:,1),density(:,2)] = kernel_density_estimate(PC_slope_vec,512,length(PC_slope_vec),optimal_bandwidth,'gaussian'); -figure(hh) +figure(hh_fig) subplot(3,1,2) plot(density(:,1),density(:,2)); title('Updated Prior') @@ -178,7 +178,7 @@ posterior_function(function='Gali_2015_PC_slope'); PC_slope_vec=cell2mat(oo_.posterior_function_results(:,1)); optimal_bandwidth = mh_optimal_bandwidth(PC_slope_vec,length(PC_slope_vec),0,'gaussian'); [density(:,1),density(:,2)] = kernel_density_estimate(PC_slope_vec,512,length(PC_slope_vec),optimal_bandwidth,'gaussian'); -figure(hh) +figure(hh_fig) subplot(3,1,3) plot(density(:,1),density(:,2)); title('Posterior') diff --git a/matlab/+occbin/DSGE_smoother.m b/matlab/+occbin/DSGE_smoother.m index 656e84a3c..79319b386 100644 --- a/matlab/+occbin/DSGE_smoother.m +++ b/matlab/+occbin/DSGE_smoother.m @@ -42,7 +42,7 @@ function [alphahat,etahat,epsilonhat,ahat0,SteadyState,trend_coeff,aKK,T0,R0,P,P % - alphahat0 [double] (m*1) array, smoothed endogenous variables in period 0 (a_{0|T}) (decision-rule order) % - state_uncertainty0 [double] (K,K,1) array, storing the uncertainty in period 0 -% Copyright © 2021 Dynare Team +% Copyright © 2021-2023 Dynare Team % % This file is part of Dynare. % @@ -401,7 +401,7 @@ if (~is_changed || occbin_smoother_debug) && nargin==12 if M_.Sigma_e(j,j) j1=j1+1; if mod(j1,9)==1 - hfig = dyn_figure(options_.nodisplay,'name','Occbin smoothed shocks'); + hh_fig = dyn_figure(options_.nodisplay,'name','Occbin smoothed shocks'); ifig=ifig+1; isub=0; end @@ -427,7 +427,7 @@ if (~is_changed || occbin_smoother_debug) && nargin==12 if mod(j1,9)~=0 && j==M_.exo_nbr annotation('textbox', [0.1,0,0.35,0.05],'String', 'Linear','Color','Blue','horizontalalignment','center','interpreter','none'); annotation('textbox', [0.55,0,0.35,0.05],'String', 'Piecewise','Color','Red','horizontalalignment','center','interpreter','none'); - dyn_saveas(hfig,[GraphDirectoryName filesep M_.fname,'_smoothedshocks_occbin',int2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[GraphDirectoryName filesep M_.fname,'_smoothedshocks_occbin',int2str(ifig)],options_.nodisplay,options_.graph_format); end end end diff --git a/matlab/+occbin/IVF_core.m b/matlab/+occbin/IVF_core.m index ad943bafb..82cacf2a1 100644 --- a/matlab/+occbin/IVF_core.m +++ b/matlab/+occbin/IVF_core.m @@ -65,13 +65,13 @@ opts_simul.piecewise_only = 1; filtered_errs=zeros(sample_length,n_obs); if options_.occbin.likelihood.waitbar - hh = dyn_waitbar(0,'IVF_core: Filtering the shocks'); - set(hh,'Name','IVF_core: Filtering the shocks.'); + hh_fig = dyn_waitbar(0,'IVF_core: Filtering the shocks'); + set(hh_fig,'Name','IVF_core: Filtering the shocks.'); end for this_period=1:sample_length if options_.occbin.likelihood.waitbar - dyn_waitbar(this_period/sample_length, hh, sprintf('Period %u of %u', this_period,sample_length)); + dyn_waitbar(this_period/sample_length, hh_fig, sprintf('Period %u of %u', this_period,sample_length)); end current_obs = obs(this_period,:); init_val_old = init_val; @@ -89,7 +89,7 @@ for this_period=1:sample_length filtered_errs=NaN; error_code(1) = 304; error_code(4) = 1000; - if options_.occbin.likelihood.waitbar; dyn_waitbar_close(hh); end + if options_.occbin.likelihood.waitbar; dyn_waitbar_close(hh_fig); end return end filtered_errs(this_period,inan)=err_vals_out'; @@ -103,7 +103,7 @@ for this_period=1:sample_length error_code(1) = 306; error_code(4) = max(abs(err_vals_out))/1000; filtered_errs=NaN; - if options_.occbin.likelihood.waitbar; dyn_waitbar_close(hh); end + if options_.occbin.likelihood.waitbar; dyn_waitbar_close(hh_fig); end return end if max(abs(resids(this_period,:)))>0.001 @@ -112,12 +112,12 @@ for this_period=1:sample_length filtered_errs=NaN; error_code(1) = 303; error_code(4) = max(abs(resids(this_period,:)))*100; - if options_.occbin.likelihood.waitbar; dyn_waitbar_close(hh); end + if options_.occbin.likelihood.waitbar; dyn_waitbar_close(hh_fig); end return end end if options_.occbin.likelihood.waitbar - dyn_waitbar_close(hh); + dyn_waitbar_close(hh_fig); end end \ No newline at end of file diff --git a/matlab/+occbin/graph.m b/matlab/+occbin/graph.m index 8aafca77a..938d4f636 100644 --- a/matlab/+occbin/graph.m +++ b/matlab/+occbin/graph.m @@ -8,7 +8,7 @@ function graph(M_, options_, options_occbin_, oo_, var_list) % - oo_ [structure] Matlab's structure containing the results % - var_list [char] list of the variables to plot -% Copyright © 2021 Dynare Team +% Copyright © 2021-2023 Dynare Team % % This file is part of Dynare. % @@ -79,7 +79,7 @@ end [nbplt,nr,nc,lr,lc,nstar] = pltorg(number_of_plots_to_draw_endo+number_of_plots_to_draw_exo); for fig = 1:nbplt - hh = dyn_figure(options_.nodisplay,'Name',['Occbin simulated paths, figure ' int2str(fig)]); + hh_fig = dyn_figure(options_.nodisplay,'Name',['Occbin simulated paths, figure ' int2str(fig)]); for plt = 1:nstar if fig==nbplt && ~lr==0 subplot(lr,lc,plt); @@ -121,7 +121,7 @@ for fig = 1:nbplt break end end - dyn_saveas(hh,[M_.dname, '/graphs/' M_.fname '_occbin_' int2str(fig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[M_.dname, '/graphs/' M_.fname '_occbin_' int2str(fig)],options_.nodisplay,options_.graph_format); if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\centering \n'); diff --git a/matlab/+occbin/solve_one_constraint.m b/matlab/+occbin/solve_one_constraint.m index 2f7834df9..54ff78cfb 100644 --- a/matlab/+occbin/solve_one_constraint.m +++ b/matlab/+occbin/solve_one_constraint.m @@ -114,13 +114,13 @@ else end if opts_simul_.waitbar - hh = dyn_waitbar(0,'Occbin: Solving the model'); - set(hh,'Name','Occbin: Solving the model.'); + hh_fig = dyn_waitbar(0,'Occbin: Solving the model'); + set(hh_fig,'Name','Occbin: Solving the model.'); end for shock_period = 1:n_shocks_periods if opts_simul_.waitbar - dyn_waitbar(shock_period/n_shocks_periods, hh, sprintf('Period %u of %u', shock_period,n_shocks_periods)); + dyn_waitbar(shock_period/n_shocks_periods, hh_fig, sprintf('Period %u of %u', shock_period,n_shocks_periods)); end regime_change_this_iteration=true; @@ -312,7 +312,7 @@ for shock_period = 1:n_shocks_periods if periodic_solution disp_verbose(['Max error:' num2str(merr) '.'],opts_simul_.debug) else - if opts_simul_.waitbar; dyn_waitbar_close(hh); end + if opts_simul_.waitbar; dyn_waitbar_close(hh_fig); end error_flag = 310; return end @@ -324,7 +324,7 @@ for shock_period = 1:n_shocks_periods disp_verbose('Did not converge -- increase maxit.',opts_simul_.debug) error_flag = 311; end - if opts_simul_.waitbar; dyn_waitbar_close(hh); end + if opts_simul_.waitbar; dyn_waitbar_close(hh_fig); end return end else @@ -333,7 +333,7 @@ for shock_period = 1:n_shocks_periods end if any(error_code_period) disp_verbose('Increase nperiods.',opts_simul_.debug) - if opts_simul_.waitbar; dyn_waitbar_close(hh); end + if opts_simul_.waitbar; dyn_waitbar_close(hh_fig); end error_flag = 312; return end @@ -363,5 +363,5 @@ if ~opts_simul_.piecewise_only end if opts_simul_.waitbar - dyn_waitbar_close(hh); + dyn_waitbar_close(hh_fig); end diff --git a/matlab/+occbin/solve_two_constraints.m b/matlab/+occbin/solve_two_constraints.m index eab9c269b..79dadc869 100644 --- a/matlab/+occbin/solve_two_constraints.m +++ b/matlab/+occbin/solve_two_constraints.m @@ -124,13 +124,13 @@ else end if opts_simul_.waitbar - hh = dyn_waitbar(0,'Occbin: Solving the model'); - set(hh,'Name','Occbin: Solving the model.'); + hh_fig = dyn_waitbar(0,'Occbin: Solving the model'); + set(hh_fig,'Name','Occbin: Solving the model.'); end for shock_period = 1:n_shocks_periods if opts_simul_.waitbar - dyn_waitbar(shock_period/n_shocks_periods, hh, sprintf('Period %u of %u', shock_period,n_shocks_periods)); + dyn_waitbar(shock_period/n_shocks_periods, hh_fig, sprintf('Period %u of %u', shock_period,n_shocks_periods)); end regime_change_this_iteration=true; nperiods_endogenously_increased = false; @@ -348,7 +348,7 @@ for shock_period = 1:n_shocks_periods disp_verbose(['Max error:' num2str(min_err) '.'],opts_simul_.debug) else error_flag = 310; - if opts_simul_.waitbar; dyn_waitbar_close(hh); end + if opts_simul_.waitbar; dyn_waitbar_close(hh_fig); end return; end else @@ -359,7 +359,7 @@ for shock_period = 1:n_shocks_periods disp_verbose('Did not converge -- increase maxit.',opts_simul_.debug) error_flag = 311; end - if opts_simul_.waitbar; dyn_waitbar_close(hh); end + if opts_simul_.waitbar; dyn_waitbar_close(hh_fig); end return; end else @@ -371,7 +371,7 @@ for shock_period = 1:n_shocks_periods if any(error_code_period) disp_verbose('Increase nperiods.',opts_simul_.debug) error_flag = 312; - if opts_simul_.waitbar; dyn_waitbar_close(hh); end + if opts_simul_.waitbar; dyn_waitbar_close(hh_fig); end return; end @@ -396,5 +396,5 @@ if ~opts_simul_.piecewise_only end if opts_simul_.waitbar - dyn_waitbar_close(hh); + dyn_waitbar_close(hh_fig); end diff --git a/matlab/DSMH_sampler.m b/matlab/DSMH_sampler.m index f1724a560..35621f8ff 100644 --- a/matlab/DSMH_sampler.m +++ b/matlab/DSMH_sampler.m @@ -33,7 +33,7 @@ function DSMH_sampler(TargetFun,xparam1,mh_bounds,dataset_,dataset_info,options_ % Then the comments write here can be used for all the other pairs of % parallel functions and also for management functions. -% Copyright © 2006-2022 Dynare Team +% Copyright © 2006-2023 Dynare Team % % This file is part of Dynare. % @@ -125,7 +125,7 @@ if TeX NAMES = []; TeXNAMES = []; end -hh = dyn_figure(options_.nodisplay,'Name','Parameters Densities'); +hh_fig = dyn_figure(options_.nodisplay,'Name','Parameters Densities'); for k=1:npar %min(nstar,npar-(plt-1)*nstar) subplot(ceil(sqrt(npar)),floor(sqrt(npar)),k) %kk = (plt-1)*nstar+k; @@ -144,7 +144,7 @@ for k=1:npar %min(nstar,npar-(plt-1)*nstar) axis tight drawnow end -dyn_saveas(hh,[ M_.fname '_param_density' int2str(plt) ],options_.nodisplay,options_.graph_format); +dyn_saveas(hh_fig,[ M_.fname '_param_density' int2str(plt) ],options_.nodisplay,options_.graph_format); if TeX && any(strcmp('eps',cellstr(options_.graph_format))) % TeX eps loader file fprintf(fidTeX,'\\begin{figure}[H]\n'); diff --git a/matlab/Herbst_Schorfheide_sampler.m b/matlab/Herbst_Schorfheide_sampler.m index b73b8f87b..8db32815f 100644 --- a/matlab/Herbst_Schorfheide_sampler.m +++ b/matlab/Herbst_Schorfheide_sampler.m @@ -33,7 +33,7 @@ function Herbst_Schorfheide_sampler(TargetFun,xparam1,mh_bounds,dataset_,dataset % Then the comments write here can be used for all the other pairs of % parallel functions and also for management functions. -% Copyright © 2006-2022 Dynare Team +% Copyright © 2006-2023 Dynare Team % % This file is part of Dynare. % @@ -152,7 +152,7 @@ if TeX NAMES = []; TeXNAMES = []; end -hh = dyn_figure(options_.nodisplay,'Name','Parameters Densities'); +hh_fig = dyn_figure(options_.nodisplay,'Name','Parameters Densities'); for k=1:npar %min(nstar,npar-(plt-1)*nstar) subplot(ceil(sqrt(npar)),floor(sqrt(npar)),k) %kk = (plt-1)*nstar+k; @@ -171,7 +171,7 @@ for k=1:npar %min(nstar,npar-(plt-1)*nstar) axis tight drawnow end -dyn_saveas(hh,[ M_.fname '_param_density' int2str(plt) ],options_.nodisplay,options_.graph_format); +dyn_saveas(hh_fig,[ M_.fname '_param_density' int2str(plt) ],options_.nodisplay,options_.graph_format); if TeX && any(strcmp('eps',cellstr(options_.graph_format))) % TeX eps loader file fprintf(fidTeX,'\\begin{figure}[H]\n'); diff --git a/matlab/MakeAllFigures.m b/matlab/MakeAllFigures.m index 2e18af357..e14f86579 100644 --- a/matlab/MakeAllFigures.m +++ b/matlab/MakeAllFigures.m @@ -1,6 +1,6 @@ function MakeAllFigures(NumberOfPlots,Caption,FigureProperties,Info) -% Copyright © 2005-2017 Dynare Team +% Copyright © 2005-2023 Dynare Team % % This file is part of Dynare. % @@ -97,45 +97,45 @@ for plt = 1:NumberOfPlots subplot(nr,nc,plt) hold on for curve = 1:NumberOfCurves - hh = plot(x{curve},y{curve}); + hh_fig = plot(x{curve},y{curve}); if strcmpi(PltType{curve},'PriorDensity') - set(hh,'Color',[0.7 0.7 0.7],'LineStyle','-','LineWidth',2) + set(hh_fig,'Color',[0.7 0.7 0.7],'LineStyle','-','LineWidth',2) % % elseif strcmpi(PltType{curve},'DensityEstimate') - set(hh,'Color','k','LineStyle','-','LineWidth',2) + set(hh_fig,'Color','k','LineStyle','-','LineWidth',2) % % elseif strcmpi(PltType{curve},'ModeEstimate') - set(hh,'Color','g','LineStyle','--','LineWidth',2) + set(hh_fig,'Color','g','LineStyle','--','LineWidth',2) % % elseif strcmpi(PltType{curve},'SmoothVariable') - set(hh,'Color','k','LineStyle','-','LineWidth',2) + set(hh_fig,'Color','k','LineStyle','-','LineWidth',2) % % elseif strcmpi(PltType{curve},'Deciles') - set(hh,'Color','g','LineStyle','-','LineWidth',1) + set(hh_fig,'Color','g','LineStyle','-','LineWidth',1) % % elseif strcmpi(PltType{curve},'Forecasts') - set(hh,'Color','','LineStyle','-','LineWidth',2) + set(hh_fig,'Color','','LineStyle','-','LineWidth',2) % % elseif strcmpi(PltType{curve},'ForecastsHPD') - set(hh,'Color','k','LineStyle','-','LineWidth',1) + set(hh_fig,'Color','k','LineStyle','-','LineWidth',1) % % elseif strcmpi(PltType{curve},'ForecastsDeciles') - set(hh,'Color','g','LineStyle','-','LineWidth',1) + set(hh_fig,'Color','g','LineStyle','-','LineWidth',1) % % elseif strcmpi(PltType{curve},'DiagnosticWithin') - set(hh,'Color','b','LineStyle','-','LineWidth',2) + set(hh_fig,'Color','b','LineStyle','-','LineWidth',2) % % elseif strcmpi(PltType{curve},'DiagnosticPooled') - set(hh,'Color','r','LineStyle','-','LineWidth',2) + set(hh_fig,'Color','r','LineStyle','-','LineWidth',2) % % end diff --git a/matlab/PlotPosteriorDistributions.m b/matlab/PlotPosteriorDistributions.m index 376810db2..7da52aa72 100644 --- a/matlab/PlotPosteriorDistributions.m +++ b/matlab/PlotPosteriorDistributions.m @@ -128,8 +128,8 @@ for i=1:npar borneinf = min(binf1, binf2); bornesup = max(bsup1, bsup2); subplot(nn, nn, subplotnum) - hh_fig = plot(x2, f2, '-k', 'linewidth', 2); - set(hh_fig, 'color', [0.7 0.7 0.7]); + hh_plt = plot(x2, f2, '-k', 'linewidth', 2); + set(hh_plt, 'color', [0.7 0.7 0.7]); hold on; plot(x1, f1, '-k', 'linewidth', 2); if ~options_.mh_posterior_mode_estimation diff --git a/matlab/PosteriorIRF_core2.m b/matlab/PosteriorIRF_core2.m index f9fa28ab9..73ea4c493 100644 --- a/matlab/PosteriorIRF_core2.m +++ b/matlab/PosteriorIRF_core2.m @@ -30,7 +30,7 @@ function myoutput=PosteriorIRF_core2(myinputs,fpar,npar,whoiam,ThisMatlab) % SPECIAL REQUIREMENTS. % None. % -% Copyright © 2006-2018 Dynare Team +% Copyright © 2006-2023 Dynare Team % % This file is part of Dynare. % @@ -103,12 +103,12 @@ for i=fpar:npar if max(abs(MeanIRF(:,j,i))) >= options_.impulse_responses.plot_threshold subplotnum = subplotnum+1; if subplotnum == 1 && options_.relative_irf - hh = dyn_figure(options_.nodisplay,'Name',['Relative response to orthogonalized shock to ' tit{i}]); + hh_fig = dyn_figure(options_.nodisplay,'Name',['Relative response to orthogonalized shock to ' tit{i}]); elseif subplotnum == 1 && ~options_.relative_irf - hh = dyn_figure(options_.nodisplay,'Name',['Orthogonalized shock to ' tit{i}]); + hh_fig = dyn_figure(options_.nodisplay,'Name',['Orthogonalized shock to ' tit{i}]); end - set(0,'CurrentFigure',hh) + set(0,'CurrentFigure',hh_fig) subplot(nn,nn,subplotnum); if ~MAX_nirfs_dsgevar if ~isnan(min(HPDIRF(:,1,j,i))) @@ -155,7 +155,7 @@ for i=fpar:npar if subplotnum == MaxNumberOfPlotPerFigure || (j == nvar && subplotnum> 0) figunumber = figunumber+1; - dyn_saveas(hh,[DirectoryName '/' M_.fname '_Bayesian_IRF_' tit{i} '_' int2str(figunumber)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[DirectoryName '/' M_.fname '_Bayesian_IRF_' tit{i} '_' int2str(figunumber)],options_.nodisplay,options_.graph_format); if RemoteFlag==1 OutputFileName = [OutputFileName; {[DirectoryName,filesep], [M_.fname '_Bayesian_IRF_' deblank(tit(i,:)) '_' int2str(figunumber) '.*']}]; end diff --git a/matlab/UnivariateSpectralDensity.m b/matlab/UnivariateSpectralDensity.m index d829ba3f3..862dde5e6 100644 --- a/matlab/UnivariateSpectralDensity.m +++ b/matlab/UnivariateSpectralDensity.m @@ -19,7 +19,7 @@ function [oo_] = UnivariateSpectralDensity(M_,oo_,options_,var_list) % Adapted from th_autocovariances.m. -% Copyright © 2006-2020 Dynare Team +% Copyright © 2006-2023 Dynare Team % % This file is part of Dynare. % @@ -155,12 +155,12 @@ if ~options_.nograph end for i= 1:nvar - hh = dyn_figure(options_.nodisplay,'Name',['Spectral Density of ' M_.endo_names{ivar(i)} '.']); + hh_fig = dyn_figure(options_.nodisplay,'Name',['Spectral Density of ' M_.endo_names{ivar(i)} '.']); plot(freqs,f(i,:),'-k','linewidth',2) xlabel('0 \leq \omega \leq \pi') ylabel('f(\omega)') box on axis tight - dyn_saveas(hh,[M_.dname ,filesep,'graphs', filesep, 'SpectralDensity_' M_.endo_names{ivar(i)}],options_.nodisplay,options_.graph_format) + dyn_saveas(hh_fig,[M_.dname ,filesep,'graphs', filesep, 'SpectralDensity_' M_.endo_names{ivar(i)}],options_.nodisplay,options_.graph_format) end end diff --git a/matlab/calibrate_mh_scale_parameter.m b/matlab/calibrate_mh_scale_parameter.m index af940fb33..0a5d0a253 100644 --- a/matlab/calibrate_mh_scale_parameter.m +++ b/matlab/calibrate_mh_scale_parameter.m @@ -20,7 +20,7 @@ function Scale = calibrate_mh_scale_parameter(ObjectiveFunction, CovarianceMatri -% Copyright © 2020-2021 Dynare Team +% Copyright © 2020-2023 Dynare Team % % This file is part of Dynare. % @@ -38,8 +38,8 @@ function Scale = calibrate_mh_scale_parameter(ObjectiveFunction, CovarianceMatri % along with Dynare. If not, see . % Fire up the wait bar -hh = dyn_waitbar(0,'Tuning of the scale parameter...'); -set(hh,'Name','Tuning of the scale parameter.'); +hh_fig = dyn_waitbar(0,'Tuning of the scale parameter...'); +set(hh_fig,'Name','Tuning of the scale parameter.'); % Intilialize various counters. j = 1; jj = 1; isux = 0; jsux = 0; i = 0; @@ -100,7 +100,7 @@ while j<=options.maxiter prtfrc = j/options.maxiter; % Update the waitbar if ~mod(j, 10) - dyn_waitbar(prtfrc, hh, sprintf('Acceptance ratio [during last %u]: %f [%f]', options.stepsize, isux/j, jsux/jj)); + dyn_waitbar(prtfrc, hh_fig, sprintf('Acceptance ratio [during last %u]: %f [%f]', options.stepsize, isux/j, jsux/jj)); end % Adjust the value of the scale parameter. if ~mod(j, options.stepsize) @@ -135,4 +135,4 @@ while j<=options.maxiter jj = jj + 1; end -dyn_waitbar_close(hh); \ No newline at end of file +dyn_waitbar_close(hh_fig); \ No newline at end of file diff --git a/matlab/dynare_estimation.m b/matlab/dynare_estimation.m index 15ef024f2..14e90d403 100644 --- a/matlab/dynare_estimation.m +++ b/matlab/dynare_estimation.m @@ -12,7 +12,7 @@ function oo_recursive_=dynare_estimation(var_list,dname) % SPECIAL REQUIREMENTS % none -% Copyright © 2003-2021 Dynare Team +% Copyright © 2003-2023 Dynare Team % % This file is part of Dynare. % @@ -164,7 +164,7 @@ if nnobs > 1 && horizon > 0 for i = 1:length(var_list) if mod(i,nstar) == 1 plot_index=plot_index+1; - hfig = dyn_figure(options_.nodisplay,'Name',['Out of sample forecasts (',num2str(plot_index),')']); + hh_fig = dyn_figure(options_.nodisplay,'Name',['Out of sample forecasts (',num2str(plot_index),')']); m = 1; end subplot(nr,nc,m) @@ -221,7 +221,7 @@ if nnobs > 1 && horizon > 0 xlim([nobs(1)-offsetx nobs(end)+horizon]) m = m + 1; if mod(i+1,nstar) == 1 || i==length(var_list) - dyn_saveas(hfig,[M_.dname,filesep,'graphs',filesep M_.fname '_RecursiveForecasts_' int2str(plot_index)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[M_.dname,filesep,'graphs',filesep M_.fname '_RecursiveForecasts_' int2str(plot_index)],options_.nodisplay,options_.graph_format); end end end diff --git a/matlab/dyntable.m b/matlab/dyntable.m index 29d0b6c9a..47d24fc29 100644 --- a/matlab/dyntable.m +++ b/matlab/dyntable.m @@ -15,7 +15,7 @@ function dyntable(options_, title, headers, labels, values, label_width, val_wid % OUTPUTS % none -% Copyright © 2002-2022 Dynare Team +% Copyright © 2002-2023 Dynare Team % % This file is part of Dynare. % @@ -73,11 +73,11 @@ if nargin==9 end if length(headers) > 0 - hh = sprintf(label_format_leftbound , headers{1}); + hh_tbl = sprintf(label_format_leftbound , headers{1}); for i=2:length(headers) - hh = [hh sprintf(header_string_format, headers{i})]; + hh_tbl = [hh_tbl sprintf(header_string_format, headers{i})]; end - disp(hh) + disp(hh_tbl) end for i=1:size(values,1) diff --git a/matlab/ep/extended_path.m b/matlab/ep/extended_path.m index 0b4bfb1ef..d94aa1f0b 100644 --- a/matlab/ep/extended_path.m +++ b/matlab/ep/extended_path.m @@ -19,7 +19,7 @@ function [ts, DynareResults] = extended_path(initialconditions, samplesize, exog % % SPECIAL REQUIREMENTS -% Copyright © 2009-2020 Dynare Team +% Copyright © 2009-2023 Dynare Team % % This file is part of Dynare. % @@ -46,8 +46,8 @@ endogenous_variables_paths = NaN(DynareModel.endo_nbr,samplesize+1); endogenous_variables_paths(:,1) = initialconditions; % Set waitbar (graphic or text mode) -hh = dyn_waitbar(0,'Please wait. Extended Path simulations...'); -set(hh,'Name','EP simulations.'); +hh_fig = dyn_waitbar(0,'Please wait. Extended Path simulations...'); +set(hh_fig,'Name','EP simulations.'); % Initialize while-loop index. t = 1; @@ -55,7 +55,7 @@ t = 1; % Main loop. while (t <= samplesize) if ~mod(t,10) - dyn_waitbar(t/samplesize,hh,'Please wait. Extended Path simulations...'); + dyn_waitbar(t/samplesize,hh_fig,'Please wait. Extended Path simulations...'); end % Set period index. t = t+1; @@ -83,7 +83,7 @@ while (t <= samplesize) end % (while) loop over t % Close waitbar. -dyn_waitbar_close(hh); +dyn_waitbar_close(hh_fig); % Set the initial period. if isdates(DynareOptions.initial_period) diff --git a/matlab/forecast_graphs.m b/matlab/forecast_graphs.m index fffcbe359..6bc15522f 100644 --- a/matlab/forecast_graphs.m +++ b/matlab/forecast_graphs.m @@ -8,7 +8,7 @@ function forecast_graphs(var_list,M_, oo_,options_) % o oo_ outputs structure % o options_ options structure -% Copyright © 2008-2018 Dynare Team +% Copyright © 2008-2023 Dynare Team % % This file is part of Dynare. % @@ -61,11 +61,11 @@ end m = 1; n_fig = 1; -hh = dyn_figure(options_.nodisplay, 'Name', 'Forecasts (I)'); +hh_fig = dyn_figure(options_.nodisplay, 'Name', 'Forecasts (I)'); for j= 1:nvar if m > nc*nr - dyn_saveas(hh,[ dname '/graphs/forcst' int2str(n_fig)], options_.nodisplay, options_.graph_format); + dyn_saveas(hh_fig,[ dname '/graphs/forcst' int2str(n_fig)], options_.nodisplay, options_.graph_format); if options_.TeX && any(strcmp('eps', cellstr(options_.graph_format))) fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\centering \n'); @@ -76,7 +76,7 @@ for j= 1:nvar fprintf(fidTeX,' \n'); end n_fig =n_fig+1; - eval(['hh=dyn_figure(options_.nodisplay,''Name'',''Forecasts (' int2str(n_fig) ')'');']); + eval(['hh_fig=dyn_figure(options_.nodisplay,''Name'',''Forecasts (' int2str(n_fig) ')'');']); m = 1; end subplot(nr, nc, m); @@ -99,7 +99,7 @@ for j= 1:nvar end if m > 1 - dyn_saveas(hh,[dname '/graphs/forcst' int2str(n_fig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dname '/graphs/forcst' int2str(n_fig)],options_.nodisplay,options_.graph_format); if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\centering \n'); @@ -124,10 +124,10 @@ if isfield(oo_.forecast,'HPDinf_ME') m = 1; n_fig = 1; - hh=dyn_figure(options_.nodisplay,'Name','Forecasts including ME (I)'); + hh_fig=dyn_figure(options_.nodisplay,'Name','Forecasts including ME (I)'); for j= 1:length(var_names) if m > nc*nr - dyn_saveas(hh,[ dname '/graphs/forcst_ME' int2str(n_fig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[ dname '/graphs/forcst_ME' int2str(n_fig)],options_.nodisplay,options_.graph_format); if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\centering \n'); @@ -138,7 +138,7 @@ if isfield(oo_.forecast,'HPDinf_ME') fprintf(fidTeX,' \n'); end n_fig =n_fig+1; - eval(['hh=dyn_figure(options_.nodisplay,''Name'',''Forecasts (' int2str(n_fig) ')'');']); + eval(['hh_fig=dyn_figure(options_.nodisplay,''Name'',''Forecasts (' int2str(n_fig) ')'');']); m = 1; end subplot(nr,nc,m); @@ -162,7 +162,7 @@ if isfield(oo_.forecast,'HPDinf_ME') end if m > 1 - dyn_saveas(hh,[dname '/graphs/forcst_ME' int2str(n_fig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dname '/graphs/forcst_ME' int2str(n_fig)],options_.nodisplay,options_.graph_format); if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\centering \n'); diff --git a/matlab/gsa/filt_mc_.m b/matlab/gsa/filt_mc_.m index 02549596c..ebe9ca9ee 100644 --- a/matlab/gsa/filt_mc_.m +++ b/matlab/gsa/filt_mc_.m @@ -391,7 +391,7 @@ else end if mod(i,9)==1 ifig=ifig+1; - hh=dyn_figure(options_.nodisplay,'name',[temp_name,' ',int2str(ifig)]); + hh_fig=dyn_figure(options_.nodisplay,'name',[temp_name,' ',int2str(ifig)]); end subplot(3,3,i-9*(ifig-1)) h=cumplot(lnprior(ixx(1:nfilt0(i),i))); @@ -407,18 +407,18 @@ else annotation('textbox', [0.55,0,0.35,0.05],'String', 'Log-prior for WORSE R2', 'Color','Red','horizontalalignment','center'); end if options_.opt_gsa.ppost - dyn_saveas(hh,[OutDir filesep fname_ '_rmse_post_lnprior',int2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[OutDir filesep fname_ '_rmse_post_lnprior',int2str(ifig)],options_.nodisplay,options_.graph_format); if options_.TeX create_TeX_loader(options_,[OutDir '/' fname_ '_rmse_post_lnprior',int2str(ifig)],ifig,[temp_name,' ',int2str(ifig)],'rmse_post_lnprior',options_.figures.textwidth*min((i-9*(ifig-1))/3,1)) end else if options_.opt_gsa.pprior - dyn_saveas(hh,[OutDir filesep fname_ '_rmse_prior_lnprior',int2str(ifig) ],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[OutDir filesep fname_ '_rmse_prior_lnprior',int2str(ifig) ],options_.nodisplay,options_.graph_format); if options_.TeX create_TeX_loader(options_,[OutDir '/' fname_ '_rmse_prior_lnprior',int2str(ifig)],ifig,[temp_name,' ',int2str(ifig)],'rmse_prior_lnprior',options_.figures.textwidth*min((i-9*(ifig-1))/3,1)) end else - dyn_saveas(hh,[OutDir filesep fname_ '_rmse_mc_lnprior',int2str(ifig) ],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[OutDir filesep fname_ '_rmse_mc_lnprior',int2str(ifig) ],options_.nodisplay,options_.graph_format); if options_.TeX create_TeX_loader(options_,[OutDir '/' fname_ '_rmse_mc_lnprior',int2str(ifig)],ifig,[temp_name,' ',int2str(ifig)],'rmse_mc_lnprior',options_.figures.textwidth*min((i-9*(ifig-1))/3,1)) end @@ -439,7 +439,7 @@ else end if mod(i,9)==1 ifig=ifig+1; - hh = dyn_figure(options_.nodisplay,'Name',[temp_name,' ',int2str(ifig)]); + hh_fig = dyn_figure(options_.nodisplay,'Name',[temp_name,' ',int2str(ifig)]); end subplot(3,3,i-9*(ifig-1)) h=cumplot(likelihood(ixx(1:nfilt0(i),i))); @@ -458,18 +458,18 @@ else annotation('textbox', [0.55,0,0.35,0.05],'String', 'Log-likelihood for WORSE R2', 'Color','Red','horizontalalignment','center'); end if options_.opt_gsa.ppost - dyn_saveas(hh,[OutDir filesep fname_ '_rmse_post_lnlik',int2str(ifig) ],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[OutDir filesep fname_ '_rmse_post_lnlik',int2str(ifig) ],options_.nodisplay,options_.graph_format); if options_.TeX create_TeX_loader(options_,[OutDir filesep fname_ '_rmse_post_lnprior',int2str(ifig)],ifig,[temp_name,' ',int2str(ifig)],'rmse_post_lnprior',options_.figures.textwidth*min((i-9*(ifig-1))/3,1)); end else if options_.opt_gsa.pprior - dyn_saveas(hh,[OutDir filesep fname_ '_rmse_prior_lnlik',int2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[OutDir filesep fname_ '_rmse_prior_lnlik',int2str(ifig)],options_.nodisplay,options_.graph_format); if options_.TeX create_TeX_loader(options_,[OutDir filesep fname_ '_rmse_prior_lnlik',int2str(ifig)],ifig,[temp_name,' ',int2str(ifig)],'rmse_prior_lnlik',options_.figures.textwidth*min((i-9*(ifig-1))/3,1)); end else - dyn_saveas(hh,[OutDir filesep fname_ '_rmse_mc_lnlik',int2str(ifig) ],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[OutDir filesep fname_ '_rmse_mc_lnlik',int2str(ifig) ],options_.nodisplay,options_.graph_format); if options_.TeX create_TeX_loader(options_,[OutDir filesep fname_ '_rmse_mc_lnlik',int2str(ifig) ],ifig,[temp_name,' ',int2str(ifig)],'rmse_mc_lnlik',options_.figures.textwidth*min((i-9*(ifig-1))/3,1)); end @@ -490,7 +490,7 @@ else end if mod(i,9)==1 ifig=ifig+1; - hh = dyn_figure(options_.nodisplay,'Name',[temp_name,' ',int2str(ifig)]); + hh_fig = dyn_figure(options_.nodisplay,'Name',[temp_name,' ',int2str(ifig)]); end subplot(3,3,i-9*(ifig-1)) h=cumplot(logpo2(ixx(1:nfilt0(i),i))); @@ -509,18 +509,18 @@ else annotation('textbox', [0.55,0,0.35,0.05],'String', 'Log-posterior for WORSE R2', 'Color','Red','horizontalalignment','center'); end if options_.opt_gsa.ppost - dyn_saveas(hh,[OutDir filesep fname_ '_rmse_post_lnpost',int2str(ifig) ],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[OutDir filesep fname_ '_rmse_post_lnpost',int2str(ifig) ],options_.nodisplay,options_.graph_format); if options_.TeX create_TeX_loader(options_,[OutDir filesep fname_ '_rmse_post_lnpost',int2str(ifig) ],ifig,[temp_name,' ',int2str(ifig)],'rmse_post_lnpost',options_.figures.textwidth*min((i-9*(ifig-1))/3,1)); end else if options_.opt_gsa.pprior - dyn_saveas(hh,[OutDir filesep fname_ '_rmse_prior_lnpost',int2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[OutDir filesep fname_ '_rmse_prior_lnpost',int2str(ifig)],options_.nodisplay,options_.graph_format); if options_.TeX create_TeX_loader(options_,[OutDir filesep fname_ '_rmse_prior_lnpost',int2str(ifig)],ifig,[temp_name,' ',int2str(ifig)],'rmse_prior_lnpost',options_.figures.textwidth*min((i-9*(ifig-1))/3,1)); end else - dyn_saveas(hh,[OutDir filesep fname_ '_rmse_mc_lnpost',int2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[OutDir filesep fname_ '_rmse_mc_lnpost',int2str(ifig)],options_.nodisplay,options_.graph_format); if options_.TeX create_TeX_loader(options_,[OutDir filesep fname_ '_rmse_mc_lnpost',int2str(ifig)],ifig,[temp_name,' ',int2str(ifig)],'rmse_mc_lnpost',options_.figures.textwidth*min((i-9*(ifig-1))/3,1)); end @@ -746,7 +746,7 @@ else for iy = 1:length(vvarvecm) ipar = find(any(squeeze(PPV(iy,:,:))1.e-10 if mod(iplo,9)==0 && isempty(threshold) && ~options_.nograph ifig=ifig+1; - hfig = dyn_figure(options_.nodisplay,'name',['Reduced Form Mapping: ', namendo,' vs shocks ',int2str(ifig)]); + hh_fig = dyn_figure(options_.nodisplay,'name',['Reduced Form Mapping: ', namendo,' vs shocks ',int2str(ifig)]); iplo=0; end iplo=iplo+1; @@ -273,7 +273,7 @@ for j = 1:length(anamendo) end if isempty(threshold) && ~options_.nograph - figure(hfig) + figure(hh_fig) subplot(3,3,iplo), if ilog [saso, iso] = sort(-silog(:,js)); @@ -292,7 +292,7 @@ for j = 1:length(anamendo) end title([logflag,' ',namendo,' vs ',namexo],'interpreter','none') if iplo==9 - dyn_saveas(hfig,[dirname,filesep,M_.fname,'_redform_', namendo,'_vs_shocks_',logflag,num2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,filesep,M_.fname,'_redform_', namendo,'_vs_shocks_',logflag,num2str(ifig)],options_.nodisplay,options_.graph_format); create_TeX_loader(options_,[dirname,filesep,M_.fname,'_redform_', namendo,'_vs_shocks_',logflag,num2str(ifig)],[logflag,' ',strrep(namendo,'_','\_'),' vs ',strrep(namexo,'_','\_')],['redform_', namendo,'_vs_shocks_',logflag,num2str(ifig)],1) end end @@ -303,7 +303,7 @@ for j = 1:length(anamendo) end end if iplo<9 && iplo>0 && ifig && ~options_.nograph - dyn_saveas(hfig,[dirname,filesep,M_.fname,'_redform_', namendo,'_vs_shocks_',logflag,num2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,filesep,M_.fname,'_redform_', namendo,'_vs_shocks_',logflag,num2str(ifig)],options_.nodisplay,options_.graph_format); create_TeX_loader(options_,[dirname,filesep,M_.fname,'_redform_', namendo,'_vs_shocks_',logflag,num2str(ifig)],[logflag,' ',strrep(namendo,'_','\_'),' vs ',strrep(namexo,'_','\_')],['redform_', namendo,'_vs_shocks_',logflag,num2str(ifig)],options_.figures.textwidth*min(iplo/3,1)) end ifig=0; @@ -320,7 +320,7 @@ for j = 1:length(anamendo) if (max(y0)-min(y0))>1.e-10 if mod(iplo,9)==0 && isempty(threshold) && ~options_.nograph ifig=ifig+1; - hfig = dyn_figure(options_.nodisplay,'name',['Reduced Form Mapping: ' namendo,' vs lags ',int2str(ifig)]); + hh_fig = dyn_figure(options_.nodisplay,'name',['Reduced Form Mapping: ' namendo,' vs lags ',int2str(ifig)]); iplo=0; end iplo=iplo+1; @@ -429,7 +429,7 @@ for j = 1:length(anamendo) end if isempty(threshold) && ~options_.nograph - figure(hfig), + figure(hh_fig), subplot(3,3,iplo), if ilog [saso, iso] = sort(-silog(:,js)); @@ -448,7 +448,7 @@ for j = 1:length(anamendo) end title([logflag,' ',namendo,' vs ',namlagendo,'(-1)'],'interpreter','none') if iplo==9 - dyn_saveas(hfig,[dirname,filesep,M_.fname,'_redform_', namendo,'_vs_lags_',logflag,num2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,filesep,M_.fname,'_redform_', namendo,'_vs_lags_',logflag,num2str(ifig)],options_.nodisplay,options_.graph_format); create_TeX_loader(options_,[dirname,filesep,M_.fname,'_redform_', namendo,'_vs_lags_',logflag,num2str(ifig)],[logflag,' ',strrep(namendo,'_','\_'),' vs ',strrep(namlagendo,'_','\_'),'(-1)'],['redform_', namendo,'_vs_lags_',logflag,':',num2str(ifig)],1) end end @@ -459,14 +459,14 @@ for j = 1:length(anamendo) end end if iplo<9 && iplo>0 && ifig && ~options_.nograph - dyn_saveas(hfig,[dirname,filesep,M_.fname,'_redform_', namendo,'_vs_lags_',logflag,num2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,filesep,M_.fname,'_redform_', namendo,'_vs_lags_',logflag,num2str(ifig)],options_.nodisplay,options_.graph_format); create_TeX_loader(options_,[dirname,filesep,M_.fname,'_redform_', namendo,'_vs_lags_',logflag,num2str(ifig)],[logflag,' ',strrep(namendo,'_','\_'),' vs ',strrep(namlagendo,'_','\_'),'(-1)'],['redform_', namendo,'_vs_lags_',logflag,':',num2str(ifig)],options_.figures.textwidth*min(iplo/3,1)); end end if isempty(threshold) && ~options_.nograph if ilog==0 - hfig=dyn_figure(options_.nodisplay,'name','Reduced Form GSA'); %bar(si) + hh_fig=dyn_figure(options_.nodisplay,'name','Reduced Form GSA'); %bar(si) % boxplot(si','whis',10,'symbol','r.') myboxplot(si',[],'.',[],10) xlabel(' ') @@ -478,11 +478,11 @@ if isempty(threshold) && ~options_.nograph text(ip,-0.02,deblank(pnames(ip,:)),'rotation',90,'HorizontalAlignment','right','interpreter','none') end title('Reduced form GSA') - dyn_saveas(hfig,[dirname,filesep,M_.fname,'_redform_gsa'],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,filesep,M_.fname,'_redform_gsa'],options_.nodisplay,options_.graph_format); create_TeX_loader(options_,[dirname,filesep,M_.fname,'_redform_gsa'],'Reduced Form GSA','redform_gsa') else - hfig=dyn_figure(options_.nodisplay,'name','Reduced Form GSA'); %bar(silog) + hh_fig=dyn_figure(options_.nodisplay,'name','Reduced Form GSA'); %bar(silog) % boxplot(silog','whis',10,'symbol','r.') myboxplot(silog',[],'.',[],10) set(gca,'xticklabel',' ','fontsize',10,'xtick',[1:np]) @@ -494,7 +494,7 @@ if isempty(threshold) && ~options_.nograph text(ip,-0.02,deblank(pnames(ip,:)),'rotation',90,'HorizontalAlignment','right','interpreter','none') end title('Reduced form GSA - Log-transformed elements') - dyn_saveas(hfig,[dirname,filesep,M_.fname,'_redform_gsa_log'],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,filesep,M_.fname,'_redform_gsa_log'],options_.nodisplay,options_.graph_format); create_TeX_loader(options_,[dirname,filesep,M_.fname,'_redform_gsa_log'],'Reduced form GSA - Log-transformed elements','redform_gsa_log') end @@ -560,7 +560,7 @@ if iload==0 y1 = log(y0*isig+lam); end if ~options_.nograph - hfig=dyn_figure(options_.nodisplay,'name',options_map.figtitle); + hh_fig=dyn_figure(options_.nodisplay,'name',options_map.figtitle); subplot(221) if ilog hist(y1,30) @@ -647,7 +647,7 @@ if iload==0 gsa_.x0=x0(ifit,:); % copyfile([fname,'_est.mat'],[fname,'.mat']) if ~options_.nograph - figure(hfig); + figure(hh_fig); subplot(223), plot(y0(ifit),[gsa_.fit y0(ifit)],'.'), r2 = gsa_.r2; @@ -672,7 +672,7 @@ if iload==0 plot(yn,[yf yn],'.'), title(['Out-of-sample prediction - R2=' num2str(r2,2)],'interpreter','none') end - dyn_saveas(hfig,fname,options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,fname,options_.nodisplay,options_.graph_format); create_TeX_loader(options_,fname,['Out-of-sample prediction - R2=' num2str(r2,2)],'redform_gsa_log') if options_.nodisplay @@ -685,10 +685,10 @@ else load([fname,'_map.mat'],'gsa_') if ~options_.nograph yf = ss_anova_fcast(x0, gsa_); - hfig=dyn_figure(options_.nodisplay,'name',options_map.title); + hh_fig=dyn_figure(options_.nodisplay,'name',options_map.title); plot(y0,[yf y0],'.'), title([namy,' vs ', namx,' pred'],'interpreter','none') - dyn_saveas(hfig,[fname '_pred'],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[fname '_pred'],options_.nodisplay,options_.graph_format); create_TeX_loader(options_,[fname '_pred'],options_map.title,[namy,' vs ', namx,' pred']) end @@ -762,7 +762,7 @@ return function indmcf = redform_mcf(y0, x0, options_mcf, options_) -hfig=dyn_figure(options_.nodisplay,'name',options_mcf.amcf_title); +hh_fig=dyn_figure(options_.nodisplay,'name',options_mcf.amcf_title); [post_mean, post_median, post_var, hpd_interval, post_deciles, ... density] = posterior_moments(y0,1,0.9); @@ -813,7 +813,7 @@ if ~isoctave 'horizontalalignment','center'); end -dyn_saveas(hfig,[options_mcf.OutputDirectoryName filesep options_mcf.fname_,'_',options_mcf.amcf_name],options_.nodisplay,options_.graph_format); +dyn_saveas(hh_fig,[options_mcf.OutputDirectoryName filesep options_mcf.fname_,'_',options_mcf.amcf_name],options_.nodisplay,options_.graph_format); create_TeX_loader(options_,[options_mcf.OutputDirectoryName filesep options_mcf.fname_,'_',options_mcf.amcf_name],strrep(options_mcf.amcf_title,'_','\_'),[options_mcf.fname_,'_',options_mcf.amcf_name]) return diff --git a/matlab/gsa/redform_screen.m b/matlab/gsa/redform_screen.m index 704923f9c..c7cb31d4b 100644 --- a/matlab/gsa/redform_screen.m +++ b/matlab/gsa/redform_screen.m @@ -11,7 +11,7 @@ function redform_screen(dirname, options_gsa_) % marco.ratto@ec.europa.eu % Copyright © 2012-2016 European Commission -% Copyright © 2012-2018 Dynare Team +% Copyright © 2012-2023 Dynare Team % % This file is part of Dynare. % @@ -66,7 +66,7 @@ for j=1:size(anamendo,1) if ~isempty(y0) if mod(iplo,9)==0 ifig = ifig+1; - hh = dyn_figure(options_.nodisplay, 'name', [namendo,[' vs. shocks '], int2str(ifig)]); + hh_fig = dyn_figure(options_.nodisplay, 'name', [namendo,[' vs. shocks '], int2str(ifig)]); iplo = 0; end iplo = iplo+1; @@ -84,7 +84,7 @@ for j=1:size(anamendo,1) end title([namendo,' vs. ',namexo],'interpreter','none') if iplo==9 - dyn_saveas(hh,[dirname,'/',M_.fname,'_', namendo,'_vs_shock_',num2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,'/',M_.fname,'_', namendo,'_vs_shock_',num2str(ifig)],options_.nodisplay,options_.graph_format); create_TeX_loader(options_,[dirname,'/',M_.fname,'_', namendo,'_vs_shock_',num2str(ifig)],ifig,[namendo,' vs. shocks ',int2str(ifig)],[namendo,'_vs_shock'],1) end @@ -92,7 +92,7 @@ for j=1:size(anamendo,1) end end if iplo<9 && iplo>0 && ifig - dyn_saveas(hh,[dirname,'/',M_.fname,'_', namendo,'_vs_shocks_',num2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,'/',M_.fname,'_', namendo,'_vs_shocks_',num2str(ifig)],options_.nodisplay,options_.graph_format); create_TeX_loader(options_,[dirname,'/',M_.fname,'_', namendo,'_vs_shock_',num2str(ifig)],ifig,[namendo,' vs. shocks ',int2str(ifig)],[namendo,'_vs_shock'],options_.figures.textwidth*min(iplo/3)) end @@ -107,7 +107,7 @@ for j=1:size(anamendo,1) if ~isempty(y0) if mod(iplo,9)==0 ifig=ifig+1; - hh=dyn_figure(options_.nodisplay,'name',[namendo,' vs. lagged endogenous ',int2str(ifig)]); + hh_fig=dyn_figure(options_.nodisplay,'name',[namendo,' vs. lagged endogenous ',int2str(ifig)]); iplo=0; end iplo=iplo+1; @@ -127,19 +127,19 @@ for j=1:size(anamendo,1) title([namendo,' vs. ',namlagendo,'(-1)'],'interpreter','none') if iplo==9 - dyn_saveas(hh,[dirname,'/',M_.fname,'_', namendo,'_vs_lags_',num2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,'/',M_.fname,'_', namendo,'_vs_lags_',num2str(ifig)],options_.nodisplay,options_.graph_format); create_TeX_loader(options_,[dirname,'/',M_.fname,'_', namendo,'_vs_lags_',num2str(ifig)],ifig,[namendo,' vs. lagged endogenous ',int2str(ifig)],[namendo,'_vs_lags'],1) end end end end if iplo<9 && iplo>0 && ifig - dyn_saveas(hh,[dirname,'/',M_.fname,'_', namendo,'_vs_lags_',num2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,'/',M_.fname,'_', namendo,'_vs_lags_',num2str(ifig)],options_.nodisplay,options_.graph_format); create_TeX_loader(options_,[dirname,'/',M_.fname,'_', namendo,'_vs_lags_',num2str(ifig)],ifig,[namendo,' vs. lagged endogenous ',int2str(ifig)],[namendo,'_vs_lags'],options_.figures.textwidth*min(iplo/3)) end end -hh=dyn_figure(options_.nodisplay,'Name','Reduced form screening'); +hh_fig=dyn_figure(options_.nodisplay,'Name','Reduced form screening'); %bar(SA) % boxplot(SA','whis',10,'symbol','r.') myboxplot(SA',[],'.',[],10) @@ -153,7 +153,7 @@ end xlabel(' ') ylabel('Elementary Effects') title('Reduced form screening') -dyn_saveas(hh,[dirname,'/',M_.fname,'_redform_screen'],options_.nodisplay,options_.graph_format); +dyn_saveas(hh_fig,[dirname,'/',M_.fname,'_redform_screen'],options_.nodisplay,options_.graph_format); create_TeX_loader(options_,[dirname,'/',M_.fname,'_redform_screen'],1,'Reduced form screening','redform_screen',1) diff --git a/matlab/gsa/scatter_mcf.m b/matlab/gsa/scatter_mcf.m index 8aaa96d85..d0c343948 100644 --- a/matlab/gsa/scatter_mcf.m +++ b/matlab/gsa/scatter_mcf.m @@ -5,7 +5,7 @@ function scatter_mcf(X,Y,vnames,plotsymbol, fnam, dirname, figtitle, xparam1, D % marco.ratto@ec.europa.eu % Copyright © 2014-2016 European Commission -% Copyright © 2014-2017 Dynare Team +% Copyright © 2014-2023 Dynare Team % % This file is part of Dynare. % @@ -84,7 +84,7 @@ figtitle_tex=strrep(figtitle,'_','\_'); fig_nam_=[fnam]; if ~nograph - hh=dyn_figure(DynareOptions.nodisplay,'name',figtitle); + hh_fig=dyn_figure(DynareOptions.nodisplay,'name',figtitle); end bf = 0.1; @@ -166,7 +166,7 @@ if ~isoctave end if ~nograph - dyn_saveas(hh,[dirname,filesep,fig_nam_],DynareOptions.nodisplay,DynareOptions.graph_format); + dyn_saveas(hh_fig,[dirname,filesep,fig_nam_],DynareOptions.nodisplay,DynareOptions.graph_format); if DynareOptions.TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format))) fidTeX = fopen([dirname,'/',fig_nam_ '.tex'],'w'); fprintf(fidTeX,'%% TeX eps-loader file generated by scatter_mcf.m (Dynare).\n'); diff --git a/matlab/gsa/scatter_plots.m b/matlab/gsa/scatter_plots.m index 9fbcf2f26..2a0d989aa 100644 --- a/matlab/gsa/scatter_plots.m +++ b/matlab/gsa/scatter_plots.m @@ -6,7 +6,7 @@ function scatter_plots(X,xp,vnames,plotsymbol, fnam, dirname, figtitle, xparam1, % % Copyright © 2017 European Commission -% Copyright © 2017 Dynare Team +% Copyright © 2017-2023 Dynare Team % % This file is part of Dynare. % @@ -73,8 +73,8 @@ figtitle_tex=strrep(figtitle,'_','\_'); fig_nam_=[fnam]; -hh=dyn_figure(DynareOptions.nodisplay,'name',figtitle); -set(hh,'userdata',{X,xp}) +hh_fig=dyn_figure(DynareOptions.nodisplay,'name',figtitle); +set(hh_fig,'userdata',{X,xp}) bf = 0.1; ffs = 0.05/(p-1); @@ -172,7 +172,7 @@ end % end if ~nograph - dyn_saveas(hh,[dirname,filesep,fig_nam_],DynareOptions.nodisplay,DynareOptions.graph_format); + dyn_saveas(hh_fig,[dirname,filesep,fig_nam_],DynareOptions.nodisplay,DynareOptions.graph_format); if DynareOptions.TeX && any(strcmp('eps',cellstr(DynareOptions.graph_format))) fidTeX = fopen([dirname,'/',fig_nam_ '.tex'],'w'); fprintf(fidTeX,'%% TeX eps-loader file generated by scatter_plots.m (Dynare).\n'); diff --git a/matlab/gsa/stab_map_1.m b/matlab/gsa/stab_map_1.m index 7b47bc2f0..f1ba4422f 100644 --- a/matlab/gsa/stab_map_1.m +++ b/matlab/gsa/stab_map_1.m @@ -21,7 +21,7 @@ function [proba, dproba] = stab_map_1(lpmat, ibehaviour, inonbehaviour, aname, i % marco.ratto@ec.europa.eu % Copyright © 2012-2016 European Commission -% Copyright © 2012-2017 Dynare Team +% Copyright © 2012-2023 Dynare Team % % This file is part of Dynare. % @@ -82,7 +82,7 @@ if iplot && ~options_.nograph ftit=bayestopt_.name(ipar+nshock*(1-ishock)); for i=1:ceil(nparplot/12) - hh=dyn_figure(options_.nodisplay,'name',atitle); + hh_fig=dyn_figure(options_.nodisplay,'name',atitle); for j=1+12*(i-1):min(nparplot,12*i) subplot(3,4,j-12*(i-1)) if ~isempty(ibehaviour) @@ -98,7 +98,7 @@ if iplot && ~options_.nograph title([ftit{j},'. p-value ', num2str(proba(ipar(j)),2)],'interpreter','none') end if nparplot>12 - dyn_saveas(hh,[dirname,filesep,fname_,'_',aname,'_SA_',int2str(i)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,filesep,fname_,'_',aname,'_SA_',int2str(i)],options_.nodisplay,options_.graph_format); if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) fidTeX = fopen([dirname,filesep,fname_,'_',aname,'_SA_',int2str(i) '.tex'],'w'); fprintf(fidTeX,'%% TeX eps-loader file generated by stab_map_1.m (Dynare).\n'); @@ -113,7 +113,7 @@ if iplot && ~options_.nograph fclose(fidTeX); end else - dyn_saveas(hh,[dirname,filesep,fname_,'_',aname,'_SA'],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,filesep,fname_,'_',aname,'_SA'],options_.nodisplay,options_.graph_format); if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) fidTeX = fopen([dirname,filesep,fname_,'_',aname,'_SA.tex'],'w'); fprintf(fidTeX,'%% TeX eps-loader file generated by stab_map_1.m (Dynare).\n'); diff --git a/matlab/gsa/stab_map_2.m b/matlab/gsa/stab_map_2.m index 3e6e508c1..50a33603f 100644 --- a/matlab/gsa/stab_map_2.m +++ b/matlab/gsa/stab_map_2.m @@ -6,7 +6,7 @@ function indcorr = stab_map_2(x,alpha2, pvalue_crit, fnam, dirname,xparam1,figti % marco.ratto@ec.europa.eu % Copyright © 2011-2016 European Commission -% Copyright © 2011-2018 Dynare Team +% Copyright © 2011-2023 Dynare Team % This file is part of Dynare. % % Dynare is free software: you can redistribute it and/or modify @@ -118,7 +118,7 @@ for j=1:npar if ~nograph if mod(j2,12)==1 ifig=ifig+1; - hh=dyn_figure(options_.nodisplay,'name',[figtitle,' sample bivariate projection ', num2str(ifig)]); + hh_fig=dyn_figure(options_.nodisplay,'name',[figtitle,' sample bivariate projection ', num2str(ifig)]); end subplot(3,4,j2-(ifig-1)*12) % bar(c0(i2,j)), @@ -141,7 +141,7 @@ for j=1:npar end title(['cc = ',num2str(c0(i2(jx),j))]) if (mod(j2,12)==0) && j2>0 - dyn_saveas(hh,[dirname,filesep,fig_nam_,int2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,filesep,fig_nam_,int2str(ifig)],options_.nodisplay,options_.graph_format); if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) fidTeX = fopen([dirname,filesep,fig_nam_,int2str(ifig),'.tex'],'w'); fprintf(fidTeX,'%% TeX eps-loader file generated by stab_map_2.m (Dynare).\n'); @@ -162,7 +162,7 @@ for j=1:npar end end if ~nograph && (j==(npar)) && j2>0 && (mod(j2,12)~=0) - dyn_saveas(hh,[dirname,filesep,fig_nam_,int2str(ifig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[dirname,filesep,fig_nam_,int2str(ifig)],options_.nodisplay,options_.graph_format); if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) fidTeX = fopen([dirname,filesep,fig_nam_,int2str(ifig),'.tex'],'w'); fprintf(fidTeX,'%% TeX eps-loader file generated by stab_map_2.m (Dynare).\n'); diff --git a/matlab/mh_autocorrelation_function.m b/matlab/mh_autocorrelation_function.m index 97295b1c7..565c16504 100644 --- a/matlab/mh_autocorrelation_function.m +++ b/matlab/mh_autocorrelation_function.m @@ -93,7 +93,7 @@ if options_.mh_nblck>1 FigureName = [ FigureName , ' (block number' int2str(blck) ').']; end -hh=dyn_figure(options_.nodisplay,'Name',FigureName); +hh_fig=dyn_figure(options_.nodisplay,'Name',FigureName); bar(0:options_.mh_autocorrelation_function_size,autocor,'k'); axis tight @@ -106,4 +106,4 @@ if ~exist([M_.dname filesep 'graphs']) end plot_name=get_the_name(column,0,M_,estim_params_,options_); -dyn_saveas(hh,[M_.dname, filesep, 'graphs', filesep, 'MH_Autocorrelation_' plot_name],options_.nodisplay,options_.graph_format) +dyn_saveas(hh_fig,[M_.dname, filesep, 'graphs', filesep, 'MH_Autocorrelation_' plot_name],options_.nodisplay,options_.graph_format) diff --git a/matlab/missing_DiffuseKalmanSmootherH3_Z.m b/matlab/missing_DiffuseKalmanSmootherH3_Z.m index a5894922a..d863db5a3 100644 --- a/matlab/missing_DiffuseKalmanSmootherH3_Z.m +++ b/matlab/missing_DiffuseKalmanSmootherH3_Z.m @@ -64,7 +64,7 @@ function [alphahat,epsilonhat,etahat,a,P1,aK,PK,decomp,V, aalphahat,eetahat,d,al % Models", S.J. Koopman and J. Durbin (2003), in Journal of Time Series % Analysis, vol. 24(1), pp. 85-98. -% Copyright © 2004-2021 Dynare Team +% Copyright © 2004-2023 Dynare Team % % This file is part of Dynare. % @@ -315,8 +315,8 @@ if isoccbin % kalman update is not yet robust to accommodate diffuse steps end if occbin_options.opts_regime.waitbar - hh = dyn_waitbar(0,'Occbin: Piecewise Kalman Filter'); - set(hh,'Name','Occbin: Piecewise Kalman Filter.'); + hh_fig = dyn_waitbar(0,'Occbin: Piecewise Kalman Filter'); + set(hh_fig,'Name','Occbin: Piecewise Kalman Filter.'); waitbar_indicator=1; else waitbar_indicator=0; @@ -346,7 +346,7 @@ while notsteady && t=first_period_occbin_update if waitbar_indicator - dyn_waitbar(t/smpl, hh, sprintf('Period %u of %u', t,smpl)); + dyn_waitbar(t/smpl, hh_fig, sprintf('Period %u of %u', t,smpl)); end occbin_options.opts_regime.waitbar=0; if t==1 @@ -530,7 +530,7 @@ while notsteady && t 10^(-6) subplotnum = subplotnum+1; - set(0,'CurrentFigure',hh); + set(0,'CurrentFigure',hh_fig); subplot(nn,nn,subplotnum); if ~(all(all(Distrib(:,:,i)))>0 || ~all(all(Distrib(:,:,i)))<0) plot([1 n2],[0 0],'-r','linewidth',0.5); @@ -115,14 +115,14 @@ for i=fpar:nvar end if subplotnum == MaxNumberOfPlotsPerFigure || i == nvar - dyn_saveas(hh,[M_.dname '/Output/' M_.fname '_' name3 '_' tit3{i}],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[M_.dname '/Output/' M_.fname '_' name3 '_' tit3{i}],options_.nodisplay,options_.graph_format); if RemoteFlag==1 OutputFileName = [OutputFileName; {[M_.dname, filesep, 'Output',filesep], [M_.fname '_' name3 '_' deblank(tit3(i,:)) '.*']}]; end subplotnum = 0; figunumber = figunumber+1; if (i ~= nvar) - hh = dyn_figure(options_.nodisplay,'Name',[name3 ' ' int2str(figunumber+1)]); + hh_fig = dyn_figure(options_.nodisplay,'Name',[name3 ' ' int2str(figunumber+1)]); end end diff --git a/matlab/posterior_sampler_core.m b/matlab/posterior_sampler_core.m index 0722858c4..4e3379a64 100644 --- a/matlab/posterior_sampler_core.m +++ b/matlab/posterior_sampler_core.m @@ -174,12 +174,12 @@ for curr_block = fblck:nblck refresh_rate = sampler_options.parallel_bar_refresh_rate; bar_title = sampler_options.parallel_bar_title; prc0=(curr_block-fblck)/(nblck-fblck+1)*(isoctave || options_.console_mode); - hh = dyn_waitbar({prc0,whoiam,options_.parallel(ThisMatlab)},[bar_title ' (' int2str(curr_block) '/' int2str(options_.mh_nblck) ')...']); + hh_fig = dyn_waitbar({prc0,whoiam,options_.parallel(ThisMatlab)},[bar_title ' (' int2str(curr_block) '/' int2str(options_.mh_nblck) ')...']); else refresh_rate = sampler_options.serial_bar_refresh_rate; bar_title = sampler_options.serial_bar_title; - hh = dyn_waitbar(0,[bar_title ' (' int2str(curr_block) '/' int2str(options_.mh_nblck) ')...']); - set(hh,'Name',bar_title); + hh_fig = dyn_waitbar(0,[bar_title ' (' int2str(curr_block) '/' int2str(options_.mh_nblck) ')...']); + set(hh_fig,'Name',bar_title); end if mh_recover_flag==0 accepted_draws_this_chain = 0; @@ -207,9 +207,9 @@ for curr_block = fblck:nblck prtfrc = draw_iter/nruns(curr_block); if mod(draw_iter, refresh_rate)==0 if accepted_draws_this_chain/draw_iter==1 && sum(neval)>1 - dyn_waitbar(prtfrc,hh,[bar_title ' (' int2str(curr_block) '/' int2str(options_.mh_nblck) ') ' sprintf('Function eval per draw %4.3f', feval_this_chain/draw_iter)]); + dyn_waitbar(prtfrc,hh_fig,[bar_title ' (' int2str(curr_block) '/' int2str(options_.mh_nblck) ') ' sprintf('Function eval per draw %4.3f', feval_this_chain/draw_iter)]); else - dyn_waitbar(prtfrc,hh,[bar_title ' (' int2str(curr_block) '/' int2str(options_.mh_nblck) ') ' sprintf('Current acceptance ratio %4.3f', accepted_draws_this_chain/draw_iter)]); + dyn_waitbar(prtfrc,hh_fig,[bar_title ' (' int2str(curr_block) '/' int2str(options_.mh_nblck) ') ' sprintf('Current acceptance ratio %4.3f', accepted_draws_this_chain/draw_iter)]); end if save_tmp_file [LastSeeds.(['file' int2str(NewFile(curr_block))]).Unifor, LastSeeds.(['file' int2str(NewFile(curr_block))]).Normal] = get_dynare_random_generator_state(); @@ -265,7 +265,7 @@ for curr_block = fblck:nblck draw_iter=draw_iter+1; draw_index_current_file = draw_index_current_file + 1; end % End of the simulations for one mh-block. - dyn_waitbar_close(hh); + dyn_waitbar_close(hh_fig); if nruns(curr_block) record.AcceptanceRatio(curr_block) = accepted_draws_this_chain/(draw_iter-1); record.FunctionEvalPerIteration(curr_block) = feval_this_chain/(draw_iter-1); diff --git a/matlab/prior_sampler.m b/matlab/prior_sampler.m index 1303cbcf0..3ef74fd45 100644 --- a/matlab/prior_sampler.m +++ b/matlab/prior_sampler.m @@ -85,13 +85,13 @@ file_indx_number = 0; oo_.dr=set_state_space(oo_.dr,M_,options_); -hh = dyn_waitbar(0,'Please wait. Prior sampler...'); -set(hh,'Name','Prior sampler.'); +hh_fig = dyn_waitbar(0,'Please wait. Prior sampler...'); +set(hh_fig,'Name','Prior sampler.'); % Simulations. while iteration < NumberOfSimulations if ~mod(iteration,10) - dyn_waitbar(iteration/NumberOfSimulations,hh,'Please wait. Prior sampler...'); + dyn_waitbar(iteration/NumberOfSimulations,hh_fig,'Please wait. Prior sampler...'); end loop_indx = loop_indx+1; params = Prior.draw(); @@ -162,7 +162,7 @@ while iteration < NumberOfSimulations end end -dyn_waitbar_close(hh); +dyn_waitbar_close(hh_fig); % Get informations about BK conditions and other things... results.bk.indeterminacy_share = count_bk_indeterminacy/loop_indx; diff --git a/matlab/rplot.m b/matlab/rplot.m index 6c54fc879..53abb116d 100644 --- a/matlab/rplot.m +++ b/matlab/rplot.m @@ -14,7 +14,7 @@ function rplot(s1) % SPECIAL REQUIREMENTS % none -% Copyright © 2001-2021 Dynare Team +% Copyright © 2001-2023 Dynare Team % % This file is part of Dynare. % @@ -75,7 +75,7 @@ if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) end if options_.rplottype == 0 %all in one plot - hh=dyn_figure(options_.nodisplay,'Name', 'Simulated Trajectory'); + hh_fig=dyn_figure(options_.nodisplay,'Name', 'Simulated Trajectory'); plot(ix(i),y(:,i)) ; if options_.TeX title (['Plot of $' strjoin(s1_TeX', '~') '$'],'Interpreter','latex') ; @@ -94,13 +94,13 @@ if options_.rplottype == 0 %all in one plot legend(s1,'interpreter','none'); end end - dyn_saveas(hh,[M_.dname, filesep, 'graphs', filesep, 'SimulatedTrajectory_' s1{1}],options_.nodisplay,options_.graph_format) + dyn_saveas(hh_fig,[M_.dname, filesep, 'graphs', filesep, 'SimulatedTrajectory_' s1{1}],options_.nodisplay,options_.graph_format) if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) create_TeX_loader(fidTeX,[M_.dname, '/graphs/', 'SimulatedTrajectory_' s1{1}],'Simulated trajectories','SimulatedTrajectory_',s1{1},1) end elseif options_.rplottype == 1 %separate figures each for j = 1:size(y,1) - hh=dyn_figure(options_.nodisplay,'Name', 'Simulated Trajectory'); + hh_fig=dyn_figure(options_.nodisplay,'Name', 'Simulated Trajectory'); plot(ix(i),y(j,i)) ; xlim([min(ix(i)) max(ix(i))]) if options_.TeX @@ -109,13 +109,13 @@ elseif options_.rplottype == 1 %separate figures each title(['Plot of ' s1{j}],'Interpreter','none') ; end xlabel('Periods') ; - dyn_saveas(hh,[M_.dname, filesep, 'graphs', filesep, 'SimulatedTrajectory_' s1{j}],options_.nodisplay,options_.graph_format) + dyn_saveas(hh_fig,[M_.dname, filesep, 'graphs', filesep, 'SimulatedTrajectory_' s1{j}],options_.nodisplay,options_.graph_format) if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) create_TeX_loader(fidTeX,[M_.dname, '/graphs/', 'SimulatedTrajectory_' s1{j}],'Simulated trajectories','SimulatedTrajectory_',s1{j},1); end end elseif options_.rplottype == 2 %different subplots - hh=dyn_figure(options_.nodisplay,'Name', 'Simulated Trajectory'); + hh_fig=dyn_figure(options_.nodisplay,'Name', 'Simulated Trajectory'); nl = max(1,fix(size(y,1)/4)) ; nc = ceil(size(y,1)/nl) ; for j = 1:size(y,1) @@ -137,7 +137,7 @@ elseif options_.rplottype == 2 %different subplots end axis tight; end - dyn_saveas(hh,[M_.dname, filesep, 'graphs', filesep, 'SimulatedTrajectory_' s1{1}],options_.nodisplay,options_.graph_format) + dyn_saveas(hh_fig,[M_.dname, filesep, 'graphs', filesep, 'SimulatedTrajectory_' s1{1}],options_.nodisplay,options_.graph_format) if options_.TeX && any(strcmp('eps',cellstr(options_.graph_format))) create_TeX_loader(fidTeX,[M_.dname, '/graphs/', 'SimulatedTrajectory_' s1{1}],'Simulated trajectories','SimulatedTrajectory_', s1{1},min(j/nc,1)); end diff --git a/matlab/stoch_simul.m b/matlab/stoch_simul.m index 06a1f7eb4..0742ddc47 100644 --- a/matlab/stoch_simul.m +++ b/matlab/stoch_simul.m @@ -310,10 +310,10 @@ if options_.irf if nbplt == 0 elseif nbplt == 1 if options_.relative_irf - hh = dyn_figure(options_.nodisplay,'Name',['Relative response to' ... + hh_fig = dyn_figure(options_.nodisplay,'Name',['Relative response to' ... ' orthogonalized shock to ' tit{i}]); else - hh = dyn_figure(options_.nodisplay,'Name',['Orthogonalized shock to' ... + hh_fig = dyn_figure(options_.nodisplay,'Name',['Orthogonalized shock to' ... ' ' tit{i}]); end for j = 1:number_of_plots_to_draw @@ -330,7 +330,7 @@ if options_.irf title(deblank(mylist(j,:)),'Interpreter','none'); end end - dyn_saveas(hh,[M_.dname, '/graphs/' M_.fname '_IRF_' tit{i}],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[M_.dname, '/graphs/' M_.fname '_IRF_' tit{i}],options_.nodisplay,options_.graph_format); if TeX && any(strcmp('eps',cellstr(options_.graph_format))) fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\centering \n'); @@ -343,10 +343,10 @@ if options_.irf else for fig = 1:nbplt-1 if options_.relative_irf - hh = dyn_figure(options_.nodisplay,'Name',['Relative response to orthogonalized shock' ... + hh_fig = dyn_figure(options_.nodisplay,'Name',['Relative response to orthogonalized shock' ... ' to ' tit{i} ' figure ' int2str(fig)]); else - hh = dyn_figure(options_.nodisplay,'Name',['Orthogonalized shock to ' tit{i} ... + hh_fig = dyn_figure(options_.nodisplay,'Name',['Orthogonalized shock to ' tit{i} ... ' figure ' int2str(fig)]); end for plt = 1:nstar @@ -363,7 +363,7 @@ if options_.irf title(deblank(mylist((fig-1)*nstar+plt,:)),'Interpreter','none'); end end - dyn_saveas(hh,[M_.dname, '/graphs/' M_.fname '_IRF_' tit{i} int2str(fig)],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[M_.dname, '/graphs/' M_.fname '_IRF_' tit{i} int2str(fig)],options_.nodisplay,options_.graph_format); if TeX && any(strcmp('eps',cellstr(options_.graph_format))) fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\centering \n'); @@ -378,7 +378,7 @@ if options_.irf fprintf(fidTeX,' \n'); end end - hh = dyn_figure(options_.nodisplay,'Name',['Orthogonalized shock to ' tit{i} ' figure ' int2str(nbplt) '.']); + hh_fig = dyn_figure(options_.nodisplay,'Name',['Orthogonalized shock to ' tit{i} ' figure ' int2str(nbplt) '.']); m = 0; for plt = 1:number_of_plots_to_draw-(nbplt-1)*nstar m = m+1; @@ -395,7 +395,7 @@ if options_.irf title(deblank(mylist((nbplt-1)*nstar+plt,:)),'Interpreter','none'); end end - dyn_saveas(hh,[M_.dname, '/graphs/' M_.fname '_IRF_' tit{i} int2str(nbplt) ],options_.nodisplay,options_.graph_format); + dyn_saveas(hh_fig,[M_.dname, '/graphs/' M_.fname '_IRF_' tit{i} int2str(nbplt) ],options_.nodisplay,options_.graph_format); if TeX && any(strcmp('eps',cellstr(options_.graph_format))) fprintf(fidTeX,'\\begin{figure}[H]\n'); fprintf(fidTeX,'\\centering \n'); diff --git a/matlab/surgibbs.m b/matlab/surgibbs.m index 199f9bca2..17b9d6c9d 100644 --- a/matlab/surgibbs.m +++ b/matlab/surgibbs.m @@ -27,7 +27,7 @@ function ds = surgibbs(ds, param_names, beta0, A, ndraws, discarddraws, thin, eq % Combination of Direct Monte Carlo and Importance Sampling Techniques. % Bayesian Analysis Volume 5, Number 1, pp. 65-96. -% Copyright © 2017-2021 Dynare Team +% Copyright © 2017-2023 Dynare Team % % This file is part of Dynare. % @@ -106,12 +106,12 @@ if ~options_.noprint disp('surgibbs: estimating, please wait...') end -hh = dyn_waitbar(0,'Please wait. Gibbs sampler...'); -set(hh,'Name','Surgibbs estimation.'); +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) - dyn_waitbar(i/ndraws,hh,'Please wait. Gibbs sampler...'); + dyn_waitbar(i/ndraws,hh_fig,'Please wait. Gibbs sampler...'); end % Draw Omega, given X, Y, Beta resid = reshape(Y - X*beta, nobs, m); @@ -135,7 +135,7 @@ for i = 1:ndraws end end end -dyn_waitbar_close(hh); +dyn_waitbar_close(hh_fig); % % Save results. diff --git a/matlab/trace_plot.m b/matlab/trace_plot.m index c08943a66..a90485ae5 100644 --- a/matlab/trace_plot.m +++ b/matlab/trace_plot.m @@ -118,7 +118,7 @@ if n_nblocks_to_plot==1 if options_.mh_nblck>1 FigureName = [ FigureName , ' (block number ' int2str(blck) ').']; end - hh=dyn_figure(options_.nodisplay,'Name',FigureName); + hh_fig=dyn_figure(options_.nodisplay,'Name',FigureName); plot(1:TotalNumberOfMhDraws,PosteriorDraws,'Color',[.7 .7 .7]); % Compute the moving average of the posterior draws: @@ -137,7 +137,7 @@ if n_nblocks_to_plot==1 axis tight legend({'MCMC draw';[num2str(N) ' period moving average']},'Location','NorthEast') else - hh=dyn_figure(options_.nodisplay,'Name',FigureName); + hh_fig=dyn_figure(options_.nodisplay,'Name',FigureName); pp=plot(1:TotalNumberOfMhDraws,PosteriorDraws); legend(pp,strcat(repmat({'Chain '},n_nblocks_to_plot,1),num2str(blck(:)))); end @@ -160,7 +160,7 @@ if n_nblocks_to_plot==1 else plot_name=[plot_name,'_blck_',save_string]; end -dyn_saveas(hh,[M_.dname, filesep, 'graphs', filesep, 'TracePlot_' plot_name],options_.nodisplay,options_.graph_format) +dyn_saveas(hh_fig,[M_.dname, filesep, 'graphs', filesep, 'TracePlot_' plot_name],options_.nodisplay,options_.graph_format) if options_.TeX fid=fopen([M_.dname,'/graphs/',M_.fname,'_TracePlot_' plot_name,'.tex'],'w+'); diff --git a/tests/estimation/system_prior_restriction/Gali_2015.mod b/tests/estimation/system_prior_restriction/Gali_2015.mod index 834b211e5..007a4db24 100644 --- a/tests/estimation/system_prior_restriction/Gali_2015.mod +++ b/tests/estimation/system_prior_restriction/Gali_2015.mod @@ -147,13 +147,13 @@ end; varobs yhat; % Run prior function to get prior slope of the PC based on independent priors -hh=figure('Name','Slope of the Phillips Curve'); +hh_fig=figure('Name','Slope of the Phillips Curve'); prior_function(function='Gali_2015_PC_slope'); PC_slope_vec=cell2mat(oo_.prior_function_results(:,1)); optimal_bandwidth = mh_optimal_bandwidth(PC_slope_vec,length(PC_slope_vec),0,'gaussian'); [density(:,1),density(:,2)] = kernel_density_estimate(PC_slope_vec,512,length(PC_slope_vec),optimal_bandwidth,'gaussian'); -figure(hh) +figure(hh_fig) subplot(3,1,1) plot(density(:,1),density(:,2)); title('Prior') @@ -165,7 +165,7 @@ posterior_function(function='Gali_2015_PC_slope'); PC_slope_vec=cell2mat(oo_.posterior_function_results(:,1)); optimal_bandwidth = mh_optimal_bandwidth(PC_slope_vec,length(PC_slope_vec),0,'gaussian'); [density(:,1),density(:,2)] = kernel_density_estimate(PC_slope_vec,512,length(PC_slope_vec),optimal_bandwidth,'gaussian'); -figure(hh) +figure(hh_fig) subplot(3,1,2) plot(density(:,1),density(:,2)); title('Updated Prior') @@ -178,7 +178,7 @@ posterior_function(function='Gali_2015_PC_slope'); PC_slope_vec=cell2mat(oo_.posterior_function_results(:,1)); optimal_bandwidth = mh_optimal_bandwidth(PC_slope_vec,length(PC_slope_vec),0,'gaussian'); [density(:,1),density(:,2)] = kernel_density_estimate(PC_slope_vec,512,length(PC_slope_vec),optimal_bandwidth,'gaussian'); -figure(hh) +figure(hh_fig) subplot(3,1,3) plot(density(:,1),density(:,2)); title('Posterior')