From e32cbf626f9f0b9e322b2ac44d93461afcb320a0 Mon Sep 17 00:00:00 2001
From: Marco Ratto <marco.ratto@jrc.ec.europa.eu>
Date: Tue, 14 Apr 2015 12:05:32 +0200
Subject: [PATCH] Fixed bug when neighborhood_width is used : MC option must be
 forced.

---
 matlab/dynare_sensitivity.m | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/matlab/dynare_sensitivity.m b/matlab/dynare_sensitivity.m
index 9d4a5085d3..0a4aa0035c 100644
--- a/matlab/dynare_sensitivity.m
+++ b/matlab/dynare_sensitivity.m
@@ -163,6 +163,11 @@ options_gsa = set_default_option(options_gsa,'istart_rmse',options_.presample+1)
 options_gsa = set_default_option(options_gsa,'alpha_rmse',0.001);
 options_gsa = set_default_option(options_gsa,'alpha2_rmse',1.e-5);
 
+if options_gsa.neighborhood_width,
+    options_gsa.pprior=0;
+    options_gsa.ppost=0;
+end
+
 if options_gsa.redform && options_gsa.neighborhood_width==0 && isempty(options_gsa.threshold_redform),
     options_gsa.pprior=1;
     options_gsa.ppost=0;
-- 
GitLab