Line Regression
Let
 |
(4.91) |
be the equation of a line written in explicit form, with the measurement error entirely along the
axis.
With the error along the
axis, the cost function to be minimized is
 |
(4.92) |
The solution to the problem is the point at which the gradient of
with respect to
and
vanishes:
 |
(4.93) |
that is:
 |
(4.94) |
where
is the mean of the samples
(the same notation is used for the other quantities).
The line passes through the point
, the centroid of the distribution.
This result can easily be modified when one wants to minimize the deviation along
rather than along
, or to represent the line equation in implicit form.
Paolo medici
2026-10-06