From ffd6400c1bbab08dafc1da0bc08610aa892f55ab Mon Sep 17 00:00:00 2001 From: sebastien <sebastien@ac1d8469-bf42-47a9-8791-bf33cf982152> Date: Fri, 5 Sep 2008 16:46:25 +0000 Subject: [PATCH] v4.0: cosmetic changes git-svn-id: https://www.dynare.org/svn/dynare/branches/4.0@2046 ac1d8469-bf42-47a9-8791-bf33cf982152 --- matlab/CutSample.m | 2 +- matlab/GetPosteriorParametersStatistics.m | 2 +- matlab/check_list_of_variables.m | 2 +- matlab/csminwel.m | 9 ++++----- matlab/dynare_estimation.m | 3 +-- matlab/metropolis_hastings_initialization.m | 6 +++--- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/matlab/CutSample.m b/matlab/CutSample.m index 845bed8b81..bb2e8feca9 100644 --- a/matlab/CutSample.m +++ b/matlab/CutSample.m @@ -48,7 +48,7 @@ else end TotalNumberOfMhFiles = sum(record.MhDraws(:,2)); TotalNumberOfMhDraws = sum(record.MhDraws(:,1)); -MAX_nruns = ceil(options_.MaxNumberOfBytes/(npar+2)/8) +MAX_nruns = ceil(options_.MaxNumberOfBytes/(npar+2)/8); FirstDraw = max(1,floor(options_.mh_drop*TotalNumberOfMhDraws)); FirstMhFile = ceil(FirstDraw/MAX_nruns); FirstLine = FirstDraw-(FirstMhFile-1)*MAX_nruns+1; diff --git a/matlab/GetPosteriorParametersStatistics.m b/matlab/GetPosteriorParametersStatistics.m index a0bec03f97..a23363712a 100644 --- a/matlab/GetPosteriorParametersStatistics.m +++ b/matlab/GetPosteriorParametersStatistics.m @@ -51,7 +51,7 @@ OutputDirectoryName = CheckPath('Output'); load([ DirectoryName '/' M_.fname '_mh_history']) FirstMhFile = record.KeepedDraws.FirstMhFile; FirstLine = record.KeepedDraws.FirstLine; -TotalNumberOfMhFiles = sum(record.MhDraws(:,2)) +TotalNumberOfMhFiles = sum(record.MhDraws(:,2)); TotalNumberOfMhDraws = sum(record.MhDraws(:,1)); FirstMhFile = record.KeepedDraws.FirstMhFile; NumberOfDraws = TotalNumberOfMhDraws-floor(options_.mh_drop*TotalNumberOfMhDraws); diff --git a/matlab/check_list_of_variables.m b/matlab/check_list_of_variables.m index 7ed79ccd96..6705ced009 100644 --- a/matlab/check_list_of_variables.m +++ b/matlab/check_list_of_variables.m @@ -33,7 +33,7 @@ function varlist = check_list_of_variables(options_, M_, varlist) if isempty(varlist) disp(' ') - disp(['You did not declared endogenous variables after the estimation command.']) + disp(['You did not declare endogenous variables after the estimation command.']) cas = []; if options_.bayesian_irf cas = 'Posterior IRFs'; diff --git a/matlab/csminwel.m b/matlab/csminwel.m index 809d7314e4..e3439d8402 100644 --- a/matlab/csminwel.m +++ b/matlab/csminwel.m @@ -198,7 +198,6 @@ while ~done end wall3=badg3; % g3 - badg3 save g3.mat g3 x3 f3 varargin; %ARGLIST %save g3 g3 x3 f3 P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13; @@ -219,17 +218,17 @@ while ~done end %how to pick gh and xh if f3 < f - crit & badg3==0 - ih=3 + ih=3; fh=f3;xh=x3;gh=g3;badgh=badg3;retcodeh=retcode3; elseif f2 < f - crit & badg2==0 - ih=2 + ih=2; fh=f2;xh=x2;gh=g2;badgh=badg2;retcodeh=retcode2; elseif f1 < f - crit & badg1==0 - ih=1 + ih=1; fh=f1;xh=x1;gh=g1;badgh=badg1;retcodeh=retcode1; else [fh,ih] = min([f1,f2,f3]); - disp(sprintf('ih = %d',ih)) + %disp(sprintf('ih = %d',ih)) %eval(['xh=x' num2str(ih) ';']) switch ih case 1 diff --git a/matlab/dynare_estimation.m b/matlab/dynare_estimation.m index 1ed04fa0de..f2e076a718 100644 --- a/matlab/dynare_estimation.m +++ b/matlab/dynare_estimation.m @@ -276,7 +276,7 @@ else% if the steady state file is not provided. oo_.steady_state = dd.ys; clear('dd'); end if all(abs(oo_.steady_state(bayestopt_.mfys))<1e-9) - disp('no constant') + disp('No constant.') options_.noconstant = 1; else options_.noconstant = 0; @@ -934,7 +934,6 @@ if (any(bayestopt_.pshape >0 ) & options_.mh_replic) | ... %% Results are saved (in case of an anormal exit from dynare or matlab)... %%save([M_.fname '_results.mat'],'oo_','M_'); %% - oo_ oo_ = PlotPosteriorDistributions(estim_params_, M_, options_, bayestopt_, oo_); metropolis_draw(1); if options_.bayesian_irf diff --git a/matlab/metropolis_hastings_initialization.m b/matlab/metropolis_hastings_initialization.m index 1af16a4b58..c7779afaee 100644 --- a/matlab/metropolis_hastings_initialization.m +++ b/matlab/metropolis_hastings_initialization.m @@ -63,12 +63,12 @@ if ~options_.load_mh_file & ~options_.mh_recover files = dir([ MhDirectoryName '/' ModelName '_mh*_blck*.mat']); if length(files) delete([ MhDirectoryName '/' ModelName '_mh*_blck*.mat']); - disp('MH: Old _mh files succesfully erased!') + disp('MH: Old _mh files successfully erased!') end file = dir([ MhDirectoryName '/metropolis.log']); if length(file) delete([ MhDirectoryName '/metropolis.log']); - disp('MH: Old metropolis.log file succesfully erased!') + disp('MH: Old metropolis.log file successfully erased!') disp('MH: Creation of a new metropolis.log file.') end fidlog = fopen([MhDirectoryName '/metropolis.log'],'w'); @@ -150,7 +150,7 @@ if ~options_.load_mh_file & ~options_.mh_recover file = dir([MhDirectoryName '/' ModelName '_mh_history.mat']); if length(files) delete([ MhDirectoryName '/' ModelName '_mh_history.mat']); - disp('MH: Old mh_history file succesfully erased!') + disp('MH: Old mh_history file successfully erased!') end AnticipatedNumberOfFiles = ceil(nruns(1)/MAX_nruns); AnticipatedNumberOfLinesInTheLastFile = nruns(1) - (AnticipatedNumberOfFiles-1)*MAX_nruns; -- GitLab