A straight line is fitted by least squares

PHYSICS · Multi-part · Fermi University Physics · Mathematical Methods for Physics · Linear algebra and vector spaces · Numerical and computational mathematics

Mathematical Methods for Physics, Ch Floating-point arithmetic, conditioning and numerical stability

Problem

A straight line y=a+bty = a + bt is fitted by least squares, with equal weights wj=1w_j = 1, to three readings taken at clock times t=1000t = 1000, 10011001 and 1002 s1002\,\mathrm{s}. Treat tt as the plain number of seconds. The fit is to be carried out in single precision, about seven good digits. ((a)) Build the normal matrix ATA\mathsf{A}^{\mathrm{T}}\mathsf{A} from SS, SxS_x and SxxS_{xx}, and find its two eigenvalues and its condition number. Say what goes wrong if the smaller eigenvalue is taken from the quadratic formula on a ten-digit calculator, and how to avoid it. ((b)) Find the fitting problem's own condition number κ(A)\kappa(\mathsf{A}). How many digits can the fit itself cost, how many can elimination on the normal equations cost, and what is left of single precision's seven? ((c)) Measure time from the mean instead, t′=t−1001 st' = t - 1001\,\mathrm{s}, and find the new normal matrix and its condition number. ((d)) Of the loss in part (b), say which part belongs to the problem and which to the method, and explain why part (c) does not contradict the rule that no algorithm can lower a problem's condition number.

Browse the problem library