From 6b908a38ebd0dafd8eab6eb2c7f59e805661f9d7 Mon Sep 17 00:00:00 2001
From: Marco Ratto <marco.ratto@jrc.ec.europa.eu>
Date: Fri, 8 Jun 2012 15:27:41 +0200
Subject: [PATCH] when identification=1, the only morris options allowed remain
 morris 1 or 2.

---
 matlab/dynare_sensitivity.m | 23 +++++++++++++++++------
 matlab/gsa/map_ident_.m     |  2 ++
 matlab/gsa/stab_map_.m      |  6 +++---
 3 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/matlab/dynare_sensitivity.m b/matlab/dynare_sensitivity.m
index a832a87af..2b9542dd3 100644
--- a/matlab/dynare_sensitivity.m
+++ b/matlab/dynare_sensitivity.m
@@ -79,6 +79,11 @@ if options_gsa.identification,
     options_gsa = set_default_option(options_gsa,'ar',1);
     options_gsa = set_default_option(options_gsa,'useautocorr',0);
     options_.ar = options_gsa.ar;
+    if options_gsa.morris==0,
+        disp('The option morris = 0 is no longer supported (Type I errors)')
+        disp('This option is reset at morris = 2 (local identification analysis).')
+        options_gsa.morris=2;
+    end
     if options_gsa.morris==2,
         if isfield(options_,'options_ident'),
             options_.options_ident.load_ident_files = options_gsa.load_ident_files;
@@ -122,7 +127,13 @@ if options_gsa.redform,
     options_gsa.ppost=0;
 end
 
-if options_gsa.morris==1 || options_gsa.morris==3,
+if options_gsa.morris>2,
+    disp('The option morris = 3 is no longer supported')
+    disp('the option is reset at morris = 1 .')
+    options_gsa.morris=1;
+end
+   
+if options_gsa.morris==1,
     if ~options_gsa.identification,
         options_gsa.redform=1;
     end
@@ -134,12 +145,12 @@ if options_gsa.morris==1 || options_gsa.morris==3,
     options_gsa.load_rmse=0;
     options_gsa.alpha2_stab=1;
     options_gsa.ksstat=1;
-    if options_gsa.morris==3,
-        options_gsa = set_default_option(options_gsa,'Nsam',256);
-        OutputDirectoryName = CheckPath('gsa/identif',M_.dname);
-    else
+%     if options_gsa.morris==3,
+%         options_gsa = set_default_option(options_gsa,'Nsam',256);
+%         OutputDirectoryName = CheckPath('gsa/identif',M_.dname);
+%     else
         OutputDirectoryName = CheckPath('gsa/screen',M_.dname);
-    end
+%     end
 else
     OutputDirectoryName = CheckPath('gsa',M_.dname);
 end
diff --git a/matlab/gsa/map_ident_.m b/matlab/gsa/map_ident_.m
index 9cc1db953..e3e6b25d7 100644
--- a/matlab/gsa/map_ident_.m
+++ b/matlab/gsa/map_ident_.m
@@ -768,6 +768,8 @@ if opt_gsa.morris==1,
   %     eval(['print -dpdf ' OutputDirectoryName '/' fname_ '_morris_redform']);
 
 elseif opt_gsa.morris==3,
+    return
+    
   np=estim_params_.np;
   na=(4*np+1)*opt_gsa.Nsam;
   for j=1:j0,
diff --git a/matlab/gsa/stab_map_.m b/matlab/gsa/stab_map_.m
index 70afc9bc1..d042127c5 100644
--- a/matlab/gsa/stab_map_.m
+++ b/matlab/gsa/stab_map_.m
@@ -122,9 +122,9 @@ if fload==0,
         Nsam=size(lpmat,1);
         lpmat0 = lpmat(:,1:nshock);
         lpmat = lpmat(:,nshock+1:end);
-    elseif opt_gsa.morris==3,
-        lpmat = prep_ide(Nsam,np,5);
-        Nsam=size(lpmat,1);
+%     elseif opt_gsa.morris==3,
+%         lpmat = prep_ide(Nsam,np,5);
+%         Nsam=size(lpmat,1);
     else
         if np<52 & ilptau>0,
             [lpmat] = qmc_sequence(np, int64(0), 0, Nsam)';
-- 
GitLab