Least Squares Formula