Repository navigation
Conversation
… into multistart-in-parmest
theta_est_multistart moved only theta to each start value. Every start began from the states the Experiment class built for its own theta (e.g., a discretized ODE trajectory simulated at the nominal theta), so starts differed only in theta and Ipopt's initial point was inconsistent. The per-start model refresh that handled this was removed in 51ca54a. theta_est_multistart now initializes the states at every start by default (initialize_states=True): each experiment block is solved with theta fixed at the start values. If the direct solve fails, theta is moved from the Experiment's values to the start values in 4, then 16, steps, each solve starting from the previous one. If initialization still fails (e.g., the discretized model has no solution at that theta), the block keeps the Experiment's initialization, the status is recorded in the new initialization_termination column, and one warning summarizes the count. _Q_opt gains initialize_states, and _create_scenario_blocks records the theta each Experiment built its model with. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # pyomo/contrib/parmest/parmest.py
profile_likelihood rebuilt the model from the Experiments at every grid value, so each solve started from the states the Experiment built for its own theta. The "neighbor" warm start carried over only the theta values of the previous solution, not its states. - "neighbor" now copies all free variable values (states and thetas) of the previous solved grid value into the new model (_Q_opt warm_start_model, _copy_scenario_values). - profile_likelihood(initialize_states=True), the default, then solves each experiment with the thetas fixed at the starting values (the profiled theta at the grid value), as theta_est_multistart does. With "neighbor" this is a small step from the previous solution; with "none" it starts from the Experiment's initialization. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sscini
added a commit
to sscini/pyomo
that referenced
this pull request
Dec 1, 2026
sscini
added a commit
to sscini/pyomo
that referenced
this pull request
Dec 1, 2026
…profile-likelihood) Child of profile-likelihood (Pyomo#3875, cd88987). ParmEst Tutor bug register B-38: a 2-theta Arrhenius profile (the Tutor's case s13) logged 270 Pyomo W1002 "outside the bounds" warnings, 54 without initialize_states (attributed to 7ec5980 on 2026-11-23). Cause (located by recording where each warning is raised): when a non-profiled theta sits on a bound, IPOPT returns it up to its bound relaxation past the bound (bound_relax_factor, 1e-8 * max(1, |bound|) by default; e.g. activation_energy = 9999.99996 with lower bound 10000). That solution is the next grid value's warm start, and it was set on the bounded theta of every scenario block in _create_scenario_blocks, then again at every continuation step and at the end of _initialize_scenario_states (which multiplies the count, hence the initialize_states attribution). The grid values themselves were inside the bounds (restricting the grid to the bounds left all 270). _profile_sweep now projects theta_hat and each solution it uses as a warm start onto the theta bounds (read from the first experiment's parmest model), and _initialize_scenario_states projects the values it fixes and restores (its origin may also come from a copied solution). The projection moves a value by no more than the solver's bound relaxation, so the profile is unchanged: the test model's profile and the s13 profile give the same rows as the base commit; the s13 warning count goes from 270 to 0. Test: profile theta_a of y = theta_a x + theta_b where theta_b reaches its upper bound for theta_a <= 1: no "outside the bounds" warning (fails on cd88987, whose warm start is theta_b = 3.0000000224), every row succeeds, and each objective equals the closed-form profile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sscini
added a commit
to sscini/pyomo
that referenced
this pull request
Dec 1, 2026
…ag an invalid profile (child of profile-likelihood) Child of profile-likelihood (Pyomo#3875, cd88987). ParmEst Tutor bug register B-33 (not fixed by 7ec5980). Every profile solve starts from a converged point: theta_hat, or the solution at the neighboring grid value. IPOPT first moves each variable at least min(bound_push * max(1, |lb|), bound_frac * (ub - lb)) away from its bounds (Waechter & Biegler 2006, sec. 3.6), 0.01 with the defaults. A theta closer than that to a bound (k_ref = 1.5e-4 with a lower bound of 1e-6 in the Tutor's case s13) was moved up to 100x away, outside its basin, onto a region where the model outputs no longer depend on it. The solves still terminated "optimal", so every row of the E profile, including the row at theta_hat itself (lr_stat 7322 instead of 0), lay on a plateau and the interval was NaN/NaN. profile_likelihood now gives the profile solves bound_push = bound_frac = 1e-10 unless solver_options sets them (restored afterwards), so the warm start is kept up to 1e-10 * max(1, |bound|). It also checks the row at theta_hat: it re-solves the estimation problem from its own solution, so it must reproduce obj_hat (lr_stat = 0) up to the solver tolerance (1e-6 relative); otherwise it logs that the profile of that theta is not valid. On s13 the E interval becomes (45251, 125799), which contains the truth and equals the result of the 2026-11-23 manual workaround. Tests (y = A exp(-k t), k ~ 1.5e-6, t up to 1e5): with default options the profile of A stays in the basin (lr_stat at theta_hat = 0) and every row equals the profile objective minimized independently over k by scipy; on cd88987 every row is on the plateau (lr_stat 339962). With bound_push forced back to 0.01 by the user, the invalid profile is now reported (no message on cd88987). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
13 of 17 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes # .
Summary/Motivation:
This PR implements profile likelihood as a method for practical identifiability analysis of parmest models. This includes a new function within the experiment class in parmest.py, and a new visualization function in graphics.py
Changes proposed in this PR:
TODO before converting from draft:
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: