Also, df Reg = k and df T = n – 1, as for OLS. The n × 1 matrix of predicted y values Y-hat = and the residuals matrix E = can be expressed asĪn estimate of the variance of the residuals is given byĪs for OLS. Where W is the n × n diagonal matrix whose diagonal consists of the weights w 1, …, w n. Using the same approach as that is employed in OLS, we find that the k+1 × 1 coefficient matrix can be expressed as In weighted least squares, for a given set of weights w 1, …, w n, we seek coefficients b 0, …, b k so as to minimize Given a set of n points ( x 11, …, x 1 k, y 1), …, ( x n1, …, x nk, y n), in ordinary least squares ( OLS) the objective is to find coefficients b 0, …, b k so as to minimize