From 91b1e09cfdb2dc10153863f3e87752cd980d0958 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20K=C3=A4mper?= <andreas.kaemper@ltt.rwth-aachen.de>
Date: Tue, 8 Mar 2022 17:20:56 +0100
Subject: [PATCH] Update automog.py - sqrt(mse) as component update criterion

---
 automog/code/modeling/automog.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/automog/code/modeling/automog.py b/automog/code/modeling/automog.py
index e3d8083..15596f1 100644
--- a/automog/code/modeling/automog.py
+++ b/automog/code/modeling/automog.py
@@ -320,7 +320,7 @@ class AutoMoG(object):
                 for state in comp.operating_points:
                     curves = self.curves[comp.name][state]
                     sect   = self.sections[comp.name][state]
-                    total_model_error += curves[sect]['mse']*comp.weighting_factors[comp.inputs[0]]
+                    total_model_error += np.sqrt(curves[sect]['mse'])*comp.weighting_factors[comp.inputs[0]]
             
             return total_model_error
             
@@ -399,7 +399,7 @@ class AutoMoG(object):
             
         elif self.options['mode'] == 'WEIGHTED ERROR':
             weight_error_model = sum(sum(comp.weighting_factors[comp.inputs[0]]*\
-                                         np.sqrt(self.curves[comp.name][state][self.sections[comp.name][state]]['model_error'])
+                                         np.sqrt(self.curves[comp.name][state][self.sections[comp.name][state]]['mse'])
                                          for state in comp.operating_points)
                                      for comp in self.components.values())
             
@@ -658,4 +658,4 @@ class MOG_Component(object):
             if not attr == 'sections':
                 setattr(self, attr, kwargs[attr])
             else:
-                self.sections = kwargs[attr]
\ No newline at end of file
+                self.sections = kwargs[attr]
-- 
GitLab