From 345a2807a6d70963a186914ece847bd413bb1b59 Mon Sep 17 00:00:00 2001
From: Michel Juillard <michel.juillard@mjui.fr>
Date: Wed, 2 Nov 2011 21:02:40 +0100
Subject: [PATCH] fix problem with order of approximation in estimation

---
 matlab/dynare_estimation_init.m | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m
index 43dcbc3285..8c067d2d71 100644
--- a/matlab/dynare_estimation_init.m
+++ b/matlab/dynare_estimation_init.m
@@ -61,13 +61,11 @@ for i = 1:size(M_.endo_names,1)
 end
 
 %% Set the order of approximation to one (if needed).
-if options_.order > 1
-    if ~exist('particle','dir')
-        disp('This version of Dynare cannot estimate non linearized models!')
-        disp('Set "order" equal to 1.')
-        disp(' ')
-        options_.order = 1;
-    end
+if options_.order > 1 && ~isfield(options_,'nonlinear_filter')
+    disp('This version of Dynare cannot estimate non linearized models!')
+    disp('Set "order" equal to 1.')
+    disp(' ')
+    options_.order = 1;
 end
 
 % Set options_.lik_init equal to 3 if diffuse filter is used or
-- 
GitLab