From 1b60dc0ae1970f536050ca28a1009e006647cce7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Scylla=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Thu, 30 Jan 2014 14:39:06 +0100
Subject: [PATCH] Issue an error message if loglinear option is equal to 1 in
 non linear likelihood routine. (cherry picked from commit
 00cfec8fb6ce4a37c7bfb6e72cd5119a0d1b1b09)

---
 matlab/non_linear_dsge_likelihood.m | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/matlab/non_linear_dsge_likelihood.m b/matlab/non_linear_dsge_likelihood.m
index 474b8dbb1..a76d73075 100644
--- a/matlab/non_linear_dsge_likelihood.m
+++ b/matlab/non_linear_dsge_likelihood.m
@@ -133,6 +133,11 @@ ys              = [];
 trend_coeff     = [];
 exit_flag       = 1;
 
+% Issue an error if loglinear option is used.
+if DynareOptions.loglinear
+    error('non_linear_dsge_likelihood: It is not possible to use a non linear filter with the option loglinear!')
+end
+
 % Set the number of observed variables
 nvobs = DynareDataset.info.nvobs;
 
@@ -229,11 +234,7 @@ BayesInfo.mf = BayesInfo.mf1;
 if DynareOptions.noconstant
     constant = zeros(nvobs,1);
 else
-    if DynareOptions.loglinear
-        constant = log(SteadyState(BayesInfo.mfys));
-    else
-        constant = SteadyState(BayesInfo.mfys);
-    end
+    constant = SteadyState(BayesInfo.mfys);
 end
 
 % Define the deterministic linear trend of the measurement equation.
-- 
GitLab