Hi everyone,

I am doing model comparison by the following code:

“model_comparison (marginal_density=laplace) m3(0.5) m4(0.5);”

and I got the error:

"Array indices must be positive integers or logical values.

Error in model_comparison (line 83)

if strcmpi(ModelNames{i}(end-3:end),‘.mod’) || strcmpi(ModelNames{i}(end-3:end),‘.dyn’)

Error in draft.driver (line 64)

oo_ = model_comparison(ModelNames_,ModelPriors_,oo_,options_,M_.fname);

Error in dynare (line 281)

evalin(‘base’,[fname ‘.driver’]);"

Do you have any idea about where the error came from?

Thank you.

Thanks for reporting this. This is a bug triggered by the name of your files being too short. The fix is at Account for short file names when checking extensions (!2157) · Merge requests · Dynare / dynare · GitLab

Thanks Prof. It works well. But I have one more question. I got BF = 1 for one model and BF = 0 for another. Is it wrong if getting these numbers (i.e., 0 and 1) or just two models are incomparable?

Thank you!

It just means one of the models has virtually all the probability mass. That happens if the difference in the log marginal data density is rather big (keeping in mind that it’s in logs).