Your privacy choices

KiwiBee uses optional Google Analytics, Google Ads, and Meta Pixel cookies to understand adult visitors, measure completed sign-ups, and improve campaigns. Essential cookies always stay on. OpenAI’s ChatGPT Ads Pixel also measures page views and completed enquiries after advertising consent, and may use hashed contact details for matching. Privacy policy

Skip to main content

Linear Regression & Error Bowl

About this simulation

Linear Regression & Error Bowl connects statistics and optimization in a split 3D studio. On the left board, six draggable scatter points—including a high-leverage orange outlier—are fitted by a trial line y = mx + b. Attached to each point is a literal red square whose side equals the vertical residual |yᵢ − (mxᵢ + b)|, making its area equal to the squared error eᵢ². On the right stage, the total area of all squares is plotted as a 3D paraboloid bowl SSE(m, b) over slope and intercept parameter space. Students can drag the parameter marker across the bowl or toggle Snap to Optimal OLS to watch the marker settle into the unique global minimum (m̂, b̂) while monitoring r and R².

What students can explore

  • Adjust the Trial slope m and Trial intercept b sliders or drag the gold ball on the 3D bowl to shrink the red residual squares as much as possible.
  • Turn on Snap to Optimal OLS and verify that the gold parameter ball lands precisely on the green OLS Minimum marker at the bottom of the error bowl.
  • Drag the orange outlier point sharply downward on the scatter plot and watch how strongly a single outlier pulls the optimal slope m̂ and lowers R².
  • Line up all six scatter points into a nearly straight line and watch Correlation r approach 1.000 and SSE approach zero.
  • Toggle Show residual squares on and off to compare vertical residuals eᵢ against their squared areas eᵢ².

Learning objectives

  1. 1Explain why Ordinary Least Squares (OLS) minimizes the sum of squared vertical residuals Σ (yᵢ − ŷᵢ)² rather than signed residuals.
  2. 2Connect the algebraic regression parameters (slope m and intercept b) to coordinates on a convex 3D loss surface SSE(m, b).
  3. 3Evaluate how outliers and high-leverage points distort the least-squares regression line and reduce the coefficient of determination R².
  4. 4Interpret correlation r and R² as measures of linear association and explained variance.

Questions teachers ask

Why are the residuals squared in Least Squares regression?

Squaring each vertical error eᵢ = yᵢ − ŷᵢ prevents positive errors above the line from canceling negative errors below the line, penalizes large misses heavily, and creates a smooth paraboloid bowl with a single unique minimum.

What does the 3D Error Bowl on the right represent?

The two horizontal axes of the bowl are the trial slope m and trial intercept b, and the vertical height is the Sum of Squared Errors SSE(m, b). Every possible straight line corresponds to one point on that bowl, and the best-fit line sits at the lowest point.

Why does dragging the outlier change the fitted line so dramatically?

Because errors are squared, a point twice as far from the line contributes four times as much to SSE. The regression line tilts strongly toward an outlier to keep that giant square from exploding in area.

What is the difference between Correlation r and Coefficient R²?

Correlation r ranges from −1 to +1 and measures the direction and strength of a linear relationship. R² (the square of r in simple linear regression) ranges from 0% to 100% and tells what fraction of the variance in y is explained by x.

Embed this simulation

Drop it into your LMS, blog, or class site — free.

<iframe src="https://kiwibee.io/en/simulations/least-squares-linear-regression-3d-3d-simulation/embed" title="Linear Regression &amp; Error Bowl | KiwiBee" loading="lazy" allowfullscreen style="width:100%;height:min(70vh,620px);min-height:420px;border:0;border-radius:16px"></iframe>

Continue exploring

From model to evidence

Use a worksheet to capture predictions, observations, and explanations after students explore.

Bring interactive science into your classroom

KiwiBee's free teacher workspace brings lesson planning, worksheets, classroom tools, and gradebook together in one place.

Start free and create your first class

or explore the teacher workspace →