Weighted Least Squares (WLS)
A regression that lets some data points count more than others. Give the reliable, low-noise observations bigger weights and the noisy ones smaller weights, and you get back a precise, efficient fit.
Prerequisites: Ordinary Least Squares (OLS)
Ordinary least squares treats every data point as equally trustworthy. It squares each residual and adds them up, so a noisy, unreliable observation gets exactly the same vote as a clean, precise one. That's fine when all your data really are equally noisy, but often they aren't. Some observations are measured with more precision, cover more underlying samples, or come from calmer periods. Weighted least squares fixes the unfairness: it lets you hand each observation a weight that says how much it should count.
The rule of thumb is simple and intuitive: weight each point by the inverse of its noise. A point you trust ten times as much should pull on the fit ten times as hard. Do that, and you recover a fit that's both precise and, under the right weights, provably the best linear unbiased estimator again, which plain OLS forfeits the moment the noise stops being uniform.
The model
OLS minimises the plain sum of squared residuals. WLS minimises a weighted sum:
where is the weight on observation . A big means "fit this point closely, its residual is expensive"; a small means "don't sweat missing this one." The optimal choice, the one that gives the most precise estimate, is the inverse of each point's error variance:
Points with small variance (reliable) get large weights; points with large variance (noisy) get small ones. WLS is the special case of GLS where the errors are unequal in size but still uncorrelated, so the error covariance is a diagonal matrix and its inverse is just this list of weights.
Weight each observation by the inverse of its variance, , and minimise . Reliable points pull hard, noisy points barely at all, which is exactly the right way to fight Heteroskedasticity.
Worked example: readings from unequal samples
You measure a signal at three settings, but each reading is an average over a different number of trials, so the more-averaged readings are more reliable (variance shrinks like ). The readings:
- Setting A: averaged over trials, reading
- Setting B: averaged over trials, reading
- Setting C: averaged over trials, reading
Just averaging the three numbers gives , but that lets the flimsy 4-trial reading count as much as the rock-solid 100-trial one. Since variance scales as , the right weights are proportional to . The WLS estimate is
The weighted answer sits right next to the two well-measured settings and shrugs off the noisy , whereas the naive was dragged up by it. That's WLS doing its one job: letting evidence count in proportion to how much you can trust it.
When your data points are group averages, the weight is just the group size: bigger groups have smaller averaging error, so weight by . This "weight by count" case is the most common WLS you'll actually run.
Where it goes wrong
- Wrong weights hurt. WLS is only optimal if the weights really are . Guess the variance pattern badly and you can end up less precise than plain OLS, you've amplified the wrong points. When unsure of the pattern, keeping OLS estimates and using robust (White) standard errors is the safer play.
- You usually have to estimate the variances. The true are rarely known, so you model them (e.g. variance rising with a predictor), then plug in, that's feasible WLS, and it inherits the risk of a mis-modelled variance.
- It doesn't cure bias. WLS fixes efficiency and standard errors under heteroskedasticity; it does nothing about a regressor being correlated with the error. Endogeneity biases WLS exactly as it biases OLS.
- Extreme weights = fragility. If one point gets a huge weight, the whole fit hinges on it. A single mismeasured "high-precision" observation can then dominate, so sanity-check the largest weights.
WLS reweights to fix unequal noise, not bias. If you feed it the wrong variances it can be worse than OLS, and it never rescues you from a regressor that's correlated with the error. Only reach for it when you genuinely know which points are noisier and why.
The clean way to remember the family: OLS is "everyone votes equally," WLS is "votes weighted by reliability," and GLS adds "and untangle voters who are echoing each other." WLS is the middle rung, the everyday tool for Heteroskedasticity when your observations differ in precision but not in correlation.
Related concepts
Practice in interviews
Further reading
- Greene, Econometric Analysis (Ch. 9)
- Hayashi, Econometrics (Ch. 1)
- Draper & Smith, Applied Regression Analysis