# How to find straight line minimizing the sum of squares of Euclidean distances from the points? [duplicate]

I have recordings of intensities of two fluorescent antibodies on a 2d image $2^{10} \times 2^{10}$ pixels in size, giving me $2^{20}$ pairs of numbers.

What is the best way to find the best straight line approximation in the plane, in the sense that the sum of squares of Euclidean distances from the points to the straight line is minimized? Is this given by PCA?

What is "orthogonal regression"? Is PCA the same as "orthogonal regression"?

• Sorry I had to comment on this, there is a famous mathematician that shares the same name as you and immediately when I saw this I thought "David Epstein can't be asking this!" (I hope I didn't offend you, it was a good hearted comment) More to the point: No, PCA is not the same as "orthogonal regression". I think you'll find more information on orthogonal regression if you look for Total Leasts Squares. Wikipedia has actually a quite good article on this. Start with Deming regression first. Mar 20, 2013 at 10:56
• On this site, good keywords to use for searches are "errors in variables" and "deming regression." In 2D, PCA does provide the fit you are looking for. (Proof: diagonalizing the variance-covariance matrix shows that the smallest eigenvalue is the smallest possible mean square distance which is achieved in the direction of the corresponding eigenvector. The best linear approximation must be orthogonal to that, which is the direction of the other eigenvector: the first principal component.) However, it does not compute useful adjunct statistics that can be afforded by other methods.
– whuber
Mar 20, 2013 at 14:11