I am using simple linear regression to fit a line trough a set of points in 2D space.
With linear regression (in my interpretation) points $(x_i, y_i)$ are fit using a model functon $y=f(x)=\alpha+\beta x$ where $\alpha$ and $\beta$ are selected to minimize the sum of squared differences between $f(x_i)$ and $y_i$
I am actually interested in minimizing the sum of squared distances between the points and the fitted line, not the differences between the y coordinates of points and line for corresponding x. In the degenerate case in which all points have the same x coordinate $X_0$, the line $x = X_0$ would be a perfect fit which can not be represented by the model function.
Degenerate case aside, are the two problems equivalent? Do they result in the same fitted line? Or does an alternative closed form solution exist for my problem?