This site contains the paper “An efficient algorithm for the classical least squares approximation”, co-authored by Dimitar K. Dimitrov and Lourenço L. Peixoto, and accepted for publication in SIAM Journal on Scientific Computing, as well as the related MATLAB codes.

The image of the green valley and the blue river below is in fact the outcome of the algorithm for the 108 green pieces of data f(x_j) = e^{x_j} \sin 12x_j + \delta_{10^8}, where x_j = -1+(2j-1)/N and \delta_{10^8} returns normally distributed pseudorandom numbers by MATLAB, and the blue river is the approximate solution of degree 12 of the Classical Least Squares Approximation Problem.