From 4c6aad3d2d8ae58bbaac5870e6f107645fac63c5 Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx,de>
Date: Wed, 23 Jul 2014 12:10:00 +0200
Subject: [PATCH] Fix bug in dynare_identification.m that led to missing output
 and crashes if the initial parameterization was invalid

If the initial parameters did not solve, the code for displaying results and saving was not reached. The also led to later crashes with saving as the -append option was used and no file existed. If no valid draw can be found, the function exits in any case, so no additional check is needed.
---
 matlab/dynare_identification.m | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/matlab/dynare_identification.m b/matlab/dynare_identification.m
index 69fde1307..9a883e9d2 100644
--- a/matlab/dynare_identification.m
+++ b/matlab/dynare_identification.m
@@ -328,7 +328,7 @@ if iload <=0,
         else
             parameters = 'Random_prior_params';
         end
-    else
+    end
     idehess_point.params=params;
 %     siH = idemodel_point.siH;
 %     siJ = idemoments_point.siJ;
@@ -342,7 +342,6 @@ if iload <=0,
     if ~options_.nograph,
         plot_identification(params,idemoments_point,idehess_point,idemodel_point,idelre_point,advanced,parameters,name,IdentifDirectoryName);
     end
-    end
 
     if SampleSize > 1,
         skipline()
-- 
GitLab