Fitting a regression line means choosing a slope and an intercept. The three demonstrations below separate those choices before combining them into one loss surface.
Stage 1: Change the Slope
The intercept stays fixed while the slope rotates the line. Each possible slope maps to one point on the mean squared error parabola.
Data space
Intercept fixed at its best valueError versus slope
Stage 2: Change the Intercept
Now the slope stays fixed while the intercept moves the line vertically. The error again forms a parabola, with the best intercept at its lowest point.
Data space
Slope fixed at its best valueError versus intercept
Stage 3: Fit Slope and Intercept Together
Both parameters are free in the final view. The two parabolas become a quadratic bowl, and every slope-intercept pair corresponds to one point on its surface.
Data space
Both parameters are adjustableError surface
Putting the Views Together
Every move in parameter space changes the fitted line. That changes the residuals in data space, and their squared values determine the height of the error curve or surface.