[QUOTE=Napier]
So they have the Sigma registers that hold sums from which to calculate what you want, and they eat the observations so that nothing is left but their cumulative effect on those registers.
I also figured that what he was doing was mainly adapting a common technique to the 41C. […] Web searching his book turns up numerous papers that reference it, but nothing about where he got his method from. In the book itself he talks about how regressions work, but not in much detail.
So it’s news to me that this isn’t the way everybody else would already have used to solve these problems. And I’m glad I happened to buy the book 24 years ago!
[/QUOTE]
I don’t know how well-known this technique is in general; I also was introduced to it through old scientific calculators (a TI in my case, I think, though I later got that old RPN religion).
This method of minimizing the squared error by calculating particular intermediate statistics was solved, at least for the special case of the linear least-squares fit, by Legendre and Gauss. (I don’t know who first applied this method as a computer algorithm running in limited memory, however.) Here’s a translation (PDF) of Legendre’s method, which notes that the equations to be solved have coefficients which are sums of various functions of the data points. Legendre notes that the method generalizes; since this preceded modern matrix notation, he doesn’t write an explicit general solution, but the general method is clear. This method is precisely what is used to derive the normal equations for the general least-squares solution.
I can’t tell by reading your posts whether you understand how the calculations you posted above for the Cauchy-Lorentz curve (post#21) are derived, but they follow the same method:
The curve to be fit has the form
y=1/(a(x + b)[sup]2[/sup] + c);
this is rewritten as
(1/y) = ax[sup]2[/sup] + (2ab)x + (ab[sup]2[/sup]+c) = d + ex + fx[sup]2[/sup].
Now a least-squares fit is performed to find the regression coefficients (d,e,f). The normal equations give
[d]
[e] = (A[sup]T[/sup]A)[sup]-1[/sup]A[sup]T[/sup]b
[f]
where
A = ( 1 , x[sub]i[/sub] , x[sub]i[/sub][sup]2[/sup] )
b = ( 1/y[sub]i[/sub] )
contain the observations in columns (that is, A has 1s in the first column, the data values x[sub]i[/sub] in the second column, and the values x[sub]i[/sub][sup]2[/sup] in the third column). The crucial point is that the quantities A[sup]T[/sup]A and A[sup]T[/sup]b can be written using just a few intermediate statistics, after which the raw data is no longer needed:
[ S1 Sx Sx[sup]2[/sup] ]
[ Sx Sx[sup]2[/sup] Sx[sup]3[/sup]] = A[sup]T[/sup]A
[Sx[sup]2[/sup] Sx[sup]3[/sup] Sx[sup]4[/sup]]
and
[ S(1/y) ]
[ S(x/y) ] = A[sup]T[/sup]b
[ S(x[sup]2[/sup]/y)]
(here S(f(x,y)) means the sum of all values f(x[sub]i[/sub],y[sub]i[/sub]) over the data; apologies for the ugly formatting). I haven’t checked that inverting A[sup]T[/sup]A gives the results you quote, but this is just algebra. Note that only eight values are required: S1, Sx, Sx[sup]2[/sup], Sx[sup]3[/sup], Sx[sup]4[/sup], S(1/y), S(x/y), and S(x[sup]2[/sup]/y); these are your values L,D,E,J,K,F,H,I. (G is only needed to compute the residual.)
This works as long as you can write the equation to be least-squares minimized as a linear function of the regression coefficients (here (d,e,f)); in particular, it works for any polynomial, though as seen from the Lorentz example above, it’s not restricted to polynomials.
However, we made two questionable assumptions when we inverted the equation to get a polynomial in 1/y. The first is that an uncertainty of dy in y translates to an uncertainty of about dy/y[sup]2[/sup] in 1/y, so if all of our uncertainties in y are about the same size but the measured values of y differ by quite a bit, the resulting uncertainties in 1/y are not going to be the same size. This is easy to fix in the usual least-squares way, by scaling the equations so that all of the variances are the same. The second problem is that if the errors in y are unbiased and Gaussian, say, the errors in 1/y are biased and no longer Gaussian. It is not strictly correct to minimize the squared error in these modified equations. Fixing this requires a nonlinear least-squares approach, which is typically ugly.