Least square minimisation to align points to a given function?

Hi all,

I have a set of points (xi, yi) i ={1, 2. 3}
I want to find the constant offset, y0 (xi, yi + y0), such that the points fit a given function f(xi).
Basically, I am trying to minimize the residual, yi(xi) + y0 - f(xi).

I understand that this is a standard minimization problem, but as a naive user, I think the we usually fit a set of points to a curve, but the current problem is the reverse of that.

Are there any predefined functions for such minimization problems in general? Any help in his regard will be highly beneficial.

Thanks a lot !


If I understand correctly, you are looking for a best fit somehow (please correct me if I am wrong!).
If I am right, an approach could be to change manually the value of the parameters of a function, via fitpanel or programmatically.

I hope this helps.