Fixes with screen output for parallel/octave + cosmethics
parent
8111b671ff
commit
bed32115d2
|
@ -73,7 +73,13 @@ if whoiam
|
|||
fMessageStatus(0,whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab));
|
||||
end
|
||||
for j=fpar:npar,
|
||||
if exist('OCTAVE_VERSION'),
|
||||
if (whoiam==0),
|
||||
printf(' Parameter %d... ',j);
|
||||
end
|
||||
else
|
||||
fprintf(' Parameter %d... ',j);
|
||||
end
|
||||
for b = 1:nblck
|
||||
startline = 0;
|
||||
for n = 1:NumberOfMcFilesPerBlock
|
||||
|
@ -85,11 +91,11 @@ for j=fpar:npar,
|
|||
% clear x2;
|
||||
startline = startline + nx2;
|
||||
end
|
||||
% $$$ %load([MhDirectoryName '/' mcfiles(NumberOfMcFilesPerBlock,1,b).name],'x2');
|
||||
% $$$ load([MhDirectoryName '/' M_.fname '_mh',int2str(NumberOfMcFilesPerBlock),'_blck' int2str(b) '.mat'],'x2');
|
||||
% $$$ tmp((b-1)*NumberOfDraws+startline+1:(b-1)*NumberOfDraws+MAX_nruns*(LastFileNumber-1)+LastLineNumber,1) = x2(:,j);
|
||||
% $$$ clear x2;
|
||||
% $$$ startline = startline + LastLineNumber;
|
||||
% $$$ %load([MhDirectoryName '/' mcfiles(NumberOfMcFilesPerBlock,1,b).name],'x2');
|
||||
% $$$ load([MhDirectoryName '/' M_.fname '_mh',int2str(NumberOfMcFilesPerBlock),'_blck' int2str(b) '.mat'],'x2');
|
||||
% $$$ tmp((b-1)*NumberOfDraws+startline+1:(b-1)*NumberOfDraws+MAX_nruns*(LastFileNumber-1)+LastLineNumber,1) = x2(:,j);
|
||||
% $$$ clear x2;
|
||||
% $$$ startline = startline + LastLineNumber;
|
||||
end
|
||||
tmp(:,2) = kron(transpose(1:nblck),ones(NumberOfDraws,1));
|
||||
tmp(:,3) = kron(ones(nblck,1),time');
|
||||
|
@ -116,7 +122,13 @@ for j=fpar:npar,
|
|||
UDIAG(ligne,6,j-fpar+1) = UDIAG(ligne,6,j-fpar+1) + sum(abs(pmet(:,1)-moyenne).^3)/(n-1);
|
||||
end
|
||||
end
|
||||
if exist('OCTAVE_VERSION'),
|
||||
if (whoiam==0),
|
||||
printf('Done! \n');
|
||||
end
|
||||
else
|
||||
fprintf('Done! \n');
|
||||
end
|
||||
if whoiam,
|
||||
waitbarString = [ 'Parameter ' int2str(j) '/' int2str(npar) ' done.'];
|
||||
fMessageStatus((j-fpar+1)/(npar-fpar+1),whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab))
|
||||
|
|
|
@ -266,13 +266,17 @@ while fpar<npar
|
|||
ifil2 = ifil2 + 1;
|
||||
irun2 = 0;
|
||||
end
|
||||
if exist('OCTAVE_VERSION')
|
||||
if exist('OCTAVE_VERSION'),
|
||||
if (whoiam==0),
|
||||
printf(['Posterior IRF %3.f%% done\r'],(fpar/npar*100));
|
||||
elseif ~whoiam
|
||||
end
|
||||
elseif ~whoiam,
|
||||
waitbar(fpar/npar,h);
|
||||
end
|
||||
if whoiam,
|
||||
if ~exist('OCTAVE_VERSION')
|
||||
fprintf('Done! \n');
|
||||
end
|
||||
waitbarString = [ 'Subdraw ' int2str(fpar) '/' int2str(npar) ' done.'];
|
||||
fMessageStatus((fpar-fpar0)/(npar-fpar0),whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab));
|
||||
end
|
||||
|
|
|
@ -164,7 +164,9 @@ for b = fblck:nblck,
|
|||
if exist('OCTAVE_VERSION') || options_.console_mode
|
||||
if mod(j, 10) == 0
|
||||
if exist('OCTAVE_VERSION')
|
||||
if (whoiam==0),
|
||||
printf('MH: Computing Metropolis-Hastings (chain %d/%d): %3.f%% done, acception rate: %3.f%%\r', b, nblck, 100 * prtfrc, 100 * isux / j);
|
||||
end
|
||||
else
|
||||
fprintf(' MH: Computing Metropolis-Hastings (chain %d/%d): %3.f \b%% done, acception rate: %3.f \b%%\r', b, nblck, 100 * prtfrc, 100 * isux / j);
|
||||
end
|
||||
|
|
|
@ -115,15 +115,15 @@ else
|
|||
end
|
||||
|
||||
if RemoteFlag==1,
|
||||
OutputFileName_smooth = {};
|
||||
OutputFileName_update = {};
|
||||
OutputFileName_inno = {};
|
||||
OutputFileName_error = {};
|
||||
OutputFileName_filter_step_ahead = {};
|
||||
OutputFileName_param = {};
|
||||
OutputFileName_forc_mean = {};
|
||||
OutputFileName_forc_point = {};
|
||||
% OutputFileName_moments = {};
|
||||
OutputFileName_smooth = {};
|
||||
OutputFileName_update = {};
|
||||
OutputFileName_inno = {};
|
||||
OutputFileName_error = {};
|
||||
OutputFileName_filter_step_ahead = {};
|
||||
OutputFileName_param = {};
|
||||
OutputFileName_forc_mean = {};
|
||||
OutputFileName_forc_point = {};
|
||||
% OutputFileName_moments = {};
|
||||
end
|
||||
|
||||
for b=fpar:B
|
||||
|
@ -287,17 +287,21 @@ for b=fpar:B
|
|||
% irun(8) = 1;
|
||||
% end
|
||||
|
||||
% DirectoryName=TempPath;
|
||||
% DirectoryName=TempPath;
|
||||
|
||||
|
||||
if exist('OCTAVE_VERSION')
|
||||
if exist('OCTAVE_VERSION'),
|
||||
if (whoiam==0),
|
||||
printf('Taking subdraws: %3.f%% done\r', b/B*100);
|
||||
end
|
||||
elseif ~whoiam,
|
||||
waitbar(b/B,h);
|
||||
end
|
||||
|
||||
if whoiam,
|
||||
if ~exist('OCTAVE_VERSION')
|
||||
fprintf('Done! \n');
|
||||
end
|
||||
waitbarString = [ 'Subdraw ' int2str(b) '/' int2str(B) ' done.'];
|
||||
fMessageStatus((b-fpar+1)/(B-fpar+1),whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab));
|
||||
end
|
||||
|
@ -305,15 +309,15 @@ end
|
|||
|
||||
myoutput.ifil=ifil;
|
||||
if RemoteFlag==1,
|
||||
myoutput.OutputFileName = [OutputFileName_smooth;
|
||||
OutputFileName_update;
|
||||
OutputFileName_inno;
|
||||
OutputFileName_error;
|
||||
OutputFileName_filter_step_ahead;
|
||||
OutputFileName_param;
|
||||
OutputFileName_forc_mean;
|
||||
OutputFileName_forc_point];
|
||||
% OutputFileName_moments];
|
||||
myoutput.OutputFileName = [OutputFileName_smooth;
|
||||
OutputFileName_update;
|
||||
OutputFileName_inno;
|
||||
OutputFileName_error;
|
||||
OutputFileName_filter_step_ahead;
|
||||
OutputFileName_param;
|
||||
OutputFileName_forc_mean;
|
||||
OutputFileName_forc_point];
|
||||
% OutputFileName_moments];
|
||||
end
|
||||
|
||||
if exist('OCTAVE_VERSION')
|
||||
|
|
|
@ -201,7 +201,9 @@ for b = fblck:nblck,
|
|||
if exist('OCTAVE_VERSION') || options_.console_mode
|
||||
if mod(j, 10) == 0
|
||||
if exist('OCTAVE_VERSION')
|
||||
if (whoiam==0)
|
||||
printf('MH: Computing Metropolis-Hastings (chain %d/%d): %3.f%% done, acception rate: %3.f%%\r', b, nblck, 100 * prtfrc, 100 * isux / j);
|
||||
end
|
||||
else
|
||||
s0=repmat('\b',1,length(newString));
|
||||
newString=sprintf('MH: Computing Metropolis-Hastings (chain %d/%d): %3.f%% done, acceptance rate: %3.f%%', b, nblck, 100 * prtfrc, 100 * isux / j);
|
||||
|
|
Loading…
Reference in New Issue