I am trying to use lmfit.minimize to minimize an objective function (which is a sum of squared error). I can use lmfit.minimize(function,params,args) to do it and it returns a Minimizer object with fit statistics. However, I want to see how the objective function value changes in each iteration.I could print values in each iteration or plot individual residual values using an iteration callback function but I want to get the values of objective function as an array that I can later use/plot.How can it be done ?
I am trying to get something like this:enter image description here