diff --git a/matlab/prior_posterior_statistics.m b/matlab/prior_posterior_statistics.m index 6951d68636b81a0ac38615b1b713e2b329de2574..b51ea04cc8eace42a23d2659159b827efd3c9d97 100644 --- a/matlab/prior_posterior_statistics.m +++ b/matlab/prior_posterior_statistics.m @@ -222,12 +222,14 @@ else [nCPU, totCPU, nBlockPerCPU] = distributeJobs(options_.parallel, 1, B); ifil=zeros(7,totCPU); for j=1:totCPU-1, - nfiles = ceil(nBlockPerCPU(j)/MAX_nsmoo); - ifil(1,j+1) =ifil(1,j)+nfiles; - nfiles = ceil(nBlockPerCPU(j)/MAX_ninno); - ifil(2,j+1) =ifil(2,j)+nfiles; - nfiles = ceil(nBlockPerCPU(j)/MAX_nerro); - ifil(3,j+1) =ifil(3,j)+nfiles; + if run_smoother + nfiles = ceil(nBlockPerCPU(j)/MAX_nsmoo); + ifil(1,j+1) =ifil(1,j)+nfiles; + nfiles = ceil(nBlockPerCPU(j)/MAX_ninno); + ifil(2,j+1) =ifil(2,j)+nfiles; + nfiles = ceil(nBlockPerCPU(j)/MAX_nerro); + ifil(3,j+1) =ifil(3,j)+nfiles; + end if naK nfiles = ceil(nBlockPerCPU(j)/MAX_naK); ifil(4,j+1) =ifil(4,j)+nfiles; diff --git a/matlab/prior_posterior_statistics_core.m b/matlab/prior_posterior_statistics_core.m index 802424b00d6423fcda4a9d75ef5ec48c065bd89e..a0747b62acb92f1be9576067624d8aaf244cd659 100644 --- a/matlab/prior_posterior_statistics_core.m +++ b/matlab/prior_posterior_statistics_core.m @@ -163,7 +163,7 @@ for b=fpar:B end set_all_parameters(deep); [dr,info] = resol(oo_.steady_state,0); - + SteadyState = dr.ys; if run_smoother [alphahat,etahat,epsilonhat,alphatilde,SteadyState,trend_coeff,aK] = ... DsgeSmoother(deep,gend,Y,data_index,missing_value); @@ -225,7 +225,7 @@ for b=fpar:B irun = irun + ones(7,1); - if irun(1) > MAX_nsmoo || b == B + if run_smoother && (irun(1) > MAX_nsmoo || b == B) stock = stock_smooth(:,:,1:irun(1)-1); ifil(1) = ifil(1) + 1; save([DirectoryName '/' M_.fname '_smooth' int2str(ifil(1)) '.mat'],'stock'); @@ -239,7 +239,7 @@ for b=fpar:B irun(1) = 1; end - if irun(2) > MAX_ninno || b == B + if run_smoother && (irun(2) > MAX_ninno || b == B) stock = stock_innov(:,:,1:irun(2)-1); ifil(2) = ifil(2) + 1; save([DirectoryName '/' M_.fname '_inno' int2str(ifil(2)) '.mat'],'stock');