Skip to content

How was max_nfev = 2000 * (nvarys + 1) chosen? #963

Answered by newville
jagerber48 asked this question in Q&A
Discussion options

You must be logged in to vote

@jagerber48 yeah. The "200*(n_variables+1)" in leastsq is probably taken directly from lmdif1.f (https://netlib.org/minpack/lmdif1.f) the "simplified wrapper with some sane defaults" around the real lmdif.f from the MINPACK library. Which was written in 1980. I don't know what that means to you (I'm listening to Remain in Light), but that code was no doubt being tested on high-end PDP-11s with clock speeds well over 1 MHz and as much as 4 MB "core memory", that were meant to be time-shared with multiple users.

When max_nfev is reached, the fit stops and reports failure. So, "200*(n_variables+1)" is probably a reasonable estimate of "if it takes that many evaluations, something could be wr…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@jagerber48
Comment options

@newville
Comment options

Answer selected by jagerber48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants