What it means
Whenever you try to summarise messy data with a single line or number, you will miss some points. The difference between an actual value and the fitted value is called a residual, or error.
Least squares chooses the fit that makes the sum of all the squared residuals as small as possible. Squaring does two helpful things.
It stops positive and negative errors from cancelling each other out, and it punishes large errors more heavily than small ones. The result is a unique, easily calculated best fit, which is one reason the principle became so widely adopted.
The simplest example is the average. Of all possible single numbers you could use to summarise a list of values, the mean is the one that gives the smallest sum of squared differences.
The same idea extended to a line is called linear regression, which finds the line that best describes the relationship between two variables. For business users, least squares appears behind many tools.
Spreadsheet trendlines, cost estimation formulas, demand forecasts and the calculation of a share's beta all rely on it. Knowing the principle helps managers interpret the output sensibly, for example by checking whether the fit is good before relying on a forecast.
The principle has limits. Because large errors are squared, a single extreme outlier can pull the fit a long way from the other points, so unusual data should be examined.
Least squares also assumes the relationship is reasonably stable, so a fit built on old data may be poor when conditions change. A simple habit helps: always plot the data and the fitted line before trusting the numbers.
A chart makes outliers, curves and gaps in the data visible at a glance, in a way that a table of results does not.
In practice
Real-world examples.
Example
A retailer plots monthly advertising spend against sales and asks a spreadsheet to add a trendline. The software uses least squares to draw the line that fits the points most closely. The marketing manager uses the slope to estimate extra sales per dollar of spend.
Example
An investment analyst estimates a share's beta by comparing its returns with those of the market. The beta is the slope of the least squares line through the data points. A higher slope tells the analyst that the share moves more than the market.
Example
A factory accountant wants to split a mixed cost, such as electricity, into fixed and variable parts. She fits a line through 12 months of cost and production data. The intercept is the estimate of the fixed cost and the slope is the variable cost per unit.
Formula
Calculation
Sum of squared errors = sum of (actual value - fitted value) squared
Suppose a business wants a single figure to summarise weekly sales of 4, 6 and 8 (in thousands of dollars). Trying 6, which is the mean, gives errors of -2, 0 and 2, and squared errors of 4, 0 and 4, a total of 8. Trying 5 gives errors of -1, 1 and 3, and squared errors of 1, 1 and 9, a total of 11. Since 8 is smaller than 11, the mean of $6,000 is the least squares best fit, and no other figure gives a total below 8.Case study
Seen in the real world.
Redwood Cycles is an illustrative, fictional bicycle maker whose finance team forecast monthly demand using a simple average of the last year. The forecast was repeatedly wrong because sales were rising steadily, with errors that grew each quarter.
An analyst fitted a least squares trend line through the 24 months of sales data, and the line captured the upward drift that the average ignored. The sum of squared errors fell by about 60%, and the forecast error for the next quarter dropped from 14% to 5%. The illustrative lesson is that the choice of what to minimise, and what shape to fit, changes how useful a forecast is, and that a simple average is a poor guide when the underlying trend is moving.
Watch out
Common mistakes.
- Assuming that the least squares fit is always the correct model, when it is only the best fit to the chosen shape, such as a straight line.
- Ignoring outliers, which can distort the fit because their errors are squared.
- Using the fitted line to predict far outside the range of the data, where the relationship may not hold.
Questions
People also ask.
Why are the errors squared instead of just added up?
Squaring stops positive and negative errors from cancelling out and gives a fit that is simple to calculate and has helpful mathematical properties.
Is least squares the same as regression?
Regression is the broader family of methods for modelling relationships between variables, and least squares is the most common way of fitting a regression line to the observed data.
Does a good least squares fit prove cause and effect?
No, it only shows that two things move together in the data, and the cause must be judged from knowledge of the business.
From the founder's library

Take it further with the book.
Build your financial confidence beyond this definition. Shihan's full-length guide, Accounting Fundamentals, takes the same plain-English approach and turns it into a complete, practical playbook for non-finance managers, business owners and students - with chapter-end quiz answers and presentation slides included.
25% off with code MMHQ25, applied at checkout. Priced in USD - checkout may show the equivalent in your local currency.
View the book and save 25%Related
