From a92b4f58ed95a148aa2a9750018c81761f643794 Mon Sep 17 00:00:00 2001 From: kaklise Date: Tue, 30 Apr 2024 09:53:35 -0700 Subject: [PATCH] changed yhat to y_hat --- .../parmest/examples/reactor_design/datarec_example.py | 4 ++-- .../examples/reactor_design/multisensor_data_example.py | 6 +++--- .../examples/reactor_design/timeseries_data_example.py | 6 +++--- pyomo/contrib/parmest/parmest.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pyomo/contrib/parmest/examples/reactor_design/datarec_example.py b/pyomo/contrib/parmest/examples/reactor_design/datarec_example.py index 02aa13fceab..be08e727be9 100644 --- a/pyomo/contrib/parmest/examples/reactor_design/datarec_example.py +++ b/pyomo/contrib/parmest/examples/reactor_design/datarec_example.py @@ -132,8 +132,8 @@ def main(): # Define sum of squared error objective function for data rec def SSE_with_std(model): expr = sum( - ((y - yhat) / model.experiment_outputs_std[y]) ** 2 - for y, yhat in model.experiment_outputs.items() + ((y - y_hat) / model.experiment_outputs_std[y]) ** 2 + for y, y_hat in model.experiment_outputs.items() ) return expr diff --git a/pyomo/contrib/parmest/examples/reactor_design/multisensor_data_example.py b/pyomo/contrib/parmest/examples/reactor_design/multisensor_data_example.py index 48a7bca52ca..208981a784a 100644 --- a/pyomo/contrib/parmest/examples/reactor_design/multisensor_data_example.py +++ b/pyomo/contrib/parmest/examples/reactor_design/multisensor_data_example.py @@ -74,10 +74,10 @@ def main(): # Define sum of squared error def SSE_multisensor(model): expr = 0 - for y, yhat in model.experiment_outputs.items(): - num_outputs = len(yhat) + for y, y_hat in model.experiment_outputs.items(): + num_outputs = len(y_hat) for i in range(num_outputs): - expr += ((y - yhat[i]) ** 2) * (1 / num_outputs) + expr += ((y - y_hat[i]) ** 2) * (1 / num_outputs) return expr # View one model diff --git a/pyomo/contrib/parmest/examples/reactor_design/timeseries_data_example.py b/pyomo/contrib/parmest/examples/reactor_design/timeseries_data_example.py index 04a64850f40..4eb191afd6d 100644 --- a/pyomo/contrib/parmest/examples/reactor_design/timeseries_data_example.py +++ b/pyomo/contrib/parmest/examples/reactor_design/timeseries_data_example.py @@ -59,10 +59,10 @@ def main(): def SSE_timeseries(model): expr = 0 - for y, yhat in model.experiment_outputs.items(): - num_time_points = len(yhat) + for y, y_hat in model.experiment_outputs.items(): + num_time_points = len(y_hat) for i in range(num_time_points): - expr += ((y - yhat[i]) ** 2) * (1 / num_time_points) + expr += ((y - y_hat[i]) ** 2) * (1 / num_time_points) return expr diff --git a/pyomo/contrib/parmest/parmest.py b/pyomo/contrib/parmest/parmest.py index ac2c7fdb0aa..6bc69c78bcd 100644 --- a/pyomo/contrib/parmest/parmest.py +++ b/pyomo/contrib/parmest/parmest.py @@ -242,7 +242,7 @@ def SSE(model): """ Sum of squared error between `experiment_output` model and data values """ - expr = sum((y - yhat) ** 2 for y, yhat in model.experiment_outputs.items()) + expr = sum((y - y_hat) ** 2 for y, y_hat in model.experiment_outputs.items()) return expr