Error moments_varendo

I am trying to do some exercises in ls2003, but using this command moments_varendo, I have this error, can you tell me how to solve this problem,

Thanks very much for you help


??? Reference to non-existent field ‘datenum’.

Error in ==> get_date_of_a_file at 22
d1 = info.datenum;

Error in ==> check_posterior_analysis_data at 31
mhdate = get_date_of_a_file(mhname);

Error in ==> posterior_analysis at 20
info = check_posterior_analysis_data(type,M_);

Error in ==> compute_moments_varendo at 41
oo_ = posterior_analysis(‘variance’,var_list_(i,:),var_list_(j,:),],options_,M_,oo_);

Error in ==> dynare_estimation_1 at 963
oo_ = compute_moments_varendo(options_,M_,oo_,var_list_);

Error in ==> dynare_estimation at 57

Error in ==> ls2003 at 191

Error in ==> dynare at 102
evalin(‘base’,fname) ;


Dynare crashes while it tries to get the date of the last Metropolist-Hastings file. I see two possible explanations for that:

] either your Matlab doesn’t return a date, for a very strange reason
:m]] or the file simply doesn’t exist (and in get_date_of_a_file.m we don’t test if it exists)/:m][/ul]

I think it is option 2. To test it you can add the following test in get_date_of_a_file.m, so that it looks like:


if size(info, 1) == 0
  error( filename ': non-existent file' ]);

d1 = info.datenum;

And tell us back what it gives. By the way, which platform (Windows 32/64, Linux 32/64) are you using? Which version of Matlab and of Dynare?



I using Matlab 7.5.0(2007b), the dynare snapshot version of 22/02/09, in Windows 32. How can I solve the problem?


It looks like a bug in Dynare. To help us find where it comes from, please try the modification I’ve suggested above.

You may also try the latest stable version of Dynare (4.0.2) to see if it also contains the problem.