From eaf40a7337653b86cabc03372e60c186074a54f5 Mon Sep 17 00:00:00 2001
From: farid <farid.mohammadi@iws.uni-stuttgart.de>
Date: Sun, 23 Jan 2022 16:04:53 +0100
Subject: [PATCH] [BayesInference] update discrepancy method to accept
 numerical error.

---
 BayesValidRox/BayesInference/BayesInference.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/BayesValidRox/BayesInference/BayesInference.py b/BayesValidRox/BayesInference/BayesInference.py
index 78a5d9ffa..d4a7bd39c 100644
--- a/BayesValidRox/BayesInference/BayesInference.py
+++ b/BayesValidRox/BayesInference/BayesInference.py
@@ -267,8 +267,8 @@ class BayesInference:
                         except:
                             sigma2 = 0.0
 
-                        # covMatrix = np.diag(sigma2 * np.eye(nout))
-                        covMatrix = np.diag(sigma2 * totalSigma2s)
+                        covMatrix += sigma2 * np.eye(nout)
+                        # covMatrix = np.diag(sigma2 * totalSigma2s)
 
                 # Add the std of the PCE is chosen as emulator.
                 if self.emulator:
@@ -653,8 +653,8 @@ class BayesInference:
                             sigma2 = 0.0
 
                         # Convert biasSigma2s to a covMatrix
-                        # cov = np.diag(sigma2 * np.ones(len(pred)))
-                        cov = np.diag(sigma2 * totalSigma2)
+                        cov += sigma2 * np.eye(len(pred))
+                        # cov = np.diag(sigma2 * totalSigma2)
 
                 if self.emulator:
                     stdPCE = PCEModel.RMSE[var] if PCEModel.RMSE is not None else PosteriorPred_std[var][i]
@@ -1027,7 +1027,7 @@ class BayesInference:
                                      quantiles=[0.15, 0.5, 0.85],show_titles=True,
                                      title_fmt=self.Corner_title_fmt,
                                      labelpad=0.2,
-                                     use_math_text = True,
+                                     use_math_text=True,
                                      title_kwargs={"fontsize": 28},
                                      plot_datapoints=False,
                                      plot_density=False,
-- 
GitLab