Skip to content
Heteroskedasticityintermediate

Weighted Least Squares and Feasible GLS

Weighted least squares (WLS) restores efficiency under heteroskedasticity by weighting each observation by 1σi2\tfrac{1}{\sigma_i^2}, that is, dividing through by the known standard deviation so the transformed error is homoskedastic. When the variance form is unknown, feasible GLS (FGLS) estimates it first, typically from a regression of log(u^2)\log(\hat{u}^2) on the regressors, then applies WLS with the estimated weights. If the variance model is correct, WLS and FGLS are more efficient than OLS (smaller standard errors). The trade-off is robustness: a wrong variance model can leave FGLS biased in finite samples with unreliable standard errors, which is why the modern default remains OLS with robust standard errors.

Why it matters

Heteroskedasticity means some observations are inherently noisier than others, yet plain OLS listens to every point equally. WLS turns down the volume on the noisy observations and turns it up on the precise ones, which is exactly how you would weight evidence of differing reliability, and that extra information buys tighter estimates. The catch is that you have to know the noise levels. FGLS estimates them from the data, but if your guess about how the variance depends on xx is wrong, you have down-weighted the wrong points and the payoff can turn into a penalty.

Formulas

WLS as a weighted minimization
minβ  i=1n(yiβ0β1xi1βkxik)2σi2\min_{\beta} \; \sum_{i=1}^{n} \frac{\bigl(y_i - \beta_0 - \beta_1 x_{i1} - \cdots - \beta_k x_{ik}\bigr)^2}{\sigma_i^2}
Each squared residual is weighted by 1σi2\tfrac{1}{\sigma_i^2}. Equivalently, divide yiy_i and every regressor by σi\sigma_i, then run OLS on the transformed data, whose error is homoskedastic.
FGLS variance model (estimated, then used as weights)
log(u^2)=α0+α1x1++αkxk+error\log(\hat{u}^2) = \alpha_0 + \alpha_1 x_1 + \cdots + \alpha_k x_k + \text{error}
Fit this, form h^i=exp(logu^i2^)\hat{h}_i = \exp(\widehat{\log \hat{u}^2_i}), and run WLS with weights 1h^i\tfrac{1}{\hat{h}_i}. Using log(u^2)\log(\hat{u}^2) keeps the fitted variances positive.

Worked examples

Scenario

You believe the error variance in a savings regression is proportional to income, so Var(uinc)=σ2inc\mathrm{Var}(u\mid \text{inc}) = \sigma^2 \cdot \text{inc}, and you want the efficient WLS estimates.

Solution

With a known weight, use `regress saving inc size [aweight=1/inc]`, which divides each observation by inc\sqrt{\text{inc}} before estimating. For the unknown-form case, run FGLS by hand: estimate OLS, `predict uhat, resid`, `gen lu2 = ln(uhat^2)`, regress `lu2` on the regressors, `predict ghat`, then `regress saving inc size [aweight=1/exp(ghat)]`. Compare the WLS standard errors with the OLS robust ones; WLS is tighter only if the variance model is right.

NoteStata’s `aweight` implements analytic weights proportional to 1σi2\tfrac{1}{\sigma_i^2}. If you doubt the variance model, prefer OLS with `robust`.

Common mistakes

  • WLS or FGLS is needed because OLS is biased under heteroskedasticity. OLS is still unbiased and consistent; WLS and FGLS are about efficiency (smaller variance), not about fixing bias.
  • FGLS is always better than OLS with robust SEs. Only if the variance model is correct. A misspecified variance function can make FGLS biased in finite samples and less reliable than robust OLS, which assumes nothing about the variance form.
  • WLS weights every observation the same as OLS does. WLS deliberately gives noisy (high-variance) observations less weight and precise observations more, which is the source of its efficiency gain.
  • Once you use WLS you no longer need robust standard errors. If the variance model might be wrong, you can still report heteroskedasticity-robust SEs for the WLS fit as a safeguard against a misspecified weight.

Revision bullets

  • WLS weights by 1σi2\tfrac{1}{\sigma_i^2}, transforming the error to be homoskedastic
  • FGLS estimates the variance (e.g. log(u^2)\log(\hat{u}^2) on xx), then applies WLS
  • If the variance model is right, WLS and FGLS are more efficient than OLS
  • If the variance model is wrong, FGLS is less robust and can be biased
  • Modern default stays OLS with robust SEs; Stata WLS uses `[aweight=1/h]`

Quick check

Relative to OLS under heteroskedasticity, correctly specified WLS is:

The main risk of using FGLS instead of OLS with robust standard errors is that:

In WLS, how are observations with larger error variance treated?

Connected topics

Sources

  1. Wooldridge (2019), §8.4
    Wooldridge, Jeffrey M. Introductory Econometrics: A Modern Approach, 7th ed., Section 8.4, Weighted Least Squares Estimation. Cengage, 2019.
    Develops WLS for a known variance form and FGLS for an estimated one, and weighs their efficiency gains against the robustness of OLS with robust standard errors.
  2. Wooldridge (2019), §8.5
    Wooldridge, Jeffrey M. Introductory Econometrics: A Modern Approach, 7th ed., Section 8.5, The Linear Probability Model Revisited. Cengage, 2019.
    Applies WLS and FGLS reasoning to a leading case of known-form heteroskedasticity and reinforces when robust OLS is preferred.
How to cite this page
Dr. Phil's Quant Lab. (2026). Weighted Least Squares and Feasible GLS. Derivatives Atlas. https://phucnguyenvan.com/concept/efm-wls-fgls