least squares fitting—polynomial