5.1.4 Errors and Sum of Squared Errors
These models suggest that as the line moves closer to the data points, the
predictions are getting better. In other words, as the distance between the
actual data points and predicted data points is reduced, the prediction of
the model gets better. This distance between the actual data point and the
predicted data point is called an error, often denoted by (epsilon). Thus the error
can be represented as:
Here, is the actual value of the dependent variable, and
(read as y-hat) is the predicted value of the dependent variable.
While we aim for minimal error, real-world data is typically complex and
generally the data points do not fall on the line. As a result, mostly there
will be an error associated with the line, resulting in predictions that may be far
from the actual value. Therefore, the simple linear regression equation must
include error to account for this variability:
In the context of our example of age versus insurance premium, for any
person , the equation is represented as:
, where
= 1, 2, …..n
Here is the insurance premium required for a person
,
is the age of the person
and
is the error term corresponding to
.
To deepen our comprehension of “errors”, let's examine Model 3 and select two data points with distinct ages. We will then evaluate the errors between their actual insurance amounts and the predicted insurance amounts.