Linear Regression
Let
 |
(3.71) |
be the equation of the line expressed in explicit form with the measurement error fully incorporated along the
axis. With the error along the
axis, the cost function to be minimized is
 |
(3.72) |
.
The solution to the problem is the point where the gradient of
in
and
is zero, that is:
 |
(3.73) |
With
, the mean value of the samples
(using the same formalism, other quantities are also indicated). The line passes through the point
, the centroid of the distribution.
It is easy to modify this result if one wishes to minimize the deviation along the
instead of along the
, or to represent the equation of the line in implicit form.
Paolo medici
2025-10-22