From d08fd37986c493cdbbb0e04e4c9ee71981f20d09 Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Mon, 13 Jun 2016 11:03:41 +0200
Subject: [PATCH] Do not set oo_.posterior.optimization-fields when
 mh_posterior_mode_estimation is used

---
 matlab/dynare_estimation_1.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m
index 0fec65d937..7977e7bfd0 100644
--- a/matlab/dynare_estimation_1.m
+++ b/matlab/dynare_estimation_1.m
@@ -353,10 +353,11 @@ if options_.mode_check.status == 1 && ~options_.mh_posterior_mode_estimation
     options_.analytic_derivation = ana_deriv_old;
 end
 
-oo_.posterior.optimization.mode = xparam1;
+oo_.posterior.optimization.mode = [];
 oo_.posterior.optimization.Variance = [];
 invhess=[];
 if ~options_.mh_posterior_mode_estimation
+    oo_.posterior.optimization.mode = xparam1;
     if options_.cova_compute
         invhess = inv(hh);
         stdh = sqrt(diag(invhess));
-- 
GitLab