last day (18 days later) » 

7:37 PM
Hey, thought this would be a better route than constantly commenting, plus I can't show any of my code edits on there without making a new post. I have looked at your edits, and am quite confused. Your minimized error (fun) is significantly lower than what I get (yours is close to zero, mine is close to 1). Furthermore, while you state the solution is stable, this is simply untrue via the fact you can change the initial guesses and find drastically different solutions
```from scipy.optimize import minimize
from scipy.sparse.linalg import lsmr
import numpy as np

experimental_data_list = np.array((
[117.770, 117.705, 117.843, 117.597],
[110.575, 110.258, 110.167, 110.216],
[125.691, 125.006, 125.327, 124.481],
[107.491, 108.461, 107.804, 109.383],
[128.689, 128.383, 128.668, 128.290],
[125.969, 126.326, 126.280, 126.257],
[122.439, 122.684, 122.859, 122.194],
[125.989, 125.998, 125.985, 125.897],
[120.916, 120.180, 120.345, 120.567],
[126.772, 126.669, 127.006, 127.592],
so for simplicity, this is the edited code where I simplified the equations a bit so it's easier to read. I can confirm this gives identical results to the previous unmodified code, and implements the least squared method
 
7:56 PM
ok so I seem to have found the error discrepency. Your code does the exact same as mine does, the only difference is this line here in yours

```
errror.dot(error)
```
 
8:06 PM
although now I'm confused, error.dot(error) gives the sum of the squared residuals. My method is giving the norm of the residuals which should be the same thing.
 
8:36 PM
I also wanted to add, if I don't use the norm of the residuals (i.e. use the squared residuals sum instead such as in your script), different solvers give different answers. I know you said you used Basin Hopping, but using Nelder-Mead you get 2.395e+03 3.977e-03 1.646e+00 1.324e+00, albeit with a slightly worse solution (0.23976468652313554 fun versus your 0.2351713508068926)
so outside different guesses giving different minimized results, even using the same initial guesses but using different solvers give different results
 
8:51 PM
"although now I'm confused, error.dot(error) gives the sum of the squared residuals. My method is giving the norm of the residuals which should be the same thing."

please ignore this, I realized the problem. L2-norm is the sqrt of the squared residuals, so in my code I would need to use least_squared_fit_n**2, to minimize appropriately and get the correct solutions
 
9:05 PM
Probably
 

  last day (18 days later) »