Skip to content

More stats fixes#115

Merged
ChrisRackauckas merged 3 commits into
masterfrom
stats
Jun 28, 2026
Merged

More stats fixes#115
ChrisRackauckas merged 3 commits into
masterfrom
stats

Conversation

@JamesWrigley

Copy link
Copy Markdown
Member

More things found by an audit with Codex:

  • 4ff96a4: when withconst=true is passed to an exp sum fit the k parameter is fixed, which was not handled correctly by vcov. dof() also incorrectly returned 3 instead of 2.
  • 91b4dcc: when calling reinit!(cache) for nonlinear fits, cache.prob wasn't updated even though it was passed to the solution, which meant that anything using sol.prob (i.e. all the stats functions) would give the results for the original problem.
  • 164de33: sol(x::AbstractArray) wasn't implemented for some algorithm types so this commit adds support for them. Also changes the implementation for exp sum fits such that sol(x) for scalar inputs returns a scalar. This is technically a breaking change but I would consider it a bug fix since returning an array seems a bit weird for a scalar input.

Written with help from Codex 🤖

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Otherwise the wrong problem with the wrong x/y/sigma/lb/ub/u0 will be used by
the stats functions.
@JamesWrigley JamesWrigley self-assigned this Jun 28, 2026
@ChrisRackauckas

Copy link
Copy Markdown
Member

Seems we need to mark public differently for this?

@JamesWrigley

Copy link
Copy Markdown
Member Author

Yeah, though I don't understand why AutoSpecializeCallable is ok but not BoundedWrapper 🤔 Looking into it now.

- Added support for passing arrays to solutions of King, modified King, and
  rational polynomial fits.
- Make `ExpSumFitAlgorithm` solutions return scalars for scalar inputs.
@JamesWrigley

Copy link
Copy Markdown
Member Author

Ah it just needed to be excluded in qa.jl, fixed in 6a029bf.

@ChrisRackauckas ChrisRackauckas merged commit 04387ee into master Jun 28, 2026
19 checks passed
@ChrisRackauckas ChrisRackauckas deleted the stats branch June 28, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants