Fix residuals space of modified King fits and add reinit!() checks#116
Merged
Conversation
The residuals are computed in E² but that's not very intuitive and is not consistent with the rest of the API.
- These fit types don't properly support `reinit!()` so they always build a cache inside of `solve!()`, meaning that their caches `nonlinear_cache` fields are never used. - Delete the custom Jacobian method for King fits. This is unused now that we use the delta method for constructing the covariance matrix. - Fix the modified King fit tests to pass x/y in the right order, previously they were swapped.
Member
Author
This would previously introduce small errors by first scaling and then inverting the scaling. Also made the residuals return a vector instead of a matrix.
Member
Author
|
Two more fixes found by Fable:
|
CurveFit supports passing `y=nothing` when creating a NonlinearCurveFitProblem, which means that we treat the function as returning residuals directly. But __wrap_nonlinear_function() would silently drop sigma when y is nothing while leaving it in the original problem, which meant that the statistics methods would assume sigma was used during the fit and apply it incorrectly. Now we always use sigma if it's passed. Also fixed support for `sol(x)` for in-place functions, and made `nobs()` able to handle solutions where y is nothing.
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.
Some more things found by auditing with Claude:
res == y - ŷholds.reinit!()for nonlinear fits so that it will explicitly error out if the input lengths are wrong or unsupported by the cache.Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.