Deal with stale files that are automatically loaded in computations of e.g. endogenous moments
In the computation of endogenous moments, e.g. in correlation_mc_analysis
we have statements like
ListOfFiles = dir([ PATH fname '_' TYPE 'Correlations*.mat']);
i1 = 1; tmp = zeros(SampleSize,1);
for file = 1:length(ListOfFiles)
Hence, all older files with endogenous moments are read out, regardless whether they stem from the current run or are older. This is very dangerous as those additional draws might be from different specifications. I would suggest to automatically delete those files upon running endogenous moments. Note that the same problem with the loading also occurs in identifcation and gsa and sometimes leads to crashes there as the specified number of draws does not coincide with the loaded ones.