Parameter estimation simple theory question related to scipy.optimize.curve_fit

It has been a while since I have done some stats, and I have tried to fit a curve using optimize.curve_fit of parameter estimation. I am also interested in the standard deviation of the fitted parameters which I get from the square of the diagonal terms of the covariance matrix. In order to get the estandar deviation I need that the number of data being greater than the number of parameter to fit.

My question is following: Why should be the number of data greater (>) than the number of parameters to fit, and not greater or equal (>=)?

Probably is something quite simple, sorry. I suspect that it might have something to do with the degrees of freedom minus one, but not really sure why.

Thanks

Best regards Dani

• It doesn't have to be. Where did you read that it does? Apr 7, 2022 at 18:09
• I think it is in the code, If I remember well, between line 813 and 834 of minpack.py Apr 20, 2022 at 10:26
• I think some random comment in a software package does not count as a normative statement :-) Apr 20, 2022 at 19:37
• Totally true. I will rephrase the title. Apr 21, 2022 at 8:16

Assuming that everything, individual parameters and function values in $$y_k=f(x,p), ~~~p=(p_1,...,p_d),$$ is scalar, each data point gives one equation $$y_k=f(x_k,p), ~~~k=1,...,N.$$ If you have as much equations as parameters, $$N=d$$, then in the optimal case you get a locally unique solution for $$p$$. That means that all equations are satisfied exactly (within floating point accuracy). There is no non-trivial residual error for which one can compute an error model.