diff --git a/doc/dynare.texi b/doc/dynare.texi index ad53f775ec93b924efbd283bade07ff1312f67f3..f8a4908f4fe68b6d20db61ce0cdba4109de7f2e3 100644 --- a/doc/dynare.texi +++ b/doc/dynare.texi @@ -5552,8 +5552,12 @@ estimates using a higher tapering are usually more reliable. @descriptionhead This command computes odds ratios and estimate a posterior density -over a collection of models. The priors over models can be specified -as the @var{DOUBLE} values, otherwise a uniform prior is assumed. +over a collection of models +(see e.g. @cite{Koop (2003), Ch. 1}). The priors over models can be specified +as the @var{DOUBLE} values, otherwise a uniform prior over all models is assumed. +In contrast to frequentist econometrics, the models to be compared do not need to be nested. +However, as the computation of posterior odds ratios is a Bayesian technique, +the comparison of models estimated with maximum likelihood is not supported. @examplehead @@ -11369,6 +11373,9 @@ Kim, Jinill, Sunghyun Kim, Ernst Schaumburg, and Christopher A. Sims discrete time dynamic equilibrium models,'' @i{Journal of Economic Dynamics and Control}, 32(11), 3397--3414 +@item +Koop, Gary (2003), @i{Bayesian Econometrics}, John Wiley & Sons + @item Koopman, S. J. and J. Durbin (2003): ``Filtering and Smoothing of State Vector for Diffuse State Space Models,'' @i{Journal of Time diff --git a/matlab/model_comparison.m b/matlab/model_comparison.m index 0ff60e45396c6fd760d9cb6c507256fc9961ba69..43cf0cc8ffb4ada59985b7beddfc876757925c5a 100644 --- a/matlab/model_comparison.m +++ b/matlab/model_comparison.m @@ -75,10 +75,18 @@ for i=1:NumberOfModels eval(['MarginalLogDensity(i) = mstruct.oo_.MarginalDensity.' type ';']) catch if strcmpi(type,'LaplaceApproximation') - disp(['MODEL_COMPARISON: I cant''t find the Laplace approximation associated to model ' ModelNames{i}]) + if isfield(mstruct.oo_,'mle_mode') + disp(['MODEL_COMPARISON: Model comparison is a Bayesian approach and does not support models estimated with ML']) + else + disp(['MODEL_COMPARISON: I cant''t find the Laplace approximation associated to model ' ModelNames{i}]) + end return elseif strcmpi(type,'ModifiedHarmonicMean') - disp(['MODEL_COMPARISON: I cant''t find the modified harmonic mean estimate associated to model ' ModelNames{i}]) + if isfield(mstruct.oo_,'mle_mode') + disp(['MODEL_COMPARISON: Model comparison is a Bayesian approach and does not support models estimated with ML']) + else + disp(['MODEL_COMPARISON: I cant''t find the modified harmonic mean estimate associated to model ' ModelNames{i}]) + end return end end @@ -124,7 +132,7 @@ name = modelname(idx(end)+1:end); function name = get_model_name_without_extension(modelname) idx = strfind(modelname,'.mod'); if isempty(idx) - idx = strfind(modelname,'.dyn') + idx = strfind(modelname,'.dyn'); end if isempty(idx) name = modelname;