Skip to content

Fixed bugs in ParmEst cov_est function and Estimator class#3980

Open
slilonfe5 wants to merge 6 commits into
Pyomo:mainfrom
slilonfe5:parmest-covest-bug-fix
Open

Fixed bugs in ParmEst cov_est function and Estimator class#3980
slilonfe5 wants to merge 6 commits into
Pyomo:mainfrom
slilonfe5:parmest-covest-bug-fix

Conversation

@slilonfe5

@slilonfe5 slilonfe5 commented Jun 22, 2026

Copy link
Copy Markdown
Member

Fixes # .

This PR fixes bugs in the Estimator class, cov_est, and _cov_at_theta functions of ParmEst

Summary/Motivation:

  1. The number of data points should only be counted in the case where the measurement error is not supplied by the user
  2. The check that ensures that the number of data points is greater than the number of unknown parameters should be carried out in _cov_at_theta and not in cov_est, as this is only needed when measurement error is not supplied by the user

Changes proposed in this PR:

  • Ensure that the number of data points is only calculated for the SSE-with-unsupplied-measurement-error case
  • Ensure that the check that compares the number of data points and the number of unknown parameters lives in _cov_at_theta

AI-Use Disclosure

  • AI tools were NOT used during the preparation of this PR

or

  • AI tools contributed to the development of this PR

    • AI tools generated documentation (including the PR description/comments, code comments, and/or Sphinx documentation)
    • AI tools generated tests (baselines, examples, and/or code)
    • AI tools generated code (apart from tests)

    Review process (select ONE):

    • Rewritten: All AI-generated content was rewritten by me before being committed.
    • Reviewed/verified: I retained AI-generated content and verified it before committing. Verification included (as applicable):
      • Ran the code and fixed issues
      • Added and ran tests
      • Checked correctness/logic of code and tests
      • Checked for alignment with the contribution guide
      • Considered security implications
    • As-is: AI-generated content was commited directly to the repository

Notes for reviewers (optional):

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.

@slilonfe5 slilonfe5 marked this pull request as ready for review June 22, 2026 19:30
@slilonfe5

Copy link
Copy Markdown
Member Author

@blnicho @mrmundt @jsiirola @adowling2 This PR fixes two bugs to ensure that the number of data points and parameters are only evaluated for the SSE-with-no-supplied-measurement-error case. Two tests are failing on installation, while one is failing on solvers.

Kindly review. Very short PR. Thank you.

@blnicho blnicho self-requested a review June 23, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant