From eac2eb585a69e5b13eeb0aa72a9b6f5c1ca06a2b Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx,de>
Date: Sun, 1 Jun 2014 15:05:19 +0200
Subject: [PATCH] Restore backward compatibility of mode_file option

Displays warning and then assumes the user provided a correct mode-file. Closes #658

(cherry picked from commit 2caa9eb9d4420ef0f8679892302c46ca55834115)
---
 matlab/dynare_estimation_init.m | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m
index 5359470ba..5cc890379 100644
--- a/matlab/dynare_estimation_init.m
+++ b/matlab/dynare_estimation_init.m
@@ -199,6 +199,10 @@ if ~isempty(estim_params_) && ~isempty(options_.mode_file) && ~options_.mh_poste
     else
         % The number of declared estimated parameters match the number of parameters in the mode file. 
         % Check that the parameters in the mode file and according to the current mod file are identical.
+        if ~isfield(mode_file,'parameter_names')
+            disp(['The posterior mode file ' options_.mode_file ' has been generated using an older version of Dynare. It cannot be verified if it matches the present model. Proceed at your own risk.'])
+            mode_file.parameter_names=deblank(bayestopt_.name); %set names
+        end
         if isequal(mode_file.parameter_names, bayestopt_.name)
             xparam1 = mode_file.xparam1;
             if isfield(mode_file,'hh')
-- 
GitLab