Den 2023-06-30 skrev Martin Schöön <martin.sch...@gmail.com>: > Yesterday I wanted to move from optimize.leastsq to > least_squares. I have data depending on four variables > and want to fit a function in four variables to this > data. This works with leastsq but not with least_squares. > > Am I trying to do something least_squares is not capable > of? > > Disclaimer: I was burning midnight oil... > Problem solved.
Yes, least_squares can, of course, handle multi-dimensional situations. Me burning midnight oil was the problem. I have been tinkering a bit with scipy.optimize.least_squares tonight. All simple examples I tried worked regardless of number of dimensions. I went back to my old code and found a couple of basic mistakes. Done. /Martin -- https://mail.python.org/mailman/listinfo/python-list