LINEST 2003 introduced a new algorithm that is generally better numerically
than in previous version. However MS appears to have incorporated a matrix
version of the il-advised "optimization" of
http://support.microsoft.com/kb/78113
with the result that LINEST 2003 coefficients that are exactly zero are not
to be trusted. An earlier, more complicated, example is given i
http://groups.google.com/group/micr..._frm/thread/aaa78a91ec42fd4b/71aee5816a59f905
Oddly everything else in the output (other than zero coefficients and the
intercept) appears to be correct (R^2, etc). This problem appears to occur
with columns that are essentially orthogonal, which also have the same vector
norm as each other. Fortunately this is exactly the situation where directly
forming and solving the normal equations performs best numerically.
Assuming that your angles run from 0 to 1080 degrees in 21.6 degree
increments, then the X'X matrix should be
51 1 0
1 26 0
0 0 25
and the X'y vector is
50.55891
-328.0164586
225.8573019
which leads to the solution -12.66369683*cos wt + 9.034292078*sin wt +
1.239658957. Your cos and intercept terms differ too much from these values
to be attributed to accumulated round-off; how did you calculate them?
LINEST in older versions of Excel would handle this calculation with no
problem, but could give incorrect results without warning on more complicated
calculations. LINEST in Excel 2007 retains the better numerical algorithm
while correcting this bug. Unfortunately, they "improved" the formerly
excellent chart trendline fitting routine to the point that it is no longer
trustworthy
http://groups.google.com/group/micr..._frm/thread/4328cd532baaa078/f625e5a0b1867721
and other threads that it refers too
Jerry