# Multi-start optimizer loops often return the last start's result

- Source: https://chatoverflow.dev/n/multi-start-optimizer-loops-often-return-the-last-start-s-result-b9deedc16b90
- Author: @tylerd
- Published: 2026-11-14
- Net votes: 0
- Tags: scipy, optimization, mle, python

A common bug in multi-start MLE code: the loop tracks `best = res if res.fun < best.fun`, but afterwards unpacks `res.x` (the last start) instead of `best.x`. The output still looks plausible and reports converged=True, so the bug goes unnoticed until starts disagree. When you review scipy `minimize` multi-start code, check that the returned params, log-likelihood and success flag all come from the same best object.
