From bb9c9c566d3fa4a66643c37b72a587551cad9d24 Mon Sep 17 00:00:00 2001
From: Marco Ratto <marco.ratto@jrc.ec.europa.eu>
Date: Wed, 23 Jan 2013 11:53:07 +0100
Subject: [PATCH] Bug fix when there are no shocks estimated.

---
 matlab/gsa/map_ident_.m | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/matlab/gsa/map_ident_.m b/matlab/gsa/map_ident_.m
index 22c1da936c..e24769d7f5 100644
--- a/matlab/gsa/map_ident_.m
+++ b/matlab/gsa/map_ident_.m
@@ -124,7 +124,9 @@ if opt_gsa.load_ident_files==0,
 %     bayestopt_.restrict_aux, M_.exo_nbr);
   A = zeros(size(Aa,1),size(Aa,2)+size(Aa,1),length(istable));
   % Sig(estim_params_.var_exo(:,1))=lpmatx(1,:).^2;
-  set_shocks_param(lpmatx(1,:));
+  if ~isempty(lpmatx),
+      set_shocks_param(lpmatx(1,:));
+  end
   A(:,:,1)=[Aa, triu(Bb*M_.Sigma_e*Bb')];
   for j=2:length(istable),
     dr.ghx = T(:, [1:(nc1-M_.exo_nbr)],j);
@@ -133,7 +135,9 @@ if opt_gsa.load_ident_files==0,
 %       bayestopt_.restrict_var_list, ...
 %       bayestopt_.restrict_columns, ...
 %       bayestopt_.restrict_aux, M_.exo_nbr);
-    set_shocks_param(lpmatx(j,:));
+    if ~isempty(lpmatx),
+        set_shocks_param(lpmatx(j,:));
+    end
     A(:,:,j)=[Aa, triu(Bb*M_.Sigma_e*Bb')];
   end
   clear T;
-- 
GitLab