From 4052d4ccaffcdb161b1346b27f17cb48fc243811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Wed, 10 Jul 2013 17:12:34 +0200 Subject: [PATCH] Cosmetic changes. Use skipline() instead of disp(' '). --- matlab/CutSample.m | 2 +- matlab/GetPosteriorParametersStatistics.m | 15 +- matlab/McMCDiagnostics.m | 2 +- matlab/bvar_density.m | 4 +- matlab/bvar_forecast.m | 4 +- matlab/bvar_irf.m | 4 +- matlab/check.m | 6 +- matlab/check_list_of_variables.m | 19 +- matlab/disp_identification.m | 22 +- matlab/disp_model_summary.m | 4 +- matlab/disp_steady_state.m | 4 +- matlab/disp_th_moments.m | 12 +- ...splay_conditional_variance_decomposition.m | 4 +- matlab/display_estimation_results_table.m | 12 +- matlab/dynare.m | 6 +- matlab/dynare_config.m | 4 +- matlab/dynare_estimation_init.m | 2 +- matlab/dynare_identification.m | 23 +- matlab/dynare_sensitivity.m | 4 +- matlab/evaluate_planner_objective.m | 4 +- matlab/forcst_unc.m | 6 +- matlab/get_prior_info.m | 7 +- matlab/gsa/Morris_Measure_Groups.m | 2 +- matlab/gsa/filt_mc_.m | 37 +-- matlab/gsa/gsa_speed.m | 2 +- matlab/gsa/mc_moments.m | 2 +- matlab/gsa/redform_map.m | 8 +- matlab/gsa/stab_map_.m | 16 +- matlab/independent_metropolis_hastings.m | 2 +- matlab/independent_metropolis_hastings_core.m | 2 +- matlab/marginal_density.m | 3 +- matlab/metropolis_hastings_initialization.m | 8 +- matlab/mode_check.m | 6 +- matlab/model_comparison.m | 3 +- matlab/ms-sbvar/ms_mardd.m | 9 +- matlab/ms-sbvar/msstart2.m | 6 +- matlab/ms-sbvar/msstart_setup.m | 4 +- matlab/mult_elimination.m | 2 +- matlab/newrat.m | 12 +- matlab/osr.m | 4 +- matlab/osr1.m | 6 +- .../AnalyseComputationalEnvironment.m | 279 +++++++----------- matlab/plot_identification.m | 6 +- matlab/random_walk_metropolis_hastings.m | 2 +- matlab/resid.m | 10 +- matlab/set_dynare_seed.m | 4 +- matlab/simplex_optimization_routine.m | 24 +- matlab/simulated_moments_estimation.m | 12 +- matlab/{utilities/general => }/skipline.m | 0 matlab/solve1.m | 2 +- matlab/steady.m | 2 +- matlab/stoch_simul.m | 10 +- matlab/utilities/dataset/initialize_dataset.m | 4 +- matlab/utilities/doc/dynInfo.m | 3 +- 54 files changed, 294 insertions(+), 368 deletions(-) rename matlab/{utilities/general => }/skipline.m (100%) diff --git a/matlab/CutSample.m b/matlab/CutSample.m index 5a3e94019..e0a2b16ec 100644 --- a/matlab/CutSample.m +++ b/matlab/CutSample.m @@ -67,4 +67,4 @@ fprintf('MH: Total number of generated MH files: %d.\n',TotalNumberOfMhFiles); fprintf('MH: I''ll use mh-files %d to %d.\n',FirstMhFile,TotalNumberOfMhFiles); fprintf('MH: In MH-file number %d I''ll start at line %d.\n',FirstMhFile,FirstLine); fprintf('MH: Finally I keep %d draws.\n',TotalNumberOfMhDraws-FirstDraw); -disp(' '); +skipline() diff --git a/matlab/GetPosteriorParametersStatistics.m b/matlab/GetPosteriorParametersStatistics.m index cb6ba4219..04ca6c86c 100644 --- a/matlab/GetPosteriorParametersStatistics.m +++ b/matlab/GetPosteriorParametersStatistics.m @@ -62,7 +62,10 @@ header_width = row_header_width(M_,estim_params_,bayestopt_); tit2 = sprintf('%-*s %10s %10s %16s %6s %10s\n',header_width+2,' ','prior mean','post. mean','conf. interval','prior','pstdev'); pformat = '%-*s %10.3f %10.4f %10.4f %8.4f %6s %10.4f'; -disp(' ');disp(' ');disp('ESTIMATION RESULTS');disp(' '); +skipline(2) +disp('ESTIMATION RESULTS') +skipline() + try disp(sprintf('Log data density is %f.',oo_.MarginalDensity.ModifiedHarmonicMean)) catch @@ -74,7 +77,7 @@ if np if TeX fid = TeXBegin(OutputDirectoryName,M_.fname,1,type); end - disp(' ') + skipline() disp(type) disp(tit2) ip = nvx+nvn+ncx+ncn+1; @@ -120,7 +123,7 @@ if nvx fid = TeXBegin(OutputDirectoryName,M_.fname,2,'standard deviation of structural shocks'); end ip = 1; - disp(' ') + skipline() disp('standard deviation of shocks') disp(tit2) for i=1:nvx @@ -165,7 +168,7 @@ if nvn if TeX fid = TeXBegin(OutputDirectoryName,M_.fname,3,'standard deviation of measurement errors'); end - disp(' ') + skipline() disp('standard deviation of measurement errors') disp(tit2) ip = nvx+1; @@ -207,7 +210,7 @@ if ncx if TeX fid = TeXBegin(OutputDirectoryName,M_.fname,4,'correlation of structural shocks'); end - disp(' ') + skipline() disp('correlation of shocks') disp(tit2) ip = nvx+nvn+1; @@ -261,7 +264,7 @@ if ncn if TeX fid = TeXBegin(OutputDirectoryName,M_.fname,5,'correlation of measurement errors'); end - disp(' ') + skipline() disp('correlation of measurement errors') disp(tit2) ip = nvx+nvn+ncx+1; diff --git a/matlab/McMCDiagnostics.m b/matlab/McMCDiagnostics.m index 7e9023eb2..d4a26cb8c 100644 --- a/matlab/McMCDiagnostics.m +++ b/matlab/McMCDiagnostics.m @@ -131,7 +131,7 @@ else end UDIAG(:,[2 4 6],:) = UDIAG(:,[2 4 6],:)/nblck; -disp(' ') +skipline() clear pmet temp moyenne CSUP CINF csup cinf n linea iter tmp; pages = floor(npar/3); k = 0; diff --git a/matlab/bvar_density.m b/matlab/bvar_density.m index 6d58fad4b..665a9dae5 100644 --- a/matlab/bvar_density.m +++ b/matlab/bvar_density.m @@ -39,10 +39,10 @@ for nlags = 1:maxnlags log_dnsty = posterior_int - prior_int - 0.5*ny*lik_nobs*log(2*pi); - disp(' ') + skipline() fprintf('The marginal log density of the BVAR(%g) model is equal to %10.4f\n', ... nlags, log_dnsty); - disp(' ') + skipline() end diff --git a/matlab/bvar_forecast.m b/matlab/bvar_forecast.m index 3ee4aad95..03100c053 100644 --- a/matlab/bvar_forecast.m +++ b/matlab/bvar_forecast.m @@ -94,10 +94,10 @@ while d <= options_.bvar_replic end if p > 0 - disp(' ') + skipline() disp(['Some of the VAR models sampled from the posterior distribution']) disp(['were found to be explosive (' num2str(p/options_.bvar_replic) ' percent).']) - disp(' ') + skipline() end % Plot graphs diff --git a/matlab/bvar_irf.m b/matlab/bvar_irf.m index b46799f6a..d742915d7 100644 --- a/matlab/bvar_irf.m +++ b/matlab/bvar_irf.m @@ -92,10 +92,10 @@ for draw=1:options_.bvar_replic end if p > 0 - disp(' ') + skipline() disp(['Some of the VAR models sampled from the posterior distribution']) disp(['were found to be explosive (' int2str(p) ' samples).']) - disp(' ') + skipline() end posterior_mean_irfs = mean(sampled_irfs,4); diff --git a/matlab/check.m b/matlab/check.m index 8c7ad94ff..a2afc7b9f 100644 --- a/matlab/check.m +++ b/matlab/check.m @@ -96,18 +96,18 @@ if (nyf == n_explod) && (dr.full_rank) end if options.noprint == 0 - disp(' ') + skipline() disp('EIGENVALUES:') disp(sprintf('%16s %16s %16s\n','Modulus','Real','Imaginary')) z=[m_lambda real(eigenvalues_(i)) imag(eigenvalues_(i))]'; disp(sprintf('%16.4g %16.4g %16.4g\n',z)) disp(sprintf('\nThere are %d eigenvalue(s) larger than 1 in modulus ', n_explod)); disp(sprintf('for %d forward-looking variable(s)',nyf)); - disp(' ') + skipline() if result disp('The rank condition is verified.') else disp('The rank conditions ISN''T verified!') end - disp(' ') + skipline() end diff --git a/matlab/check_list_of_variables.m b/matlab/check_list_of_variables.m index 75d83f7dc..415e8759e 100644 --- a/matlab/check_list_of_variables.m +++ b/matlab/check_list_of_variables.m @@ -45,9 +45,9 @@ if options_.dsge_var && options_.bayesian_irf msg = 1; end if msg - disp(' ') + skipline() disp('Posterior IRFs will be computed for all observed variables.') - disp(' ') + skipline() end end varlist = options_.varobs; @@ -55,7 +55,7 @@ if options_.dsge_var && options_.bayesian_irf end if isempty(varlist) - disp(' ') + skipline() disp(['You did not declare endogenous variables after the estimation/calib_smoother command.']) cas = []; if options_.bayesian_irf @@ -99,14 +99,13 @@ if isempty(varlist) else choice = []; while isempty(choice) - disp(' ') - disp(' ') + skipline(2) disp('Choose one of the following options:') - disp(' ') + skipline() disp(' [1] Consider all the endogenous variables.') disp(' [2] Consider all the observed endogenous variables.') disp(' [3] Stop Dynare and change the mod file.') - disp(' ') + skipline() choice = input('options [default is 1] = '); if isempty(choice) choice=1; @@ -118,9 +117,9 @@ if isempty(varlist) elseif choice==3 varlist = NaN; else - disp('') + skipline() disp('YOU HAVE TO ANSWER 1, 2 or 3!') - disp('') + skipline() end end end @@ -128,7 +127,7 @@ if isempty(varlist) if isnan(varlist) edit([M_.fname '.mod']) end - disp('') + skipline() end diff --git a/matlab/disp_identification.m b/matlab/disp_identification.m index 0badae976..5bdb3e8e5 100644 --- a/matlab/disp_identification.m +++ b/matlab/disp_identification.m @@ -91,7 +91,7 @@ if any(idemodel.ino), else disp(['The rank of H (model) is deficient!' ]), end - disp(' ') + skipline() for j=1:npar, if any(idemodel.ind0(:,j)==0), pno = 100*length(find(idemodel.ind0(:,j)==0))/SampleSize; @@ -106,7 +106,7 @@ if any(idemodel.ino), npairs=size(idemodel.jweak_pair,2); jmap_pair=dyn_unvech(1:npairs); jstore=[]; - disp(' ') + skipline() for j=1:npairs, iweak = length(find(idemodel.jweak_pair(:,j))); if iweak, @@ -120,7 +120,7 @@ if any(idemodel.ino), end end - disp(' ') + skipline() for j=1:npar, iweak = length(find(idemodel.jweak(:,j))); if iweak && ~ismember(j,jstore), @@ -154,11 +154,11 @@ end if ~any(idemodel.ino) && ~any(any(idemodel.ind0==0)) disp(['All parameters are identified in the model (rank of H).' ]), - disp(' ') + skipline() end if any(idemoments.ino), - disp(' ') + skipline() disp('WARNING !!!') if SampleSize > 1, disp(['The rank of J (moments) is deficient for ', num2str(length(find(idemoments.ino))),' out of ',int2str(SampleSize),' MC runs!' ]), @@ -172,7 +172,7 @@ if any(idemoments.ino), % freqno = mean(indno)*100; % ifreq=find(freqno); % disp('MOMENT RANK FAILURE DUE TO COLLINEARITY OF PARAMETERS:'); - disp(' ') + skipline() for j=1:npar, if any(idemoments.ind0(:,j)==0), pno = 100*length(find(idemoments.ind0(:,j)==0))/SampleSize; @@ -184,7 +184,7 @@ if any(idemoments.ino), disp([' [dJ/d(',name{j},')=0 for all J moments!]' ]) end end - disp(' ') + skipline() npairs=size(idemoments.jweak_pair,2); jmap_pair=dyn_unvech(1:npairs); jstore=[]; @@ -201,7 +201,7 @@ if any(idemoments.ino), end end - disp(' ') + skipline() for j=1:npar, iweak = length(find(idemoments.jweak(:,j))); if iweak && ~ismember(j,jstore), @@ -235,9 +235,9 @@ if any(idemoments.ino), % end end if ~any(idemoments.ino) && ~any(any(idemoments.ind0==0)) - disp(' ') + skipline() disp(['All parameters are identified by J moments (rank of J)' ]), - disp(' ') + skipline() end % if ~ options_.noprint && advanced, @@ -267,7 +267,7 @@ end % identificaton patterns if SampleSize==1 && advanced, - disp(' ') + skipline() disp('Press ENTER to print advanced diagnostics'), pause(5), for j=1:size(idemoments.cosnJ,2), pax=NaN(npar,npar); diff --git a/matlab/disp_model_summary.m b/matlab/disp_model_summary.m index 57b170602..8bd5d2b0e 100644 --- a/matlab/disp_model_summary.m +++ b/matlab/disp_model_summary.m @@ -24,9 +24,9 @@ function disp_model_summary(M,dr) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -disp(' ') +skipline() disp('MODEL SUMMARY') -disp(' ') +skipline() disp([' Number of variables: ' int2str(M.endo_nbr)]) disp([' Number of stochastic shocks: ' int2str(M.exo_nbr)]) disp([' Number of state variables: ' ... diff --git a/matlab/disp_steady_state.m b/matlab/disp_steady_state.m index b8eecd35a..354b0f6a4 100644 --- a/matlab/disp_steady_state.m +++ b/matlab/disp_steady_state.m @@ -29,9 +29,9 @@ function disp_steady_state(M,oo) % You should have received a copy of the GNU General Public License % along with Dynare. If not, see . -disp(' ') +skipline() disp('STEADY-STATE RESULTS:') -disp(' ') +skipline() endo_names = M.endo_names; steady_state = oo.steady_state; for i=1:M.orig_endo_nbr diff --git a/matlab/disp_th_moments.m b/matlab/disp_th_moments.m index 6db80e839..d1a4876a2 100644 --- a/matlab/disp_th_moments.m +++ b/matlab/disp_th_moments.m @@ -64,7 +64,7 @@ if ~options_.noprint %options_.nomoments == 0 lh = size(labels,2)+2; dyntable(title,headers,labels,z,lh,11,4); if M_.exo_nbr > 1 && size(stationary_vars, 1) > 0 - disp(' ') + skipline() if options_.order == 2 title='APPROXIMATED VARIANCE DECOMPOSITION (in percent)'; else @@ -91,16 +91,16 @@ if ~options_.noprint %options_.nomoments == 0 end if length(i1) == 0 - disp(' ') + skipline() disp('All endogenous are constant or non stationary, not displaying correlations and auto-correlations') - disp(' ') - return; + skipline() + return end if options_.nocorr == 0 && size(stationary_vars, 1) > 0 corr = oo_.gamma_y{1}(i1,i1)./(sd(i1)*sd(i1)'); if ~options_.noprint, - disp(' ') + skipline() if options_.order == 2 title='APPROXIMATED MATRIX OF CORRELATIONS'; else @@ -122,7 +122,7 @@ if options_.ar > 0 && size(stationary_vars, 1) > 0 z(:,i) = diag(oo_.gamma_y{i+1}(i1,i1)); end if ~options_.noprint, - disp(' ') + skipline() if options_.order == 2 title='APPROXIMATED COEFFICIENTS OF AUTOCORRELATION'; else diff --git a/matlab/display_conditional_variance_decomposition.m b/matlab/display_conditional_variance_decomposition.m index d0b2e6536..7ce71478c 100644 --- a/matlab/display_conditional_variance_decomposition.m +++ b/matlab/display_conditional_variance_decomposition.m @@ -50,10 +50,10 @@ conditional_decomposition_array = conditional_variance_decomposition(StateSpaceM if options_.noprint == 0 if options_.order == 2 - disp(' ') + skipline() disp('APPROXIMATED CONDITIONAL VARIANCE DECOMPOSITION (in percent)') else - disp(' ') + skipline() disp('CONDITIONAL VARIANCE DECOMPOSITION (in percent)') end end diff --git a/matlab/display_estimation_results_table.m b/matlab/display_estimation_results_table.m index 8ae45c01f..1cfcd9d3f 100644 --- a/matlab/display_estimation_results_table.m +++ b/matlab/display_estimation_results_table.m @@ -44,7 +44,7 @@ ncn = estim_params_.ncn; % Covariance of the measurement innovations (number of np = estim_params_.np ; % Number of deep parameters. nx = nvx+nvn+ncx+ncn+np; % Total number of parameters to be estimated. -disp(' ') +skipline() disp(['RESULTS FROM ' upper(table_title) ' ESTIMATION']) LaTeXtitle=strrep(table_title,' ','_'); tstath = abs(xparam1)./stdh; @@ -76,7 +76,7 @@ if np eval(['oo_.' field_name '_std.parameters.' name ' = stdh(ip);']); ip = ip+1; end - disp(' ') + skipline() end if nvx ip = 1; @@ -98,7 +98,7 @@ if nvx eval(['oo_.' field_name '_std.shocks_std.' name ' = stdh(ip);']); ip = ip+1; end - disp(' ') + skipline() end if nvn disp('standard deviation of measurement errors') @@ -119,7 +119,7 @@ if nvx eval(['oo_.' field_name '_std.measurement_errors_std.' name ' = stdh(ip);']); ip = ip+1; end - disp(' ') + skipline() end if ncx @@ -144,7 +144,7 @@ if ncx eval(['oo_.' field_name '_std.shocks_corr.' NAME ' = stdh(ip);']); ip = ip+1; end - disp(' ') + skipline() end if ncn @@ -167,7 +167,7 @@ if ncn eval(['oo_.' field_name '_std.measurement_errors_corr.' NAME ' = stdh(ip);']); ip = ip+1; end - disp(' ') + skipline() end OutputDirectoryName = CheckPath('Output',M_.dname); diff --git a/matlab/dynare.m b/matlab/dynare.m index fb6800c74..06d81f699 100644 --- a/matlab/dynare.m +++ b/matlab/dynare.m @@ -34,11 +34,11 @@ function dynare(fname, varargin) % along with Dynare. If not, see . if strcmpi(fname,'help') - disp(' ') + skipline() disp(['This is dynare version ' dynare_version() '.']) - disp(' ') + skipline() disp('USAGE: dynare FILENAME[.mod,.dyn] [OPTIONS]') - disp(' ') + skipline() disp('dynare executes instruction included in FILENAME.mod.') disp('See the reference manual for the available options.') return diff --git a/matlab/dynare_config.m b/matlab/dynare_config.m index 473b9e1fa..2cd7b7487 100644 --- a/matlab/dynare_config.m +++ b/matlab/dynare_config.m @@ -220,7 +220,7 @@ end %% Test if valid mex files are available, if a mex file is not available %% a matlab version of the routine is included in the path. if verbose - disp(' ') + skipline() disp('Configuring Dynare ...') end @@ -285,7 +285,7 @@ else end if verbose disp([ message 'Markov Switching SBVAR.' ]) - disp(' ') + skipline() end cd(origin); diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m index e99b73bb6..9626306e7 100644 --- a/matlab/dynare_estimation_init.m +++ b/matlab/dynare_estimation_init.m @@ -53,7 +53,7 @@ for i = 1:size(M_.endo_names,1) tmp = strmatch(deblank(M_.endo_names(i,:)),options_.varobs,'exact'); if ~isempty(tmp) if length(tmp)>1 - disp(' ') + skipline() error(['Multiple declarations of ' deblank(M_.endo_names(i,:)) ' as an observed variable is not allowed!']) end options_.lgyidx2varobs(i) = tmp; diff --git a/matlab/dynare_identification.m b/matlab/dynare_identification.m index 47d6133fa..0f22ad9e2 100644 --- a/matlab/dynare_identification.m +++ b/matlab/dynare_identification.m @@ -213,9 +213,9 @@ options_ident.max_dim_cova_group = min([options_ident.max_dim_cova_group,nparam- MaxNumberOfBytes=options_.MaxNumberOfBytes; store_options_ident = options_ident; -disp(' ') +skipline() disp(['==== Identification analysis ====' ]), -disp(' ') +skipline() if iload <=0, @@ -272,11 +272,11 @@ if iload <=0, [idehess_point, idemoments_point, idemodel_point, idelre_point, derivatives_info_point, info] = ... identification_analysis(params,indx,indexo,options_ident,dataset_, prior_exist, name_tex,1); if info(1)~=0, - disp(' ') + skipline() disp('----------- ') disp('Parameter error:') disp(['The model does not solve for ', parameters, ' with error code info = ', int2str(info(1))]), - disp(' ') + skipline() if info(1)==1, disp('info==1 %! The model doesn''t determine the current variables uniquely.') elseif info(1)==2, @@ -305,7 +305,7 @@ if iload <=0, disp('info==30 %! Ergodic variance can''t be computed. ') end disp('----------- ') - disp(' ') + skipline() if any(bayestopt_.pshape) disp('Try sampling up to 50 parameter sets from the prior.') kk=0; @@ -317,15 +317,15 @@ if iload <=0, end end if info(1) - disp(' ') + skipline() disp('----------- ') disp('Identification stopped:') if any(bayestopt_.pshape) disp('The model did not solve for any of 50 attempts of random samples from the prior') end disp('----------- ') - disp(' ') - return, + skipline() + return end else idehess_point.params=params; @@ -343,7 +343,7 @@ if iload <=0, end if SampleSize > 1, - disp(' ') + skipline() disp('Monte Carlo Testing') h = dyn_waitbar(0,'Monte Carlo identification checks ...'); iteration = 0; @@ -587,7 +587,6 @@ else warning on, end -disp(' ') +skipline() disp(['==== Identification analysis completed ====' ]), -disp(' ') -disp(' ') +skipline(2) diff --git a/matlab/dynare_sensitivity.m b/matlab/dynare_sensitivity.m index 719cbf02b..14df1e83b 100644 --- a/matlab/dynare_sensitivity.m +++ b/matlab/dynare_sensitivity.m @@ -215,7 +215,7 @@ if (options_gsa.load_stab || options_gsa.load_rmse || options_gsa.load_redform) any(bayestopt_.p4(~isnan(bayestopt_.p4))~=bkpprior.p4(~isnan(bkpprior.p4))), disp('WARNING!') disp('The saved sample has different priors w.r.t. to current ones!!') - disp('') + skipline() disp('Press ENTER to continue') pause; end @@ -226,7 +226,7 @@ end if options_gsa.stab && ~options_gsa.ppost, x0 = stab_map_(OutputDirectoryName,options_gsa); if isempty(x0), - disp(' ') + skipline() disp('Sensitivity computations stopped: no parameter set provided a unique solution') return end diff --git a/matlab/evaluate_planner_objective.m b/matlab/evaluate_planner_objective.m index e0a7fb747..3067414af 100644 --- a/matlab/evaluate_planner_objective.m +++ b/matlab/evaluate_planner_objective.m @@ -137,11 +137,11 @@ if options.ramsey_policy end if ~options.noprint - disp(' ') + skipline() disp('Approximated value of planner objective function') disp([' - with initial Lagrange multipliers set to 0: ' ... num2str(planner_objective_value(2)) ]) disp([' - with initial Lagrange multipliers set to steady state: ' ... num2str(planner_objective_value(1)) ]) - disp(' ') + skipline() end diff --git a/matlab/forcst_unc.m b/matlab/forcst_unc.m index a402837da..139b09f91 100644 --- a/matlab/forcst_unc.m +++ b/matlab/forcst_unc.m @@ -91,13 +91,11 @@ end oo_.forecast.accept_rate = (replic-m1)/replic; if options_.noprint == 0 && m1 < replic - disp(' ') - disp(' ') + skipline(2) disp('FORECASTING WITH PARAMETER UNCERTAINTY:') disp(sprintf(['The model couldn''t be solved for %f%% of the parameter' ... ' values'],100*oo_.forecast.accept_rate)) - disp(' ') - disp(' ') + skipline(2) end % compute moments diff --git a/matlab/get_prior_info.m b/matlab/get_prior_info.m index c8bd8fddd..cbae72ed1 100644 --- a/matlab/get_prior_info.m +++ b/matlab/get_prior_info.m @@ -167,18 +167,17 @@ if info==2% Prior optimization. bayestopt_.p3, ... bayestopt_.p4,options_,M_,estim_params_,oo_); % Display the results. - disp(' ') - disp(' ') + skipline(2) disp('------------------') disp('PRIOR OPTIMIZATION') disp('------------------') - disp(' ') + skipline() for i = 1:length(xparams) disp(['deep parameter ' int2str(i) ': ' get_the_name(i,0,M_,estim_params_,options_) '.']) disp([' Initial condition ....... ' num2str(xinit(i)) '.']) disp([' Prior mode .............. ' num2str(bayestopt_.p5(i)) '.']) disp([' Optimized prior mode .... ' num2str(xparams(i)) '.']) - disp(' ') + skipline() end end diff --git a/matlab/gsa/Morris_Measure_Groups.m b/matlab/gsa/Morris_Measure_Groups.m index a807b8085..5b6c30720 100644 --- a/matlab/gsa/Morris_Measure_Groups.m +++ b/matlab/gsa/Morris_Measure_Groups.m @@ -40,7 +40,7 @@ function [SAmeas, OutMatrix] = Morris_Measure_Groups(NumFact, Sample, Output, p, % along with Dynare. If not, see . if nargin==0, - disp(' ') + skipline() disp('[SAmeas, OutMatrix] = Morris_Measure_Groups(NumFact, Sample, Output, p, Group);') return end diff --git a/matlab/gsa/filt_mc_.m b/matlab/gsa/filt_mc_.m index 5ced8be59..53bf376db 100644 --- a/matlab/gsa/filt_mc_.m +++ b/matlab/gsa/filt_mc_.m @@ -50,11 +50,10 @@ fname_ = M_.fname; lgy_ = M_.endo_names; dr_ = oo_.dr; -disp(' ') -disp(' ') +skipline(2) disp('Starting sensitivity analysis') disp('for the fit of EACH observed series ...') -disp(' ') +skipline() disp('Deleting old SA figures...') a=dir([OutDir,filesep,'*.*']); tmp1='0'; @@ -149,7 +148,7 @@ if ~loadSA, nruns=size(x,1); nfilt=floor(pfilt*nruns); if options_.opt_gsa.ppost || (options_.opt_gsa.ppost==0 && options_.opt_gsa.lik_only==0) - disp(' ') + skipline() disp('Computing RMSE''s...') fobs = options_.first_obs; nobs=options_.nobs; @@ -408,7 +407,7 @@ else end param_names=param_names(2:end,:); - disp(' ') + skipline() disp('RMSE over the MC sample:') disp(' min yr RMSE max yr RMSE') for j=1:size(vvarvecm,1), @@ -416,8 +415,7 @@ else end invar = find( std(rmse_MC)./mean(rmse_MC)<=0.0001 ); if ~isempty(invar) - disp(' ') - disp(' ') + skipline(2) disp('RMSE is not varying significantly over the MC sample for the following variables:') disp(vvarvecm(invar,:)) disp('These variables are excluded from SA') @@ -427,7 +425,7 @@ else vvarvecm=vvarvecm(ivar,:); rmse_MC=rmse_MC(:,ivar); - disp(' ') + skipline() % if options_.opt_gsa.ppost==0 && options_.opt_gsa.pprior, disp(['Sample filtered the ',num2str(pfilt*100),'% best RMSE''s for each observed series ...' ]) % else @@ -437,8 +435,7 @@ else % set(gca,'xticklabel',vvarvecm) % saveas(gcf,[fname_,'_SA_RMSE']) - disp(' ') - disp(' ') + skipline(2) disp('RMSE ranges after filtering:') if options_.opt_gsa.ppost==0 && options_.opt_gsa.pprior, disp([' best ',num2str(pfilt*100),'% filtered remaining 90%']) @@ -461,7 +458,7 @@ else %%%%% R2 table - disp(' ') + skipline() disp('R2 over the MC sample:') disp(' min yr R2 max yr R2') for j=1:size(vvarvecm,1), @@ -469,11 +466,10 @@ else end r2_MC=r2_MC(:,ivar); - disp(' ') + skipline() disp(['Sample filtered the ',num2str(pfilt*100),'% best R2''s for each observed series ...' ]) - disp(' ') - disp(' ') + skipline() disp('R2 ranges after filtering:') if options_.opt_gsa.ppost==0 && options_.opt_gsa.pprior, disp([' best ',num2str(pfilt*100),'% filtered remaining 90%']) @@ -511,14 +507,13 @@ else % snam=bayestopt_.name(find(nsp>0)); nsnam=(find(nsp>1)); - disp(' ') - disp(' ') + skipline(2 disp('These parameters do not affect significantly the fit of ANY observed series:') disp(snam0) - disp(' ') + skipline() disp('These parameters affect ONE single observed series:') disp(snam1) - disp(' ') + skipline() disp('These parameters affect MORE THAN ONE observed series: trade off exists!') disp(snam2) @@ -594,8 +589,7 @@ else nsx(j)=length(find(SP(:,j))); end - disp(' ') - disp(' ') + skipline(2 disp('Sensitivity table (significance and direction):') vav=char(zeros(1, size(param_names,2)+3 )); ibl = 12-size(vvarvecm,2); @@ -610,8 +604,7 @@ else end - disp(' ') - disp(' ') + skipline() disp('Starting bivariate analysis:') for i=1:size(vvarvecm,1) diff --git a/matlab/gsa/gsa_speed.m b/matlab/gsa/gsa_speed.m index bd3358410..d0845c57f 100644 --- a/matlab/gsa/gsa_speed.m +++ b/matlab/gsa/gsa_speed.m @@ -56,6 +56,6 @@ for i=1:nrun, end dyn_waitbar(i/nrun,h) end -disp(' ') +skipline() disp('.. done !') dyn_waitbar_close(h) diff --git a/matlab/gsa/mc_moments.m b/matlab/gsa/mc_moments.m index 22838d9ce..31fd3bce6 100644 --- a/matlab/gsa/mc_moments.m +++ b/matlab/gsa/mc_moments.m @@ -39,5 +39,5 @@ global options_ M_ dyn_waitbar(j/nsam,h) end dyn_waitbar_close(h) - disp(' ') + skipline() disp('... done !') diff --git a/matlab/gsa/redform_map.m b/matlab/gsa/redform_map.m index eb6c8e0cf..94c56a41d 100644 --- a/matlab/gsa/redform_map.m +++ b/matlab/gsa/redform_map.m @@ -116,7 +116,7 @@ for j=1:size(anamendo,1) for jx=1:size(anamexo,1) namexo=deblank(anamexo(jx,:)); iexo=strmatch(namexo,M_.exo_names,'exact'); - disp(' ') + skipline() disp(['[', namendo,' vs. ',namexo,']']) @@ -162,7 +162,7 @@ for j=1:size(anamendo,1) for jp=1:length(indsmirnov), disp([M_.param_names(estim_params_.param_vals(indsmirnov(jp),1),:),' d-stat = ', num2str(dproba(indsmirnov(jp)),'%1.3f'),' p-value = ', num2str(proba(indsmirnov(jp)),'%1.3f')]) end - disp(' '); + skipline() stab_map_1(x0, iy, iyc, 'threshold',pvalue_ks,indsmirnov,xdir,[],['Reduced Form Mapping (Threshold) for ', namendo,' vs. lagged ', namexo]); stab_map_2(x0(iy,:),alpha2,pvalue_corr,'inside_threshold',xdir,[],['Reduced Form Mapping (Inside Threshold)for ', namendo,' vs. lagged ', namexo]) stab_map_2(x0(iyc,:),alpha2,pvalue_corr,'outside_threshold',xdir,[],['Reduced Form Mapping (Outside Threshold) for ', namendo,' vs. lagged ', namexo]) @@ -218,7 +218,7 @@ for j=1:size(anamendo,1) for je=1:size(anamlagendo,1) namlagendo=deblank(anamlagendo(je,:)); ilagendo=strmatch(namlagendo,M_.endo_names(oo_.dr.order_var(M_.nstatic+1:M_.nstatic+nsok),:),'exact'); - disp(' ') + skipline() disp(['[', namendo,' vs. lagged ',namlagendo,']']) if ~isempty(ilagendo), @@ -261,7 +261,7 @@ for j=1:size(anamendo,1) for jp=1:length(indsmirnov), disp([M_.param_names(estim_params_.param_vals(indsmirnov(jp),1),:),' d-stat = ', num2str(dproba(indsmirnov(jp)),'%1.3f'),' p-value = ', num2str(proba(indsmirnov(jp)),'%1.3f')]) end - disp(' '); + skipline() stab_map_1(x0, iy, iyc, 'threshold',pvalue_ks,indsmirnov,xdir,[],['Reduced Form Mapping (Threshold) for ', namendo,' vs. lagged ', namlagendo]); stab_map_2(x0(iy,:),alpha2,pvalue_corr,'inside_threshold',xdir,[],['Reduced Form Mapping (Inside Threshold) for ', namendo,' vs. lagged ', namlagendo]) stab_map_2(x0(iyc,:),alpha2,pvalue_corr,'outside_threshold',xdir,[],['Reduced Form Mapping (Outside Threshold) for ', namendo,' vs. lagged ', namlagendo]) diff --git a/matlab/gsa/stab_map_.m b/matlab/gsa/stab_map_.m index de220c3c8..ca8a54f7f 100644 --- a/matlab/gsa/stab_map_.m +++ b/matlab/gsa/stab_map_.m @@ -499,9 +499,9 @@ if length(iunstable)>0 && length(iunstable)0 && length(iunstable)ksstat); @@ -543,7 +543,7 @@ if length(iunstable)>0 && length(iunstable)0 && length(iunstable)0 && length(iunstable)0 && length(iunstable) ). save([M_.fname '_mean.mat'],'xparam1','hh','SIGMA'); - -disp(' '); +skipline() disp('MH: I''m computing the posterior log marginal density (modified harmonic mean)... '); detSIGMA = det(SIGMA); invSIGMA = inv(SIGMA); diff --git a/matlab/metropolis_hastings_initialization.m b/matlab/metropolis_hastings_initialization.m index e42407b24..b90f72130 100644 --- a/matlab/metropolis_hastings_initialization.m +++ b/matlab/metropolis_hastings_initialization.m @@ -146,7 +146,7 @@ if ~options_.load_mh_file && ~options_.mh_recover end fprintf(fidlog,' \n'); disp('MH: Initial values found!') - disp(' ') + skipline() else% Case 2: one chain (we start from the posterior mode) fprintf(fidlog,[' Initial values of the parameters:\n']); candidate = transpose(xparam1(:));% @@ -154,7 +154,7 @@ if ~options_.load_mh_file && ~options_.mh_recover ix2 = candidate; ilogpo2 = - feval(TargetFun,ix2',dataset_,options_,M_,estim_params_,bayestopt_,oo_); disp('MH: Initialization at the posterior mode.') - disp(' ') + skipline() fprintf(fidlog,[' Blck ' int2str(1) 'params:\n']); for i=1:length(ix2(1,:)) fprintf(fidlog,[' ' int2str(i) ':' num2str(ix2(1,i)) '\n']); @@ -276,13 +276,13 @@ elseif options_.load_mh_file && ~options_.mh_recover record.MhDraws(end,3) = AnticipatedNumberOfLinesInTheLastFile; save([MhDirectoryName '/' ModelName '_mh_history.mat'],'record'); disp(['MH: ... It''s done. I''ve loaded ' int2str(NumberOfPreviousSimulations) ' simulations.']) - disp(' ') + skipline() fclose(fidlog); elseif options_.mh_recover %% The previous metropolis-hastings crashed before the end! I try to %% recover the saved draws... disp('MH: Recover mode!') - disp(' ') + skipline() file = dir([MhDirectoryName '/' ModelName '_mh_history.mat']); if ~length(file) error('MH:: FAILURE! there is no MH-history file!') diff --git a/matlab/mode_check.m b/matlab/mode_check.m index 6f9299ac1..e7591e21d 100644 --- a/matlab/mode_check.m +++ b/matlab/mode_check.m @@ -65,11 +65,11 @@ end fval = feval(fun,x,DynareDataset,DynareOptions,Model,EstimatedParameters,BayesInfo,DynareResults); if ~isempty(hessian); - disp(' ') + skipline() disp('MODE CHECK') - disp(' ') + skipline() disp(sprintf('Fval obtained by the minimization routine: %f', fval)) - disp(' ') + skipline() if s_min 0 && options_.noprint == 0 end lh = size(labels,2)+2; dyntable(my_title,headers,labels,res_table,lh,10,6); - disp(' ') + skipline() end diff --git a/matlab/newrat.m b/matlab/newrat.m index 3ce1dbd10..5b2c7e7d9 100644 --- a/matlab/newrat.m +++ b/matlab/newrat.m @@ -214,10 +214,10 @@ while norm(gg)>gtol && check==0 && jithtol htol=htol0; - disp(' ') + skipline() disp('Numerical noise in the likelihood') disp('Tolerance has to be relaxed') - disp(' ') + skipline() end if ~outer_product_gradient, H = bfgsi1(H,gg-g(:,icount),xparam1-x(:,icount)); @@ -256,16 +256,16 @@ end save m1.mat x hh g hhg igg fval0 nig if ftol>ftol0 - disp(' ') + skipline() disp('Numerical noise in the likelihood') disp('Tolerance had to be relaxed') - disp(' ') + skipline() end if jit==nit - disp(' ') + skipline() disp('Maximum number of iterations reached') - disp(' ') + skipline() end if norm(gg)<=gtol diff --git a/matlab/osr.m b/matlab/osr.m index ccb7c0c7d..325ab943b 100644 --- a/matlab/osr.m +++ b/matlab/osr.m @@ -34,9 +34,9 @@ for i=1:np i_params(i) = strmatch(deblank(params(i,:)),M_.param_names,'exact'); end -disp(' ') +skipline() disp('OPTIMAL SIMPLE RULE') -disp(' ') +skipline() osr1(i_params,i_var,W); stoch_simul(var_list); \ No newline at end of file diff --git a/matlab/osr1.m b/matlab/osr1.m index 601355f7c..7709368d1 100644 --- a/matlab/osr1.m +++ b/matlab/osr1.m @@ -63,14 +63,14 @@ oo_.osr.objective_function = f; -disp('') +skipline() disp('OPTIMAL VALUE OF THE PARAMETERS:') -disp('') +skipline() for i=1:np disp(sprintf('%16s %16.6g\n',M_.param_names(i_params(i),:),p(i))) end disp(sprintf('Objective function : %16.6g\n',f)); -disp(' ') +skipline() [oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_); % 05/10/03 MJ modified to work with osr.m and give full report \ No newline at end of file diff --git a/matlab/parallel/AnalyseComputationalEnvironment.m b/matlab/parallel/AnalyseComputationalEnvironment.m index 6d5d07430..f6dd9e970 100644 --- a/matlab/parallel/AnalyseComputationalEnvironment.m +++ b/matlab/parallel/AnalyseComputationalEnvironment.m @@ -123,11 +123,9 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' Environment= (OScallerUnix || OStargetUnix); - disp(' '); - disp(' '); + skipline(2) disp(['Testing computer -> ',DataInput(Node).ComputerName,' <- ...']); - disp(' '); - disp(' '); + skipline(2) % The function is composed by two main blocks, determined by the 'Local' % variable. @@ -138,18 +136,14 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' if ((DataInput(Node).Local == 0) |(DataInput(Node).Local == 1)) % Continue it is Ok! disp('Check on Local Variable ..... Ok!'); - disp(' '); - disp(' '); - + skipline() else disp('The variable "Local" has a bad value!'); - disp(' '); + skipline() disp('ErrorCode 1.'); - disp(' '); - disp(' '); + skipline() ErrorCode=1; return - end % %%%%%%%%%% Local (No Network) Computing %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -189,17 +183,14 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' end if (si1) - disp(['It is impossibile to ping to the computer with name "',DataInput(Node).ComputerName,'" using the network!']); - disp(' '); - disp('ErrorCode 3.'); + disp(['It is impossibile to ping to the computer with name "',DataInput(Node).ComputerName,'" using the network!']) + skipline() + disp('ErrorCode 3.') ErrorCode=3; - disp(' '); - disp(' '); -% return; + skipline(2) else - disp('Check on ComputerName Variable ..... Ok!'); - disp(' '); - disp(' '); + disp('Check on ComputerName Variable ..... Ok!') + skipline(2) end @@ -212,34 +203,29 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' % strategy. if (isempty(DataInput(Node).UserName)) - disp('The fields UserName is empty!'); - disp(' '); - disp('ErrorCode 4.'); - disp(' '); - disp(' '); + disp('The fields UserName is empty!') + skipline() + disp('ErrorCode 4.') + skipline(2) ErrorCode=4; return end - disp('Check on UserName Variable ..... Ok!'); - disp(' '); - disp(' '); + disp('Check on UserName Variable ..... Ok!') + skipline(2) % This check can be removed ... according to the dynare parser % strategy. if (~isempty(DataInput(Node).Password)) disp('[WARNING] The field Password should be empty under unix or mac!'); - disp(' '); - disp(['Remove the string ',DataInput(Node).Password,' from this field!']); - disp(' '); - disp('ErrorCode 4.'); - disp(' '); - disp(' '); + skipline() + disp(['Remove the string ',DataInput(Node).Password,' from this field!']) + skipline() + disp('ErrorCode 4.') + skipline(2) ErrorCode=4; - % return else - disp('Check on Password Variable ..... Ok!'); - disp(' '); - disp(' '); + disp('Check on Password Variable ..... Ok!') + skipline(2) end else @@ -248,20 +234,16 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' if (isempty(DataInput(Node).UserName)) || (isempty(DataInput(Node).Password)) disp('The fields UserName and/or Password are/is empty!'); - disp(' '); - disp('ErrorCode 4.'); - disp(' '); - disp(' '); + skipline() + disp('ErrorCode 4.') + skipline(2) ErrorCode=4; return end disp('Check on UserName Variable ..... Ok!'); - disp(' '); - disp(' '); + skipline() disp('Check on Password Variable ..... Ok!'); - disp(' '); - disp(' '); - + skipline() end % Now we very if RemoteDrive and/or RemoteDirectory exist on remote @@ -273,11 +255,10 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' % strategy. if isempty(DataInput(Node).RemoteDirectory) - disp('The field RemoteDirectory is empty!'); - disp(' '); - disp('ErrorCode 5.'); - disp(' '); - disp(' '); + disp('The field RemoteDirectory is empty!') + skipline() + disp('ErrorCode 5.') + skipline() ErrorCode=5; return end @@ -286,15 +267,13 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' % strategy. if (~isempty(DataInput(Node).RemoteDrive)) - disp('[WARNING] The fields RemoteDrive should be empty under unix or mac!'); - disp(' '); - disp(['remove the string ',DataInput(Node).RemoteDrive,' from this field!']); - disp(' '); - disp('ErrorCode 5.'); - disp(' '); - disp(' '); + disp('[WARNING] The fields RemoteDrive should be empty under unix or mac!') + skipline() + disp(['remove the string ',DataInput(Node).RemoteDrive,' from this field!']) + skipline() + disp('ErrorCode 5.') + skipline(2) ErrorCode=5; - % return end si2=[]; @@ -308,32 +287,28 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' [si2 de2]=system(['ssh ',ssh_token,' ',DataInput(Node).UserName,'@',DataInput(Node).ComputerName,' ls ',DataInput(Node).RemoteDirectory,'/',RemoteTmpFolder,'/']); if (si2) - disp ('Remote Directory does not exist or is not reachable!'); - disp(' '); - disp('ErrorCode 5.'); - disp(' '); - disp(' '); + disp ('Remote Directory does not exist or is not reachable!') + skipline() + disp('ErrorCode 5.') + skipline(2) ErrorCode=5; return end - disp('Check on RemoteDirectory Variable ..... Ok!'); - disp(' '); - disp(' '); - disp('Check on RemoteDrive Variable ..... Ok!'); - disp(' '); - disp(' '); + disp('Check on RemoteDirectory Variable ..... Ok!') + skipline(2) + disp('Check on RemoteDrive Variable ..... Ok!') + skipline(2) else % This check can be removed ... according to the dynare parser % strategy. if (isempty(DataInput(Node).RemoteDrive)||isempty(DataInput(Node).RemoteDirectory)) - disp('Remote RemoteDrive and/or RemoteDirectory is/are empty!'); - disp(' '); - disp('ErrorCode 5.'); - disp(' '); - disp(' '); + disp('Remote RemoteDrive and/or RemoteDirectory is/are empty!') + skipline() + disp('ErrorCode 5.') + skipline(2) ErrorCode=5; return end @@ -344,21 +319,18 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' [si2 de2]=system(['dir \\',DataInput(Node).ComputerName,'\',DataInput(Node).RemoteDrive,'$\',DataInput(Node).RemoteDirectory,'\',RemoteTmpFolder]); if (si2) - disp ('Remote Directory does not exist or it is not reachable!'); - disp(' '); - disp('ErrorCode 5.'); - disp(' '); - disp(' '); + disp ('Remote Directory does not exist or it is not reachable!') + skipline() + disp('ErrorCode 5.') + skipline(2) ErrorCode=5; return end - disp('Check on RemoteDirectory Variable ..... Ok!'); - disp(' '); - disp(' '); - disp('Check on RemoteDrive Variable ..... Ok!'); - disp(' '); - disp(' '); + disp('Check on RemoteDirectory Variable ..... Ok!') + skipline(2) + disp('Check on RemoteDrive Variable ..... Ok!') + skipline(2) end @@ -407,17 +379,15 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' delete ('Tracing.m'); if (isempty(FindTracing)) - disp ('It is impossible to exchange data with Remote Drive and/or Remote Directory! ErrorCode 6.'); - disp(' '); - disp('ErrorCode 6.'); - disp(' '); - disp(' '); + disp('It is impossible to exchange data with Remote Drive and/or Remote Directory! ErrorCode 6.') + skipline() + disp('ErrorCode 6.') + skipline(2) ErrorCode=6; return else - disp('Check on Exchange File with Remote Computer ..... Ok!'); - disp(' '); - disp(' '); + disp('Check on Exchange File with Remote Computer ..... Ok!') + skipline(2) end @@ -466,10 +436,10 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' while (1); if Flag==0 - disp('Try to run matlab/octave on remote machine ... '); - disp(' '); - disp('please wait ... '); - disp(' '); + disp('Try to run matlab/octave on remote machine ... ') + skipline() + disp('please wait ... ') + skipline() Flag=1; end nt=fix(clock); @@ -486,25 +456,22 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' if (ErrorCode==7) - disp ('It is not possible execute a matlab session on remote machine!'); - disp(' '); - disp('ErrorCode 7.'); - disp(' '); - disp(' '); + disp ('It is not possible execute a matlab session on remote machine!') + skipline() + disp('ErrorCode 7.') + skipline(2) ErrorCode=7; dynareParallelRmDir(RemoteTmpFolder,DataInput(Node)); return - else - disp('Check on MatlabOctave Path and MatlabOctave Program Execution on remote machine ..... Ok!'); - disp(' '); - disp(' '); + disp('Check on MatlabOctave Path and MatlabOctave Program Execution on remote machine ..... Ok!') + skipline(2) % Now we verify if the DynarePath is correct ... - disp('Check the Dynare path on remote machine ... '); - disp(' '); - disp('please wait ... '); - disp(' '); + disp('Check the Dynare path on remote machine ... ') + skipline() + disp('please wait ... ') + skipline(2) pause(2) if isempty(dynareParallelDir('DynareIsOk.txt',RemoteTmpFolder,DataInput(Node))) @@ -512,20 +479,16 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' end if (ErrorCode==8) - - disp ('The DynarePath is incorrect!'); - disp(' '); - disp('ErrorCode 8.'); - disp(' '); - disp(' '); + disp ('The DynarePath is incorrect!') + skipline() + disp('ErrorCode 8.') + skipline(2) ErrorCode=8; dynareParallelRmDir(RemoteTmpFolder,DataInput(Node)); return - else - disp('Check on Dynare Path remote machine ..... Ok!'); - disp(' '); - disp(' '); + disp('Check on Dynare Path remote machine ..... Ok!') + skipline(2) end end @@ -539,15 +502,13 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' si3=dynareParallelDir('Tracing.m', RemoteTmpFolder,DataInput(Node)); if (isempty(si3)) - disp ('Check on Delete Remote Computational Traces ..... Ok!'); - disp(' '); - disp(' '); + disp ('Check on Delete Remote Computational Traces ..... Ok!') + skipline(2) else - disp ('It is impossible to delete temporary files on remote machine!'); - disp(' '); - disp('ErrorCode 9.'); - disp(' '); - disp(' '); + disp ('It is impossible to delete temporary files on remote machine!') + skipline() + disp('ErrorCode 9.') + skipline(2) ErrorCode=9; return end @@ -563,11 +524,10 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' if yn==1 % The field is empty! - disp('The field "CPUnbr" is empty!'); - disp(' '); - disp('ErrorCode 2.'); - disp(' '); - disp(' '); + disp('The field "CPUnbr" is empty!') + skipline() + disp('ErrorCode 2.') + skipline(2) ErrorCode=2; return end @@ -620,16 +580,16 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' if isempty (RealCPUnbr) % An error occurred when we try to know the Cpu/Cores % numbers. - disp('It is impossible determine the number of Cpu/Processor avaiable on this machine!'); - disp(' '); - disp('ErrorCode 2.'); - disp(' '); + disp('It is impossible determine the number of Cpu/Processor avaiable on this machine!') + skipline() + disp('ErrorCode 2.') + skipline() if Environment - disp('Check the command "$less /proc/cpuinfo" ... !'); + disp('Check the command "$less /proc/cpuinfo" ... !') else - disp('Check if the pstools are installed and are in machine path! And check the command "psinfo \\"'); + disp('Check if the pstools are installed and are in machine path! And check the command "psinfo \\"') end - disp(' '); + skipline() ErrorCode=2; return end @@ -642,38 +602,25 @@ for Node=1:length(DataInput) % To obtain a recoursive function remove the 'for' CPUnbrUser=length(DataInput(Node).CPUnbr); maxCPUnbrUser=max(DataInput(Node).CPUnbr)+1; - disp(['Hardware has ', num2str(RealCPUnbr),' Cpu/Cores!']); - disp(['User requires ',num2str(CPUnbrUser),' Cpu/Cores!']); + disp(['Hardware has ', num2str(RealCPUnbr),' Cpu/Cores!']) + disp(['User requires ',num2str(CPUnbrUser),' Cpu/Cores!']) if CPUnbrUser==RealCPUnbr, % It is Ok! - disp('Check on CPUnbr Variable ..... Ok!'); - disp(' '); - disp(' '); - disp(' '); - + disp('Check on CPUnbr Variable ..... Ok!') + skipline(3) end if CPUnbrUser > RealCPUnbr - disp('Warning! The user asks to use more CPU''s than those available.'); - disp(' '); - disp(' '); + disp('Warning! The user asks to use more CPU''s than those available.') + skipline(2) ErrorCode=2.1; - % return - end if CPUnbrUser < RealCPUnbr - disp('Warning! There are unused CPU''s!'); - disp(' '); - disp(' '); + disp('Warning! There are unused CPU''s!') + skipline(2) ErrorCode=2.2; - % return end - disp(['Test for Cluster computation, computer ',DataInput(Node).ComputerName, ' ..... Passed!']); - disp(' '); - disp(' '); - - -end - -return \ No newline at end of file + disp(['Test for Cluster computation, computer ',DataInput(Node).ComputerName, ' ..... Passed!']) + skipline(2) +end \ No newline at end of file diff --git a/matlab/plot_identification.m b/matlab/plot_identification.m index b37129510..278133ce7 100644 --- a/matlab/plot_identification.m +++ b/matlab/plot_identification.m @@ -88,7 +88,7 @@ if SampleSize == 1, if advanced, if ~options_.nodisplay, - disp(' ') + skipline() disp('Press ENTER to plot advanced diagnostics'), pause(5), end hh = dyn_figure(options_,'Name',[tittxt, ' - Sensitivity plot']); @@ -152,7 +152,7 @@ if SampleSize == 1, xlabel([tittxt,' - Collinearity patterns with ', int2str(j) ,' parameter(s)'],'interpreter','none') dyn_saveas(hh,[ IdentifDirectoryName '/' M_.fname '_ident_collinearity_' tittxt1 '_' int2str(j) ],options_); end - disp('') + skipline() if idehess.flag_score, [U,S,V]=svd(idehess.AHess,0); S=diag(S); @@ -232,7 +232,7 @@ else dyn_saveas(hh,[ IdentifDirectoryName '/' M_.fname '_MC_sensitivity' ],options_); if advanced, if ~options_.nodisplay, - disp(' ') + skipline() disp('Press ENTER to display advanced diagnostics'), pause(5), end % options_.nograph=1; diff --git a/matlab/random_walk_metropolis_hastings.m b/matlab/random_walk_metropolis_hastings.m index f64603f69..91cd69534 100644 --- a/matlab/random_walk_metropolis_hastings.m +++ b/matlab/random_walk_metropolis_hastings.m @@ -168,4 +168,4 @@ disp(['MH: Total number of generated files : ' int2str(NewFile(1)*nblck) '. disp(['MH: Total number of iterations : ' int2str((NewFile(1)-1)*MAX_nruns+irun-1) '.']) disp('MH: average acceptation rate per chain : ') disp(record.AcceptationRates); -disp(' ') +skipline() diff --git a/matlab/resid.m b/matlab/resid.m index 807bb435f..a69ba8fe3 100644 --- a/matlab/resid.m +++ b/matlab/resid.m @@ -83,12 +83,10 @@ M_.Sigma_e = Sigma_e; % Display the non-zero residuals if no return value if nargout == 0 - for i = 1:4 - disp(' ') - end + skipline(4) ind = []; disp('Residuals of the static equations:') - disp(' ') + skipline() for i=1:M_.orig_endo_nbr if abs(z(i)) < options_.dynatol.f/100 tmp = 0; @@ -107,9 +105,7 @@ if nargout == 0 disp( ['Equation number ', int2str(i) ,' : ', num2str(tmp) ,' : ' s]) end end - for i = 1:2 - disp(' ') - end + skipline(2) end if info(1) diff --git a/matlab/set_dynare_seed.m b/matlab/set_dynare_seed.m index c9eb42a9a..991b8ed57 100644 --- a/matlab/set_dynare_seed.m +++ b/matlab/set_dynare_seed.m @@ -73,9 +73,9 @@ if matlab_random_streams% Use new matlab interface. strcmpi(a,'swb2712') ) disp('set_dynare_seed:: First argument must be string designing the uniform random number algorithm!') RandStream.list - disp(' ') + skipline() disp('set_dynare_seed:: Change the first input accordingly...') - disp(' ') + skipline() error(' ') end if ~isint(b) diff --git a/matlab/simplex_optimization_routine.m b/matlab/simplex_optimization_routine.m index 5c19b270d..b06135c62 100644 --- a/matlab/simplex_optimization_routine.m +++ b/matlab/simplex_optimization_routine.m @@ -167,11 +167,11 @@ trend_vector_2 = 2:(number_of_variables+1); % Set initial simplex around the initial guess (x). if verbose - for i=1:3, disp(' '), end + skipline(3) disp('+----------------------+') disp(' SIMPLEX INITIALIZATION ') disp('+----------------------+') - disp(' ') + skipline() end initial_point = x; [initial_score,junk1,junk2,nopenalty] = feval(objective_function,x,varargin{:}); @@ -188,7 +188,7 @@ else for i=1:number_of_variables fprintf(1,'%s: \t\t\t %+8.6f \t\t\t %+8.6f \t\t\t %+8.6f \t\t\t %+8.6f \t\t\t %+8.6f \n',bayestopt_.name{i},v(i,1), v(i,end), mean(v(i,:),2), min(v(i,:),[],2), max(v(i,:),[],2)); end - disp(' ') + skipline() end end @@ -247,8 +247,7 @@ while (func_count < max_func_calls) && (iter_count < max_iterations) && (simplex if fxe < fxr% xe is even better than xr. if optimize_expansion_parameter if verbose>1 - disp('') - disp('') + skipline(2) disp('Compute optimal expansion...') end xee = xbar + rho*chi*1.01*(xbar-v(:,end)); @@ -316,8 +315,7 @@ while (func_count < max_func_calls) && (iter_count < max_iterations) && (simplex end if verbose>1 disp('Done!') - disp(' ') - disp(' ') + skipline(2) end end v(:,end) = xe; @@ -384,7 +382,7 @@ while (func_count < max_func_calls) && (iter_count < max_iterations) && (simplex disp(['Norm of dSimplex: ' num2str(norm(v-vold,'fro'))]) disp(['Crit. f: ' num2str(critF)]) disp(['Crit. x: ' num2str(critX)]) - disp(' ') + skipline() end if verbose && max(abs(best_point-v(:,1)))>x_tolerance; if verbose<2 @@ -395,14 +393,14 @@ while (func_count < max_func_calls) && (iter_count < max_iterations) && (simplex disp(['Norm of dSimplex: ' num2str(norm(v-vold,'fro'))]) disp(['Crit. f: ' num2str(critF)]) disp(['Crit. x: ' num2str(critX)]) - disp(' ') + skipline() end disp(['Current parameter values: ']) fprintf(1,'%s: \t\t\t %s \t\t\t %s \t\t\t %s \t\t\t %s \t\t\t %s \n','Names','Best point', 'Worst point', 'Mean values', 'Min values', 'Max values'); for i=1:number_of_variables fprintf(1,'%s: \t\t\t %+8.6f \t\t\t %+8.6f \t\t\t %+8.6f \t\t\t %+8.6f \t\t\t %+8.6f \n',bayestopt_.name{i}, v(i,1), v(i,end), mean(v(i,:),2), min(v(i,:),[],2), max(v(i,:),[],2)); end - disp(' ') + skipline() end if abs(best_point_score-fv(1))2 estimated_parameters_optimization_path = [NaN;xparam]; save('optimization_path.mat','estimated_parameters_optimization_path'); end - disp(' ') + skipline() disp('Master talks to its slaves...') - disp(' ') + skipline() % Save the workspace. save('master_variables.mat','options_','M_','oo_'); % Send the workspace to each remote computer. - disp('') + skipline() for i = 1:length(parallel) if ~strcmpi(hostname,parallel(i).machine) unix(['scp master_variables.mat ' , parallel(i).login , '@' , parallel(i).machine , ':' parallel(i).folder]); @@ -191,9 +191,9 @@ if nargin>2 end end end - disp(' ') + skipline() disp('... And slaves do as ordered.') - disp(' ') + skipline() if exist('intermediary_results_from_master_and_slaves','dir') unix('rm -rf intermediary_results_from_master_and_slaves'); end @@ -201,7 +201,7 @@ if nargin>2 unix('chmod -R u+x intermediary_results_from_master_and_slaves'); end -disp(''); +skipline() if options.optimization_routine==1 % Set options for csminwel. diff --git a/matlab/utilities/general/skipline.m b/matlab/skipline.m similarity index 100% rename from matlab/utilities/general/skipline.m rename to matlab/skipline.m diff --git a/matlab/solve1.m b/matlab/solve1.m index 52eb8460e..0cacf6e3a 100644 --- a/matlab/solve1.m +++ b/matlab/solve1.m @@ -136,7 +136,7 @@ for its = 1:maxit end check = 1; -disp(' ') +skipline() disp('SOLVE: maxit has been reached') % 01/14/01 MJ lnsearch is now a separate function diff --git a/matlab/steady.m b/matlab/steady.m index 510d1f89f..5ae9a0ac9 100644 --- a/matlab/steady.m +++ b/matlab/steady.m @@ -55,7 +55,7 @@ end if info(1) hv = options_.homotopy_values; - disp(' ') + skipline() disp('WARNING: homotopy step was not completed') disp('The last values for which a solution was found are:') for i=1:length(ip) diff --git a/matlab/stoch_simul.m b/matlab/stoch_simul.m index bf22883d9..8de0e4bfe 100644 --- a/matlab/stoch_simul.m +++ b/matlab/stoch_simul.m @@ -83,9 +83,9 @@ if info(1) end if ~options_.noprint - disp(' ') + skipline() disp('MODEL SUMMARY') - disp(' ') + skipline() disp([' Number of variables: ' int2str(M_.endo_nbr)]) disp([' Number of stochastic shocks: ' int2str(M_.exo_nbr)]) disp([' Number of state variables: ' int2str(M_.nspred)]) @@ -97,9 +97,9 @@ if ~options_.noprint lh = size(labels,2)+2; dyntable(my_title,headers,labels,M_.Sigma_e,lh,10,6); if options_.partial_information - disp(' ') + skipline() disp('SOLUTION UNDER PARTIAL INFORMATION') - disp(' ') + skipline() if isfield(options_,'varobs')&& ~isempty(options_.varobs) PCL_varobs=options_.varobs; @@ -113,7 +113,7 @@ if ~options_.noprint disp([' ' PCL_varobs(i,:)]) end end - disp(' ') + skipline() if options_.order <= 2 && ~PI_PCL_solver disp_dr(oo_.dr,options_.order,var_list); end diff --git a/matlab/utilities/dataset/initialize_dataset.m b/matlab/utilities/dataset/initialize_dataset.m index f43bee9be..c890e83fd 100644 --- a/matlab/utilities/dataset/initialize_dataset.m +++ b/matlab/utilities/dataset/initialize_dataset.m @@ -48,10 +48,10 @@ dataset_.info.varobs = varobs; % Test the number of variables in the database. if dataset_.info.nvobs-size(rawdata,2) - disp(' ') + skipline() disp(['Declared number of observed variables = ' int2str(dataset.info.nvobs)]) disp(['Number of variables in the database = ' int2str(size(rawdata,2))]) - disp(' ') + skipline() error(['Estimation can''t take place because the declared number of observed' ... 'variables doesn''t match the number of variables in the database.']) end diff --git a/matlab/utilities/doc/dynInfo.m b/matlab/utilities/doc/dynInfo.m index 3c20d0e77..952c5bbe1 100644 --- a/matlab/utilities/doc/dynInfo.m +++ b/matlab/utilities/doc/dynInfo.m @@ -68,8 +68,7 @@ if strcmp(ext(2:end),'m') fprintf(fid,'%s\n',deblank(block(i,:))); end fclose(fid); - disp(' ') - disp(' ') + skipline(2) system(['makeinfo --plaintext --no-split --no-validate ' fun '.texi']); delete([fun '.texi']); else