Skip to content

Implementing multistart version of theta_est using multiple sampling methods#3575

Draft
sscini wants to merge 60 commits into
Pyomo:mainfrom
sscini:multistart-in-parmest
Draft

Implementing multistart version of theta_est using multiple sampling methods#3575
sscini wants to merge 60 commits into
Pyomo:mainfrom
sscini:multistart-in-parmest

Conversation

@sscini
Copy link
Copy Markdown
Contributor

@sscini sscini commented Apr 23, 2025

Fixes # .

Summary/Motivation:

Currently, the optimization is only done from a single initial value. This implementation adds the ability to specify multiple initial values using selected sampling techniques: from a random uniform distribution, using Latin Hypercube Sampling, or using Sobol Quasi-Monte Carlo sampling.

Changes proposed in this PR:

  • All changes made adding pseudocode in comments
  • Added inputs needed for multistart simulation
  • Added a function to generate points using the selected method
  • Added theta_est_multistart to work for the multistart process

TODO before converting from draft:

  • Receive feedback from collaborators on logical setup
  • Convert finalized pseudocode
  • Test and debug
  • Confirm function with examples

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.

@sscini
Copy link
Copy Markdown
Contributor Author

sscini commented Apr 23, 2025

@djlaky @adowling2 Please provide early feedback.

@sscini
Copy link
Copy Markdown
Contributor Author

sscini commented Apr 30, 2025

Dynamic saving using flush, add.

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.

Notes from our in-person discussion/informal code review

Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
@sscini
Copy link
Copy Markdown
Contributor Author

sscini commented Apr 30, 2025

Extend existing tests for parmest to include multistart, add.

@sscini
Copy link
Copy Markdown
Contributor Author

sscini commented Apr 30, 2025

Models provided need to include bounds, add exception

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.

Here are some more comments for you to consider are you continue to refine this.

Comment thread pyomo/contrib/parmest/parmest.py Outdated
upper_bound = np.array([parmest_model.find_component(name).ub for name in theta_names])
# Check if the lower and upper bounds are defined
if np.any(np.isnan(lower_bound)) or np.any(np.isnan(upper_bound)):
raise ValueError(
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.

You probably already know this, but you will need to check all the errors are raised when expected.

Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
Comment thread pyomo/contrib/parmest/parmest.py Outdated
@sscini sscini reopened this Feb 19, 2026
@sscini sscini moved this from Paused to Development in ParmEst & Pyomo.DoE Development Feb 19, 2026
@sscini
Copy link
Copy Markdown
Contributor Author

sscini commented Feb 24, 2026

Notes for 02/24/26 development meeting:
Will need to merge _Q_opt update (PR 3789) first
Variant of objective_at_theta that estimates parameters at each parameter value set.
Still need to:

  • Update implementation of sample generation using random sampling techniques
  • Define defaults for sampling technique, number of restarts, etc
  • Generate examples from literature with known solutions.
  • Testing
  • Documentation

@sscini sscini requested a review from adowling2 March 3, 2026 19:13
@blnicho blnicho changed the title [Depends on #3789] Implementing multistart version of theta_est using multiple sampling methods Implementing multistart version of theta_est using multiple sampling methods May 15, 2026
@sscini
Copy link
Copy Markdown
Contributor Author

sscini commented May 19, 2026

Now that _Q_opt has been finalized and merged, going to revisit this, make adjustments as needed from final _Q_opt and regularization revisions, and then will make a regular PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Development

Successfully merging this pull request may close these issues.

4 participants