I am using curve_fit to fit a curve to some set of data points (x,y) in the 2D space. curve_fit has this p0 parameter as we know.
https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html
The second thing returned by curve_fit is pcov and when I take the diagonal of pcov and square root it, I get a vector v of values.
Then I sum all these values (from this vector v) and I get a number S: something which I interpret (correct or not, I am not sure?!) as an overall std.dev. (or say sum of std.deviations).
I am noticing that when I vary p0 I get different curves and they have different S values. But also, sometimes I think the curves look visually not much different but their S values differ a lot.
I don't fully understand this pcov matrix, hence my confusion. It is variance-covariance matrix of what?!
My question is this: this S value
1) is it a measure of how well my curve fits to the data?
or
2) is it more like a measure of how fast the optimization process (which happens inside curve_fit) converges (given the particular p0 value which I used)?
I hope it is 1) and thus I can use this number S as a quality measure for the curve fitting process.
Is that so or not?
Also, any explanations related to the above mentioned doubts would be much appreciated.