I have a scatter plot composed of X and Y coordinates. I want to use the minimum squares for a straight line to get the best fit line.
The smallest squares that fit the straight line are: If (x_1, y_1), .... (x_n, y_n) are measured data pairs, then the best line is y = A + Bx.
Here is my python code:
It looks right, I have problems printing A and B. Thank you!
source share