Assure that log-file is closed when aborting metropolis_hastings_initialization.m

time-shift
Johannes Pfeifer 2016-04-01 12:56:55 +02:00
parent 352a4fd3ae
commit 7e56302a04
1 changed files with 2 additions and 0 deletions

View File

@ -157,6 +157,7 @@ if ~options_.load_mh_file && ~options_.mh_recover
end
if trial > 10 && ~validate
disp(['Estimation::mcmc: I''m unable to find a starting value for block ' int2str(j)])
fclose(fidlog);
return
end
end
@ -179,6 +180,7 @@ if ~options_.load_mh_file && ~options_.mh_recover
else
disp('Estimation::mcmc: Initialization failed...')
disp('Estimation::mcmc: The posterior mode lies outside the prior bounds.')
fclose(fidlog);
return
end
fprintf(fidlog,' \n');