Weighted least squares

Weighted least squares is a method of regression, similar to least squares in that it uses the same minimization of the sum of the residuals:


 * $$ S = \sum_{i=1}^n (y_i - f(x_i))^2. $$

However, instead of weighting all points equally, they are weighted such that points with a greater weight contribute more to the fit:


 * $$ S = \sum_{i=1}^n w_i(y_i - f(x_i))^2. $$

Often, wi is given as the inverse of the variance, giving points with a lower variance a greater statistical weight:


 * $$ w_i = 1/\sigma_i^2. $$

Bình phương tối thiểu có trọng lượng