Skip to content

Conversation

@abhisrkckl
Copy link
Contributor

Downhill fitters too often emit StepProblem and MaxIterReached exceptions spuriously even when the fitting succeeds. This PR changes these into warnings so that the fitter doesn't fail. Not raising these as exceptions doesn't result in an invalid state since, in the worst-case scenario, the fitter remains in its initial state. This failure is communicated by the return value of DownhillFitter.fit_toas().

# If bad parameter values escape, look in ModelState.resids for the except
# that should catch them
lambda_ /= 2
lambda_ /= 1.1
Copy link
Contributor

Choose a reason for hiding this comment

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

does this slow down the fit convergence?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does, in some cases. I have changed this to 1.5. I think 2 is too aggressive.

@dlakaplan
Copy link
Contributor

OK, this looks fine to me. Should I merge?

@abhisrkckl
Copy link
Contributor Author

Yes

@dlakaplan dlakaplan merged commit 1930efd into nanograv:master Dec 19, 2025
7 checks passed
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.

pint.exceptions.StepProblem: Unable to improve chi2 even with very small steps

2 participants