What is the least-squares objective function for simple linear regression?
Conditions
- The model is simple linear regression.
- Residuals are defined as observed y minus predicted y.
Reasoning, step by step
- Define the residual for each observation as the difference between the observed value and the model's prediction.
- Square each residual to penalize larger errors more heavily.
- Sum these squared residuals across all observations to form the objective function.
Example
The script states: 'A residual is observed y minus the line’s predicted value. The least-squares objective sums the squared residuals over all observations and depends on slope and intercept.'
Common misconceptions
- Thinking the objective sums absolute residuals instead of squared residuals.
- Believing the objective depends only on the slope and not the intercept.
Watch the explanation
Connected concepts
Explore next
Related questions
The least-squares fit is identified with the orthogonal projection of onto because the goal of least squares is to find the vector in the subspace that is closest to . A fundamental geometric property of subspaces states that the unique closest point in a subspace to an external vector is its orthogonal projection.
Conditions: is a subspace of ; ; Distance is measured by the Euclidean norm
The computation requires the sums of , , , and .
Conditions: Computing the slope and intercept by hand for a least-squares regression line.
By setting the partial derivative of the least-squares objective with respect to the intercept to zero, we obtain the relationship: intercept = mean(y) − slope · mean(x). This implies that the fitted line always passes through the point of sample means.
Conditions: The model includes an intercept term.; The derivative is taken with respect to the intercept parameter.
The least-squares slope is calculated as the sum of the products of centered x and y values, divided by the sum of squared centered x values. Mathematically, this is .
Conditions: The denominator is positive.; The model is simple linear regression with an intercept.
The solution to the normal equations is considered the least-squares solution because it satisfies the necessary and sufficient condition for minimizing the residual norm . The derivation shows that minimizing this norm is equivalent to requiring the residual to be orthogonal to the column space .
Conditions: The original system may be inconsistent; has a solution
Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.