Function leastSquaresSlopeAndIntercept