This site is version 0.0.1. Most of the code on this site is drafted by an agent and needs review. I apologize for the AI-speak, we are working on rewriting it!
viv-lang.org

Notebooks · lib/minpack/fit

Residuals, Jacobians and forward differences driving lmder for vp.optimize

The pieces vipyr's vp.optimize drivers (python/vipyr/_optimize.py) call around lmder: lm_fit runs lmder on a function of lmder's form and returns what SciPy's least_squares(method="lm") reports, and lm_fd_jac is MINPACK's fdjac2 (ref/fdjac2.f), the forward-difference Jacobian that lmdif uses. With lm_fd_jac in the Jacobian branch of the function, lmder takes the same steps as lmdif, which is what scipy.optimize.leastsq and curve_fit call when no Jacobian is given.

The test blocks fit NIST's Misra1a (Statistical Reference Datasets, nonlinear regression, lower difficulty) from its two certified starting points, with a grad Jacobian and with forward differences, and compare with NIST's certified values.

Used with import minpack.fit.

Look inside this program

  • Atlas

    The program’s map: every function and which calls which.

  • There’s no recorded run of this program yet.

Shift+Enter in a cell runs it and moves to the next. Running a cell runs every cell above it too, as one program.

[1]lines 21–179