4 ms·
That's not really a bug, it's just behavior explained by numerical analysis. A very small change in the initial guess can be the difference between success and
by fractionalhare 6y ago
That's not really a bug, it's just behavior explained by numerical analysis. A very small change in the initial guess can be the difference between success and a blowup for numerical algorithms; particularly rootfinding algorithms.
Sometimes this is implementation specific, and is numerical instability. Sometimes this is endemic to the algorithm regardless of implementation, like Runge's phenomenon. Often there is no fix, or the fix would be inordinately complicated or only generalize poorly, etc.
In this situation scipy should probably just pop a warning.
- mehrdadn 6y agoI know how numerical stuff works, but no, this is pretty inexcusable. See my other comment: https://news.ycombinator.com/item?id=25689916 https://news.ycombinator.com/item?id=25689916
- fractionalhare 6y agoYou say you know how numerical stuff works, but you're demanding a solution that doesn't really exist. Numerical rootfinding algorithms are prone to this. The same thing happens in e.g. Mathematica, they just have better warning messages and documentation.
- mehrdadn 6y ago> The same thing happens in e.g. Mathematica, they just have better warning messages They "just" produce "better" warning messages? You say that as if scipy is producing any warning messages? There's an absolutely colossal difference between failing with a poor error description and producing a completely wrong answer with 100% confidence. > but you're demanding a solution that doesn't really exist Doesn't exist?! Have you even tried the other algorithms on there before writing this? Broyden1, anderson, etc. handle this just fine. Even the default hybrid algorithm itself would handle this just fine if they even cared to run that very algorithm a couple more times to get convergence. Is there an algorithm that solves every equation in the world? No. Does it need to? No. Does it need to be able to handle the most basic cases? Yeah.