Ask
20
@overfit_omar ·

Is linear regression the same thing as least squares, or are they two things that usually coincide?

These two terms get used interchangeably around me and I have started to suspect that is sloppy rather than correct.

Every discussion I find dives into estimator theory before answering the plain question. What I want to know is whether they are genuinely two names for one procedure, or two different ideas that happen to give the same answer in the ordinary case.

If they are different, I would like a concrete example where they come apart, because that is what would make the distinction stick.

4 answers Share
Report

Answering anonymously — a moderator will review it first.

  • @residual_ruth · 2w ago

    They are two different kinds of thing, and confusing them is common enough that it is worth being precise once.

    • Linear regression names the model: you are asserting that the expected value of y is a linear combination of your predictors. That is a claim about shape.
    • Least squares names the fitting criterion: whatever the model, choose the parameters that minimise the sum of squared residuals. That is a claim about what counts as a good fit.

    A model needs a criterion and a criterion needs a model, so in ordinary use you pick both and nobody distinguishes them. They coincide so reliably in introductory material that the two words become one idea.

    They come apart in both directions, which is the cleanest way to see they are separate.

    26
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @logit_lorenzo · 2w ago

    Concrete examples in both directions, since that is what you asked for.

    Linear regression fitted by something other than least squares. Fit the same linear model by minimising the sum of absolute residuals instead of squared ones. You get a valid linear regression — same model, same interpretation of coefficients — with a different line, one that is far less sensitive to outliers. Quantile regression is the same idea generalised, and ridge and lasso are linear regression with a penalty added to the criterion.

    Least squares applied to something that is not linear regression. Fit a curve like a * exp(b * x) by minimising squared residuals. That is nonlinear least squares: the criterion is unchanged, the model is not linear in its parameters, and you need an iterative solver rather than a closed-form solution.

    Once you have seen both, the pairing stops looking like one thing.

    23
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @prior_priya · 2w ago

    One clarification that trips people up when they first meet the definition: "linear" refers to the parameters, not to the shape of the curve.

    Fitting y against x, x squared and x cubed is still linear regression, and still solved in closed form by least squares, even though the fitted curve is obviously not a straight line. What makes it linear is that y is a linear combination of the terms, whatever those terms are.

    Whereas a * exp(b * x) is not linear regression, because b sits inside a function rather than multiplying a term. A curve can be bent and still linear; a straight-ish model can be nonlinear. The word is doing a technical job that its everyday meaning actively fights.

    17
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report
  • @sample_sena · 2w ago

    The reason the two collapsed into one phrase historically is worth a line: for the linear model with normally distributed errors, the least squares estimates are exactly the maximum likelihood estimates.

    So under the standard assumptions, the criterion everyone reaches for is not just convenient, it is the principled one. That coincidence is why the pairing became the default and why the words drifted together.

    12
    Share
    Reply

    Answering anonymously — a moderator will review it first.

    Report