Skip to content
Snippets Groups Projects
Commit 1e4a7c2c authored by stepan's avatar stepan
Browse files

* Cosmetic changes.

* Bug fix (with octave-3.2.2) in McMCDiagnostics.m

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2973 ac1d8469-bf42-47a9-8791-bf33cf982152
parent 79125b89
Branches
No related tags found
No related merge requests found
...@@ -48,12 +48,15 @@ MAX_nruns = ceil(options_.MaxNumberOfBytes/(npar+2)/8); ...@@ -48,12 +48,15 @@ MAX_nruns = ceil(options_.MaxNumberOfBytes/(npar+2)/8);
load([MhDirectoryName '/' M_.fname '_mh_history.mat']) load([MhDirectoryName '/' M_.fname '_mh_history.mat'])
mcfiles = []; NumberOfMcFilesPerBlock = size(dir([MhDirectoryName ,filesep, M_.fname '_mh*_blck1.mat']),1);
for blck = 1:nblck for blck = 2:nblck
mcfiles = cat(3,mcfiles,dir([MhDirectoryName ,filesep, M_.fname '_mh*_blck' int2str(blck) '.mat'])); tmp = size(dir([MhDirectoryName ,filesep, M_.fname '_mh*_blck' int2str(blck) '.mat']),1);
if tmp~=NumberOfMcFilesPerBlock
disp(['McMCDiagnostics:: The number of mh files in chain ' int2str(blck) ' is ' int2str(tmp) ' while'])
disp([' the number of mh files in chain 1 is ' int2str(mcfiles) '!'])
error('The number of mh files has to be constant across chains!')
end
end end
NumberOfMcFilesPerBlock = size(mcfiles,1);
PastDraws = sum(record.MhDraws,1); PastDraws = sum(record.MhDraws,1);
LastFileNumber = PastDraws(2); LastFileNumber = PastDraws(2);
...@@ -81,7 +84,6 @@ if TeX ...@@ -81,7 +84,6 @@ if TeX
fprintf(fidTeX,' \n'); fprintf(fidTeX,' \n');
end end
disp('MCMC Diagnostics: Univariate convergence diagnostic, Brooks and Gelman (1998):') disp('MCMC Diagnostics: Univariate convergence diagnostic, Brooks and Gelman (1998):')
localVars.MhDirectoryName = MhDirectoryName; localVars.MhDirectoryName = MhDirectoryName;
...@@ -98,16 +100,12 @@ if isnumeric(options_.parallel),% | isunix, % for the moment exclude unix platfo ...@@ -98,16 +100,12 @@ if isnumeric(options_.parallel),% | isunix, % for the moment exclude unix platfo
fout = McMCDiagnostics_core(localVars,1,npar,0); fout = McMCDiagnostics_core(localVars,1,npar,0);
UDIAG = fout.UDIAG; UDIAG = fout.UDIAG;
clear fout clear fout
else else
[fout, nBlockPerCPU, totCPU] = masterParallel(options_.parallel, 1, npar,{},'McMCDiagnostics_core', localVars); [fout, nBlockPerCPU, totCPU] = masterParallel(options_.parallel, 1, npar,{},'McMCDiagnostics_core', localVars);
UDIAG = fout(1).UDIAG; UDIAG = fout(1).UDIAG;
for j=2:totCPU, for j=2:totCPU,
UDIAG = cat(3,UDIAG ,fout(j).UDIAG); UDIAG = cat(3,UDIAG ,fout(j).UDIAG);
end end
end end
% for j=1:npar % for j=1:npar
......
...@@ -24,7 +24,6 @@ UDIAG = zeros(NumberOfLines,6,npar-fpar+1); ...@@ -24,7 +24,6 @@ UDIAG = zeros(NumberOfLines,6,npar-fpar+1);
waitbarTitle=[Parallel(ThisMatlab).PcName]; waitbarTitle=[Parallel(ThisMatlab).PcName];
end end
fMessageStatus(0,whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab), MasterName, DyMo); fMessageStatus(0,whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab), MasterName, DyMo);
end end
for j=fpar:npar, for j=fpar:npar,
fprintf(' Parameter %d... ',j); fprintf(' Parameter %d... ',j);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment