In the previous constructions, we dealt with functions that depended linearly upon the parameters to be fitted. We found them by solving a linear system of equations, a relatively easy task.
However, as explained at the beginning
of this chapter, the same scheme works equally well for any function. In the
general case, though, the resulting system that we must solve to find the
best fit could depend non-linearly on the parameters, and the mere existence
of solutions to such systems is not a trivial problem to settle. Take for
instance, a function such as
y = sin(mix). Assuming measurements
(x1, y1),...,(xk, yk), we may take as our error the function
Sometimes, even if the function does not depend linearly on the coefficients, it can transformed to one which does. For example, if our data points {(xi, yi)} were believed to approximate an exponential function of the form y = aekx, then setting
Assuming the yi are all positive (which is reasonable since we
believe the data is exponential), we can let
zi = lnyi. Then we
are trying to fit a function
z = lnaekx
, which
reduces to the line
z = ln a + kx. This is familiar territory, and we
can just proceed as before.