Fixes with screen output for parallel/octave + cosmethics
parent
8111b671ff
commit
bed32115d2
|
@ -73,23 +73,29 @@ if whoiam
|
||||||
fMessageStatus(0,whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab));
|
fMessageStatus(0,whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab));
|
||||||
end
|
end
|
||||||
for j=fpar:npar,
|
for j=fpar:npar,
|
||||||
fprintf(' Parameter %d... ',j);
|
if exist('OCTAVE_VERSION'),
|
||||||
|
if (whoiam==0),
|
||||||
|
printf(' Parameter %d... ',j);
|
||||||
|
end
|
||||||
|
else
|
||||||
|
fprintf(' Parameter %d... ',j);
|
||||||
|
end
|
||||||
for b = 1:nblck
|
for b = 1:nblck
|
||||||
startline = 0;
|
startline = 0;
|
||||||
for n = 1:NumberOfMcFilesPerBlock
|
for n = 1:NumberOfMcFilesPerBlock
|
||||||
%load([MhDirectoryName '/' mcfiles(n,1,b).name],'x2');
|
%load([MhDirectoryName '/' mcfiles(n,1,b).name],'x2');
|
||||||
load([MhDirectoryName '/' M_.fname '_mh',int2str(n),'_blck' int2str(b) ...
|
load([MhDirectoryName '/' M_.fname '_mh',int2str(n),'_blck' int2str(b) ...
|
||||||
'.mat'],'x2');
|
'.mat'],'x2');
|
||||||
nx2 = size(x2,1);
|
nx2 = size(x2,1);
|
||||||
tmp((b-1)*NumberOfDraws+startline+(1:nx2),1) = x2(:,j);
|
tmp((b-1)*NumberOfDraws+startline+(1:nx2),1) = x2(:,j);
|
||||||
% clear x2;
|
% clear x2;
|
||||||
startline = startline + nx2;
|
startline = startline + nx2;
|
||||||
end
|
end
|
||||||
% $$$ %load([MhDirectoryName '/' mcfiles(NumberOfMcFilesPerBlock,1,b).name],'x2');
|
% $$$ %load([MhDirectoryName '/' mcfiles(NumberOfMcFilesPerBlock,1,b).name],'x2');
|
||||||
% $$$ load([MhDirectoryName '/' M_.fname '_mh',int2str(NumberOfMcFilesPerBlock),'_blck' int2str(b) '.mat'],'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);
|
% $$$ tmp((b-1)*NumberOfDraws+startline+1:(b-1)*NumberOfDraws+MAX_nruns*(LastFileNumber-1)+LastLineNumber,1) = x2(:,j);
|
||||||
% $$$ clear x2;
|
% $$$ clear x2;
|
||||||
% $$$ startline = startline + LastLineNumber;
|
% $$$ startline = startline + LastLineNumber;
|
||||||
end
|
end
|
||||||
tmp(:,2) = kron(transpose(1:nblck),ones(NumberOfDraws,1));
|
tmp(:,2) = kron(transpose(1:nblck),ones(NumberOfDraws,1));
|
||||||
tmp(:,3) = kron(ones(nblck,1),time');
|
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);
|
UDIAG(ligne,6,j-fpar+1) = UDIAG(ligne,6,j-fpar+1) + sum(abs(pmet(:,1)-moyenne).^3)/(n-1);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
fprintf('Done! \n');
|
if exist('OCTAVE_VERSION'),
|
||||||
|
if (whoiam==0),
|
||||||
|
printf('Done! \n');
|
||||||
|
end
|
||||||
|
else
|
||||||
|
fprintf('Done! \n');
|
||||||
|
end
|
||||||
if whoiam,
|
if whoiam,
|
||||||
waitbarString = [ 'Parameter ' int2str(j) '/' int2str(npar) ' done.'];
|
waitbarString = [ 'Parameter ' int2str(j) '/' int2str(npar) ' done.'];
|
||||||
fMessageStatus((j-fpar+1)/(npar-fpar+1),whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab))
|
fMessageStatus((j-fpar+1)/(npar-fpar+1),whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab))
|
||||||
|
|
|
@ -121,9 +121,9 @@ fpar0=fpar;
|
||||||
fpar = fpar-1;
|
fpar = fpar-1;
|
||||||
|
|
||||||
if whoiam
|
if whoiam
|
||||||
ifil2=ifil2(whoiam);
|
ifil2=ifil2(whoiam);
|
||||||
NumberOfIRFfiles_dsge=NumberOfIRFfiles_dsge(whoiam);
|
NumberOfIRFfiles_dsge=NumberOfIRFfiles_dsge(whoiam);
|
||||||
NumberOfIRFfiles_dsgevar=NumberOfIRFfiles_dsgevar(whoiam);
|
NumberOfIRFfiles_dsgevar=NumberOfIRFfiles_dsgevar(whoiam);
|
||||||
end
|
end
|
||||||
|
|
||||||
% Parallel 'while' very good!!!
|
% Parallel 'while' very good!!!
|
||||||
|
@ -184,10 +184,10 @@ while fpar<npar
|
||||||
while explosive_var
|
while explosive_var
|
||||||
% draw from the marginal posterior of SIGMA
|
% draw from the marginal posterior of SIGMA
|
||||||
SIGMAu_draw = rand_inverse_wishart(nvobs, DSGE_PRIOR_WEIGHT-NumberOfParametersPerEquation, ...
|
SIGMAu_draw = rand_inverse_wishart(nvobs, DSGE_PRIOR_WEIGHT-NumberOfParametersPerEquation, ...
|
||||||
SIGMA_inv_upper_chol);
|
SIGMA_inv_upper_chol);
|
||||||
% draw from the conditional posterior of PHI
|
% draw from the conditional posterior of PHI
|
||||||
PHI_draw = rand_matrix_normal(NumberOfParametersPerEquation,nvobs, PHI, ...
|
PHI_draw = rand_matrix_normal(NumberOfParametersPerEquation,nvobs, PHI, ...
|
||||||
chol(SIGMAu_draw)', chol(iXX)');
|
chol(SIGMAu_draw)', chol(iXX)');
|
||||||
Companion_matrix(1:nvobs,:) = transpose(PHI_draw(1:NumberOfLagsTimesNvobs,:));
|
Companion_matrix(1:nvobs,:) = transpose(PHI_draw(1:NumberOfLagsTimesNvobs,:));
|
||||||
% Check for stationarity
|
% Check for stationarity
|
||||||
explosive_var = any(abs(eig(Companion_matrix))>1.000000001);
|
explosive_var = any(abs(eig(Companion_matrix))>1.000000001);
|
||||||
|
@ -222,7 +222,7 @@ while fpar<npar
|
||||||
else
|
else
|
||||||
stock_irf_bvardsge(:,:,:,IRUN) = reshape(tmp_dsgevar,options_.irf,nvobs,M_.exo_nbr);
|
stock_irf_bvardsge(:,:,:,IRUN) = reshape(tmp_dsgevar,options_.irf,nvobs,M_.exo_nbr);
|
||||||
instr = [MhDirectoryName '/' M_.fname '_irf_bvardsge' ...
|
instr = [MhDirectoryName '/' M_.fname '_irf_bvardsge' ...
|
||||||
int2str(NumberOfIRFfiles_dsgevar) '.mat stock_irf_bvardsge;'];,
|
int2str(NumberOfIRFfiles_dsgevar) '.mat stock_irf_bvardsge;'];,
|
||||||
eval(['save ' instr]);
|
eval(['save ' instr]);
|
||||||
if RemoteFlag==1,
|
if RemoteFlag==1,
|
||||||
OutputFileName_bvardsge = [OutputFileName_bvardsge; {[MhDirectoryName filesep], [M_.fname '_irf_bvardsge' int2str(NumberOfIRFfiles_dsgevar) '.mat']}];
|
OutputFileName_bvardsge = [OutputFileName_bvardsge; {[MhDirectoryName filesep], [M_.fname '_irf_bvardsge' int2str(NumberOfIRFfiles_dsgevar) '.mat']}];
|
||||||
|
@ -238,7 +238,7 @@ while fpar<npar
|
||||||
if MAX_nirfs_dsgevar & (fpar == npar | IRUN == npar)
|
if MAX_nirfs_dsgevar & (fpar == npar | IRUN == npar)
|
||||||
stock_irf_bvardsge = stock_irf_bvardsge(:,:,:,1:IRUN);
|
stock_irf_bvardsge = stock_irf_bvardsge(:,:,:,1:IRUN);
|
||||||
instr = [MhDirectoryName '/' M_.fname '_irf_bvardsge' ...
|
instr = [MhDirectoryName '/' M_.fname '_irf_bvardsge' ...
|
||||||
int2str(NumberOfIRFfiles_dsgevar) '.mat stock_irf_bvardsge;'];,
|
int2str(NumberOfIRFfiles_dsgevar) '.mat stock_irf_bvardsge;'];,
|
||||||
eval(['save ' instr]);
|
eval(['save ' instr]);
|
||||||
NumberOfIRFfiles_dsgevar = NumberOfIRFfiles_dsgevar+1;
|
NumberOfIRFfiles_dsgevar = NumberOfIRFfiles_dsgevar+1;
|
||||||
if RemoteFlag==1,
|
if RemoteFlag==1,
|
||||||
|
@ -266,16 +266,20 @@ while fpar<npar
|
||||||
ifil2 = ifil2 + 1;
|
ifil2 = ifil2 + 1;
|
||||||
irun2 = 0;
|
irun2 = 0;
|
||||||
end
|
end
|
||||||
if exist('OCTAVE_VERSION')
|
if exist('OCTAVE_VERSION'),
|
||||||
printf(['Posterior IRF %3.f%% done\r'],(fpar/npar*100));
|
if (whoiam==0),
|
||||||
elseif ~whoiam
|
printf(['Posterior IRF %3.f%% done\r'],(fpar/npar*100));
|
||||||
|
end
|
||||||
|
elseif ~whoiam,
|
||||||
waitbar(fpar/npar,h);
|
waitbar(fpar/npar,h);
|
||||||
end
|
end
|
||||||
if whoiam,
|
if whoiam,
|
||||||
fprintf('Done! \n');
|
if ~exist('OCTAVE_VERSION')
|
||||||
waitbarString = [ 'Subdraw ' int2str(fpar) '/' int2str(npar) ' done.'];
|
fprintf('Done! \n');
|
||||||
fMessageStatus((fpar-fpar0)/(npar-fpar0),whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab));
|
end
|
||||||
end
|
waitbarString = [ 'Subdraw ' int2str(fpar) '/' int2str(npar) ' done.'];
|
||||||
|
fMessageStatus((fpar-fpar0)/(npar-fpar0),whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab));
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if whoiam==0
|
if whoiam==0
|
||||||
|
|
|
@ -105,7 +105,7 @@ for b = fblck:nblck,
|
||||||
rand('state',record.Seeds(b).Unifor);
|
rand('state',record.Seeds(b).Unifor);
|
||||||
if (options_.load_mh_file~=0) & (fline(b)>1) & OpenOldFile(b)
|
if (options_.load_mh_file~=0) & (fline(b)>1) & OpenOldFile(b)
|
||||||
load(['./' MhDirectoryName '/' ModelName '_mh' int2str(NewFile(b)) ...
|
load(['./' MhDirectoryName '/' ModelName '_mh' int2str(NewFile(b)) ...
|
||||||
'_blck' int2str(b) '.mat'])
|
'_blck' int2str(b) '.mat'])
|
||||||
x2 = [x2;zeros(InitSizeArray(b)-fline(b)+1,npar)];
|
x2 = [x2;zeros(InitSizeArray(b)-fline(b)+1,npar)];
|
||||||
logpo2 = [logpo2;zeros(InitSizeArray(b)-fline(b)+1,1)];
|
logpo2 = [logpo2;zeros(InitSizeArray(b)-fline(b)+1,1)];
|
||||||
OpenOldFile(b) = 0;
|
OpenOldFile(b) = 0;
|
||||||
|
@ -164,7 +164,9 @@ for b = fblck:nblck,
|
||||||
if exist('OCTAVE_VERSION') || options_.console_mode
|
if exist('OCTAVE_VERSION') || options_.console_mode
|
||||||
if mod(j, 10) == 0
|
if mod(j, 10) == 0
|
||||||
if exist('OCTAVE_VERSION')
|
if exist('OCTAVE_VERSION')
|
||||||
printf('MH: Computing Metropolis-Hastings (chain %d/%d): %3.f%% done, acception rate: %3.f%%\r', b, nblck, 100 * prtfrc, 100 * isux / j);
|
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
|
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);
|
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
|
end
|
||||||
|
|
|
@ -115,15 +115,15 @@ else
|
||||||
end
|
end
|
||||||
|
|
||||||
if RemoteFlag==1,
|
if RemoteFlag==1,
|
||||||
OutputFileName_smooth = {};
|
OutputFileName_smooth = {};
|
||||||
OutputFileName_update = {};
|
OutputFileName_update = {};
|
||||||
OutputFileName_inno = {};
|
OutputFileName_inno = {};
|
||||||
OutputFileName_error = {};
|
OutputFileName_error = {};
|
||||||
OutputFileName_filter_step_ahead = {};
|
OutputFileName_filter_step_ahead = {};
|
||||||
OutputFileName_param = {};
|
OutputFileName_param = {};
|
||||||
OutputFileName_forc_mean = {};
|
OutputFileName_forc_mean = {};
|
||||||
OutputFileName_forc_point = {};
|
OutputFileName_forc_point = {};
|
||||||
% OutputFileName_moments = {};
|
% OutputFileName_moments = {};
|
||||||
end
|
end
|
||||||
|
|
||||||
for b=fpar:B
|
for b=fpar:B
|
||||||
|
@ -211,8 +211,8 @@ for b=fpar:B
|
||||||
stock = stock_update(:,:,1:irun(1)-1);
|
stock = stock_update(:,:,1:irun(1)-1);
|
||||||
save([DirectoryName '/' M_.fname '_update' int2str(ifil(1)) '.mat'],'stock');
|
save([DirectoryName '/' M_.fname '_update' int2str(ifil(1)) '.mat'],'stock');
|
||||||
if RemoteFlag==1,
|
if RemoteFlag==1,
|
||||||
OutputFileName_smooth = [OutputFileName_smooth; {[DirectoryName filesep], [M_.fname '_smooth' int2str(ifil(1)) '.mat']}];
|
OutputFileName_smooth = [OutputFileName_smooth; {[DirectoryName filesep], [M_.fname '_smooth' int2str(ifil(1)) '.mat']}];
|
||||||
OutputFileName_update = [OutputFileName_update; {[DirectoryName filesep], [M_.fname '_update' int2str(ifil(1)) '.mat']}];
|
OutputFileName_update = [OutputFileName_update; {[DirectoryName filesep], [M_.fname '_update' int2str(ifil(1)) '.mat']}];
|
||||||
end
|
end
|
||||||
irun(1) = 1;
|
irun(1) = 1;
|
||||||
end
|
end
|
||||||
|
@ -222,7 +222,7 @@ for b=fpar:B
|
||||||
ifil(2) = ifil(2) + 1;
|
ifil(2) = ifil(2) + 1;
|
||||||
save([DirectoryName '/' M_.fname '_inno' int2str(ifil(2)) '.mat'],'stock');
|
save([DirectoryName '/' M_.fname '_inno' int2str(ifil(2)) '.mat'],'stock');
|
||||||
if RemoteFlag==1,
|
if RemoteFlag==1,
|
||||||
OutputFileName_inno = [OutputFileName_inno; {[DirectoryName filesep], [M_.fname '_inno' int2str(ifil(2)) '.mat']}];
|
OutputFileName_inno = [OutputFileName_inno; {[DirectoryName filesep], [M_.fname '_inno' int2str(ifil(2)) '.mat']}];
|
||||||
end
|
end
|
||||||
irun(2) = 1;
|
irun(2) = 1;
|
||||||
end
|
end
|
||||||
|
@ -232,7 +232,7 @@ for b=fpar:B
|
||||||
ifil(3) = ifil(3) + 1;
|
ifil(3) = ifil(3) + 1;
|
||||||
save([DirectoryName '/' M_.fname '_error' int2str(ifil(3)) '.mat'],'stock');
|
save([DirectoryName '/' M_.fname '_error' int2str(ifil(3)) '.mat'],'stock');
|
||||||
if RemoteFlag==1,
|
if RemoteFlag==1,
|
||||||
OutputFileName_error = [OutputFileName_error; {[DirectoryName filesep], [M_.fname '_error' int2str(ifil(3)) '.mat']}];
|
OutputFileName_error = [OutputFileName_error; {[DirectoryName filesep], [M_.fname '_error' int2str(ifil(3)) '.mat']}];
|
||||||
end
|
end
|
||||||
irun(3) = 1;
|
irun(3) = 1;
|
||||||
end
|
end
|
||||||
|
@ -242,7 +242,7 @@ for b=fpar:B
|
||||||
ifil(4) = ifil(4) + 1;
|
ifil(4) = ifil(4) + 1;
|
||||||
save([DirectoryName '/' M_.fname '_filter_step_ahead' int2str(ifil(4)) '.mat'],'stock');
|
save([DirectoryName '/' M_.fname '_filter_step_ahead' int2str(ifil(4)) '.mat'],'stock');
|
||||||
if RemoteFlag==1,
|
if RemoteFlag==1,
|
||||||
OutputFileName_filter_step_ahead = [OutputFileName_filter_step_ahead; {[DirectoryName filesep], [M_.fname '_filter_step_ahead' int2str(ifil(4)) '.mat']}];
|
OutputFileName_filter_step_ahead = [OutputFileName_filter_step_ahead; {[DirectoryName filesep], [M_.fname '_filter_step_ahead' int2str(ifil(4)) '.mat']}];
|
||||||
end
|
end
|
||||||
irun(4) = 1;
|
irun(4) = 1;
|
||||||
end
|
end
|
||||||
|
@ -252,7 +252,7 @@ for b=fpar:B
|
||||||
ifil(5) = ifil(5) + 1;
|
ifil(5) = ifil(5) + 1;
|
||||||
save([DirectoryName '/' M_.fname '_param' int2str(ifil(5)) '.mat'],'stock','stock_logpo','stock_ys');
|
save([DirectoryName '/' M_.fname '_param' int2str(ifil(5)) '.mat'],'stock','stock_logpo','stock_ys');
|
||||||
if RemoteFlag==1,
|
if RemoteFlag==1,
|
||||||
OutputFileName_param = [OutputFileName_param; {[DirectoryName filesep], [M_.fname '_param' int2str(ifil(5)) '.mat']}];
|
OutputFileName_param = [OutputFileName_param; {[DirectoryName filesep], [M_.fname '_param' int2str(ifil(5)) '.mat']}];
|
||||||
end
|
end
|
||||||
irun(5) = 1;
|
irun(5) = 1;
|
||||||
end
|
end
|
||||||
|
@ -262,7 +262,7 @@ for b=fpar:B
|
||||||
ifil(6) = ifil(6) + 1;
|
ifil(6) = ifil(6) + 1;
|
||||||
save([DirectoryName '/' M_.fname '_forc_mean' int2str(ifil(6)) '.mat'],'stock');
|
save([DirectoryName '/' M_.fname '_forc_mean' int2str(ifil(6)) '.mat'],'stock');
|
||||||
if RemoteFlag==1,
|
if RemoteFlag==1,
|
||||||
OutputFileName_forc_mean = [OutputFileName_forc_mean; {[DirectoryName filesep], [M_.fname '_forc_mean' int2str(ifil(6)) '.mat']}];
|
OutputFileName_forc_mean = [OutputFileName_forc_mean; {[DirectoryName filesep], [M_.fname '_forc_mean' int2str(ifil(6)) '.mat']}];
|
||||||
end
|
end
|
||||||
irun(6) = 1;
|
irun(6) = 1;
|
||||||
end
|
end
|
||||||
|
@ -272,7 +272,7 @@ for b=fpar:B
|
||||||
ifil(7) = ifil(7) + 1;
|
ifil(7) = ifil(7) + 1;
|
||||||
save([DirectoryName '/' M_.fname '_forc_point' int2str(ifil(7)) '.mat'],'stock');
|
save([DirectoryName '/' M_.fname '_forc_point' int2str(ifil(7)) '.mat'],'stock');
|
||||||
if RemoteFlag==1,
|
if RemoteFlag==1,
|
||||||
OutputFileName_forc_point = [OutputFileName_forc_point; {[DirectoryName filesep], [M_.fname '_forc_point' int2str(ifil(7)) '.mat']}];
|
OutputFileName_forc_point = [OutputFileName_forc_point; {[DirectoryName filesep], [M_.fname '_forc_point' int2str(ifil(7)) '.mat']}];
|
||||||
end
|
end
|
||||||
irun(7) = 1;
|
irun(7) = 1;
|
||||||
end
|
end
|
||||||
|
@ -287,17 +287,21 @@ for b=fpar:B
|
||||||
% irun(8) = 1;
|
% irun(8) = 1;
|
||||||
% end
|
% end
|
||||||
|
|
||||||
% DirectoryName=TempPath;
|
% DirectoryName=TempPath;
|
||||||
|
|
||||||
|
|
||||||
if exist('OCTAVE_VERSION')
|
if exist('OCTAVE_VERSION'),
|
||||||
printf('Taking subdraws: %3.f%% done\r', b/B*100);
|
if (whoiam==0),
|
||||||
|
printf('Taking subdraws: %3.f%% done\r', b/B*100);
|
||||||
|
end
|
||||||
elseif ~whoiam,
|
elseif ~whoiam,
|
||||||
waitbar(b/B,h);
|
waitbar(b/B,h);
|
||||||
end
|
end
|
||||||
|
|
||||||
if whoiam,
|
if whoiam,
|
||||||
fprintf('Done! \n');
|
if ~exist('OCTAVE_VERSION')
|
||||||
|
fprintf('Done! \n');
|
||||||
|
end
|
||||||
waitbarString = [ 'Subdraw ' int2str(b) '/' int2str(B) ' done.'];
|
waitbarString = [ 'Subdraw ' int2str(b) '/' int2str(B) ' done.'];
|
||||||
fMessageStatus((b-fpar+1)/(B-fpar+1),whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab));
|
fMessageStatus((b-fpar+1)/(B-fpar+1),whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab));
|
||||||
end
|
end
|
||||||
|
@ -305,15 +309,15 @@ end
|
||||||
|
|
||||||
myoutput.ifil=ifil;
|
myoutput.ifil=ifil;
|
||||||
if RemoteFlag==1,
|
if RemoteFlag==1,
|
||||||
myoutput.OutputFileName = [OutputFileName_smooth;
|
myoutput.OutputFileName = [OutputFileName_smooth;
|
||||||
OutputFileName_update;
|
OutputFileName_update;
|
||||||
OutputFileName_inno;
|
OutputFileName_inno;
|
||||||
OutputFileName_error;
|
OutputFileName_error;
|
||||||
OutputFileName_filter_step_ahead;
|
OutputFileName_filter_step_ahead;
|
||||||
OutputFileName_param;
|
OutputFileName_param;
|
||||||
OutputFileName_forc_mean;
|
OutputFileName_forc_mean;
|
||||||
OutputFileName_forc_point];
|
OutputFileName_forc_point];
|
||||||
% OutputFileName_moments];
|
% OutputFileName_moments];
|
||||||
end
|
end
|
||||||
|
|
||||||
if exist('OCTAVE_VERSION')
|
if exist('OCTAVE_VERSION')
|
||||||
|
|
|
@ -94,10 +94,10 @@ varargin=myinputs.varargin;
|
||||||
|
|
||||||
% Necessary only for remote computing!
|
% Necessary only for remote computing!
|
||||||
if whoiam
|
if whoiam
|
||||||
Parallel=myinputs.Parallel;
|
Parallel=myinputs.Parallel;
|
||||||
% initialize persistent variables in priordens()
|
% initialize persistent variables in priordens()
|
||||||
priordens(xparam1,bayestopt_.pshape,bayestopt_.p6,bayestopt_.p7, ...
|
priordens(xparam1,bayestopt_.pshape,bayestopt_.p6,bayestopt_.p7, ...
|
||||||
bayestopt_.p3,bayestopt_.p4,1);
|
bayestopt_.p3,bayestopt_.p4,1);
|
||||||
end
|
end
|
||||||
|
|
||||||
% (re)Set the penalty
|
% (re)Set the penalty
|
||||||
|
@ -138,7 +138,7 @@ for b = fblck:nblck,
|
||||||
rand('state',record.Seeds(b).Unifor);
|
rand('state',record.Seeds(b).Unifor);
|
||||||
if (options_.load_mh_file~=0) & (fline(b)>1) & OpenOldFile(b)
|
if (options_.load_mh_file~=0) & (fline(b)>1) & OpenOldFile(b)
|
||||||
load(['./' MhDirectoryName '/' ModelName '_mh' int2str(NewFile(b)) ...
|
load(['./' MhDirectoryName '/' ModelName '_mh' int2str(NewFile(b)) ...
|
||||||
'_blck' int2str(b) '.mat'])
|
'_blck' int2str(b) '.mat'])
|
||||||
x2 = [x2;zeros(InitSizeArray(b)-fline(b)+1,npar)];
|
x2 = [x2;zeros(InitSizeArray(b)-fline(b)+1,npar)];
|
||||||
logpo2 = [logpo2;zeros(InitSizeArray(b)-fline(b)+1,1)];
|
logpo2 = [logpo2;zeros(InitSizeArray(b)-fline(b)+1,1)];
|
||||||
OpenOldFile(b) = 0;
|
OpenOldFile(b) = 0;
|
||||||
|
@ -201,7 +201,9 @@ for b = fblck:nblck,
|
||||||
if exist('OCTAVE_VERSION') || options_.console_mode
|
if exist('OCTAVE_VERSION') || options_.console_mode
|
||||||
if mod(j, 10) == 0
|
if mod(j, 10) == 0
|
||||||
if exist('OCTAVE_VERSION')
|
if exist('OCTAVE_VERSION')
|
||||||
printf('MH: Computing Metropolis-Hastings (chain %d/%d): %3.f%% done, acception rate: %3.f%%\r', b, nblck, 100 * prtfrc, 100 * isux / j);
|
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
|
else
|
||||||
s0=repmat('\b',1,length(newString));
|
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);
|
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