Skip to content

Pyomo.DoE: Correct A optimality#3803

Merged
blnicho merged 53 commits intoPyomo:mainfrom
smondal13:change-a-optimality
Feb 10, 2026
Merged

Pyomo.DoE: Correct A optimality#3803
blnicho merged 53 commits intoPyomo:mainfrom
smondal13:change-a-optimality

Conversation

@smondal13
Copy link
Copy Markdown
Contributor

@smondal13 smondal13 commented Dec 16, 2025

Fixes

Summary/Motivation:

In the old definition of A-optimality (we will call it pseudo A-optimality from now on), DoE computed the trace of the Fisher Information Matrix (FIM), as few studies used that definition. However, that is not correct, and new literature mentions the trace of the inverse of the FIM as A-optimality. This PR has adopted this new definition of A-optimality in DoE.

Changes proposed in this PR:

  • Change the old A-optimality to pseudo A-optimality
  • Implement a new definition of A-optimality (=trace(inverse of FIM))
  • Add new tests for the DoE plotting functionality

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@smondal13
Copy link
Copy Markdown
Contributor Author

@adowling2 @blnicho This PR is ready for initial review.

smondal13 and others added 2 commits December 18, 2025 15:12
Replace `model` with `m` in `cholesky_LLinv_imp()`

Co-authored-by: Bethany Nicholson <[email protected]>
Copy link
Copy Markdown
Member

@blnicho blnicho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smondal13 thanks for addressing my initial review comments. I think these changes look reasonable so far but would like to see tests for the corrected A-optimality before I'll approve the PR.

@blnicho blnicho self-requested a review December 18, 2025 21:24
Copy link
Copy Markdown
Member

@adowling2 adowling2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some concerns about how this testing framework can scale to all of the variants of Pyomo.DoE that we want to try, including:

  • central finite difference versus symbolic differentiation
  • GreyBox: A, D, E, ME optimality
  • Cholesky: A, D

We do not need to add all of these variants in this PR. But I think we need to ensure this PR sets us up to easily add these extensions in other PRs. This is important because I could see multiple parallel PRs to add these features that will all be building on this testing foundation.


Parameters
----------
optimize_experiment_A : bool, optional
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not seem very general... instead, do we want to support A, D, E, ME, pseudo A, ... objectives?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean that we pass an argument, e.g., objective="trace" / "pesudo_trace"... etc in run_rooney_biegler_doe()` ? I think that is a very good idea.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, unless there are significant benefits to doing it as a single function (sequentially). If that is the case, you could make objectives the input and support either a single string or a list of strings.

Copy link
Copy Markdown
Contributor Author

@smondal13 smondal13 Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the objective and the gradient/sensitivity computation option. Maybe symbolic can be added there when symbolic is merged. And solving the example for only one type of objective is fine.

def run_rooney_biegler_doe(
    sensitivity_formula="central",
    optimization_objective="determinant",
    improve_cholesky_roundoff_error=False,
    compute_FIM_full_factorial=False,
    draw_factorial_figure=False,
    design_range={'hour': [0, 10, 40]},
    tee=False,
    print_output=False,
):

fd_method = "central"
obj_used = "trace"

experiment = run_rooney_biegler_doe()["experiment"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do a lightweight version of FullReactorExperiment, perhaps with pseudo A opt

Copy link
Copy Markdown
Member

@adowling2 adowling2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ready to merge. Where are the changes to the documentation that explain A-optimality versus pseudo-A-optimality? Are they in this PR or a different PR?

fd_method = "central"
obj_used = "trace"

experiment = run_rooney_biegler_doe()["experiment"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

@adowling2
Copy link
Copy Markdown
Member

@adowling2
Copy link
Copy Markdown
Member

@smondal13, I think we should update the workflow figure to match our tutorial material: https://dowlinglab.github.io/pyomo-doe/Readme.html

@smondal13
Copy link
Copy Markdown
Contributor Author

@smondal13, I think we should update the workflow figure to match our tutorial material: https://dowlinglab.github.io/pyomo-doe/Readme.html

Added the workshop figure and proofread it. Had some minor corrections

Copy link
Copy Markdown
Member

@blnicho blnicho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smondal13 I think this is really close. I found a few more things in the example which should be straightforward to fix.

@github-project-automation github-project-automation bot moved this from Review In Progress to Reviewer Approved in Pyomo 6.10 Feb 9, 2026
@blnicho blnicho merged commit d40ffb2 into Pyomo:main Feb 10, 2026
34 of 35 checks passed
@github-project-automation github-project-automation bot moved this from Ready for final review to Done in ParmEst & Pyomo.DoE Development Feb 10, 2026
@github-project-automation github-project-automation bot moved this from Reviewer Approved to Done in Pyomo 6.10 Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants