Fit¶
Performs a least-squares fit of data to a linear combination of basis functions.
When the design matrix does not have full column rank there is no unique least-squares solution, and the minimum-norm one is returned. Fitting a line through a single point gives the shortest coefficient vector among the infinitely many lines through it:
$ wo 'Fit[{{1, 1}}, {1, x}, x]'
0\.(5(0+\d*)?|4999999999\d*) \+ 0\.(5(0+\d*)?|4999999999\d*)\*x (regex)
Repeated abscissae are the same situation — the fit passes through their mean: