From d1550293bf2827554d1b9ed23907db56c0740a73 Mon Sep 17 00:00:00 2001 From: Marco Ratto Date: Mon, 6 Feb 2017 18:11:59 +0100 Subject: [PATCH] bug fix for the rare case where r2 does not change for some observable --- matlab/gsa/filt_mc_.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/matlab/gsa/filt_mc_.m b/matlab/gsa/filt_mc_.m index 90d90042e..06f717e0e 100644 --- a/matlab/gsa/filt_mc_.m +++ b/matlab/gsa/filt_mc_.m @@ -575,6 +575,8 @@ else disp('These variables are excluded from SA') disp('[Unless you treat these series as exogenous, there is something wrong in your estimation !]') end + vvarvecm0=vvarvecm; + ivar = find( std(rmse_MC)./mean(rmse_MC)>0.0001 ); vvarvecm=vvarvecm(ivar,:); rmse_MC=rmse_MC(:,ivar); @@ -646,7 +648,7 @@ else end %%%%% R2 table - + vvarvecm=vvarvecm0; skipline() title_string='R2 over the MC sample:'; data_mat=[min(r2_MC)' max(r2_MC)']; @@ -658,6 +660,7 @@ else end r2_MC=r2_MC(:,ivar); + vvarvecm=vvarvecm(ivar,:); skipline() disp(['Sample filtered the ',num2str(pfilt*100),'% best R2''s for each observed series ...' ])