Linear fA

As usual ..\FitData.doc htm

(1.1)

The approximating function written as

(1.2)

The partial with respect to the coefficients is

           (1.3)

And the second partial, with no approximations, becomes

(1.4)    

Note that AK,L  does not depend on the value of fi or on the value of c.  It can be calculated once and then used repeatedly.  Expand

(1.5)

The derivative with respect to cK is zero at the minimum

      (1.6)

This becomes a single step minimization. 

           (1.7)

In practice, there is a large accuracy gain in taking more than one step to reach the minimum so that in the final step the first derivative array B as given by (1.3) becomes zero.  If the matrix A can be inverted without a Marquardt parameter, this is a single step minimization.  The matrix A needs to be calculated only on the first step, while B needs to be recalculated on every step.  This makes a few changes in the main code, but otherwise the code is the same as nlfit.  In fitting N points to M polynomials it requires N ´ M operations to find B and N ´ M´ (M+1)/2 to find A.  This means that for large M most of the time is used in finding A.  The time required is thus reduced by a factor of (M+1)/2 by eliminating this step.

--- Bob code needs work for\linfit.wpj

 ..\nlfit\Welcome.htm.