From c27c4fd93229ffeba1b0faf83df8d10c36f2083e Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Mon, 25 Jan 2021 15:55:10 +0100 Subject: [PATCH] moments_varendo: delete stale files from previous runs --- matlab/dynare_estimation_1.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m index 21d564daa..06ecd7135 100644 --- a/matlab/dynare_estimation_1.m +++ b/matlab/dynare_estimation_1.m @@ -536,6 +536,15 @@ if (any(bayestopt_.pshape >0 ) && options_.mh_replic) || ... if error_flag error('Estimation::mcmc: I cannot compute the posterior moments for the endogenous variables!') end + if options_.load_mh_file && options_.mh_replic==0 %user wants to recompute results + [MetropolisFolder, info] = CheckPath('metropolis',M_.dname); + if ~info + generic_post_data_file_name={'Posterior2ndOrderMoments','decomposition','PosteriorVarianceDecomposition','correlation','PosteriorCorrelations','conditional decomposition','PosteriorConditionalVarianceDecomposition'}; + for ii=1:length(generic_post_data_file_name) + delete_stale_file([MetropolisFolder filesep M_.fname '_' generic_post_data_file_name{1,ii} '*']); + end + end + end oo_ = compute_moments_varendo('posterior',options_,M_,oo_,var_list_); end if options_.smoother || ~isempty(options_.filter_step_ahead) || options_.forecast