Does anyone have a simple example that compares models. I use matlab and see that the dynare folder contains PosteriorOddsTable function. I guess this is what I need, but I have no idea how to call it from dynare. Presumably, I have standard output saved from two modfiles, each of which does Bayesian “estimate” of a DGSE model. The difference between the two models is only in coefficients.
Here is an example around a model by Rabanal and Rubio (2003).
The keyword model_comparison must be followed by the name of two *.mod files. By default, the comparison is done on the basis of the Laplace approximation of log data density and therefor this can be used after just posterior mode finding.
The is an option model_comparison_approximation that can take the value of either laplace or modifiedharmonicmean (the latter requires metropolis iterations)
Many thanks for this. Do you know how to set this option?
For example, in the *.mod file, is it in the same line , or in a separate line? I could not find help on this and several variants with brackets did not work
model_comparison file1, file2;
Separate question: is there anything available that does posterior predictive check? And if so, then again how to call it?
??? model_comparison(model_comparison_approximation=laplace) rabanal1.mod, rabanal2.mod

Error: The expression to the left of the equals sign is not a valid target for an assignment.
Then I tried:
model_comparison rabanal1.mod, rabanal2.mod
And the system returns:
??? Input argument “ModelPriors” is undefined.
Error in ==> model_comparison at 24
if isempty(ModelPriors)
Finally I even modified CompareModels.m by assigning the value for “ModelPriors” , but it still doesn’t work.
Could someone offer the correct syntax for this simple problem?
In this case it does what it should do. However, the field in Options is now changed into ‘Laplace’. I guess you will nneed to have a line like
options_.model_comparison_approximation=’ '; or delete this field if you later want to use different approximation.