corrected bug in moments_varendo

git-svn-id: https://www.dynare.org/svn/dynare/trunk@2420 ac1d8469-bf42-47a9-8791-bf33cf982152
time-shift
michel 2009-02-16 22:19:23 +00:00
parent 81af16d314
commit dc0f0934ce
2 changed files with 6 additions and 3 deletions

View File

@ -31,14 +31,17 @@ function [info,description] = check_posterior_analysis_data(type,M_)
mhdate = get_date_of_a_file(mhname);
%% Get informations about _posterior_draws files.
if ~exist([ M_.dname '/metropolis/' M_.fname '_posterior_draws.mat'])
drawsinfo = dir([ M_.dname '/metropolis/' M_.fname '_posterior_draws*.mat']);
if isempty(drawsinfo)
info = 1; % select_posterior_draws has to be called first.
if nargout>1
description = 'select_posterior_draws has to be called.';
end
return
else
pddate = get_date_of_a_file([ M_.dname '/metropolis/' M_.fname '_posterior_draws.mat']);
number_of_last_posterior_draws_file = length(drawsinfo);
pddate = get_date_of_a_file([ M_.dname '/metropolis/' M_.fname '_posterior_draws'...
int2str(number_of_last_posterior_draws_file) '.mat']);
if pddate<mhdate
info = 2; % _posterior_draws files have to be updated.
if nargout>1

View File

@ -118,7 +118,7 @@ function SampleAddress = selec_posterior_draws(SampleSize,drsize)
old_mhblck = mhblck;
end
clear('x2')
save([fname '_posterior_draws'],'pdraws')
save([fname '_posterior_draws1'],'pdraws')
else% The posterior draws are saved in xx files.
NumberOfDrawsPerFile = fix(MAX_mega_bytes/drawsize);
NumberOfFiles = ceil(SampleSize*drawsize/MAX_mega_bytes);