Skip to content

Commit

Permalink
Merge pull request #6 from kaklise/parmest-redesign
Browse files Browse the repository at this point in the history
changed yhat to y_hat
  • Loading branch information
smartin71 authored Apr 30, 2024
2 parents ff90e3e + a92b4f5 commit 2b542e9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyomo/contrib/parmest/parmest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 2b542e9

Please sign in to comment.