0
$\begingroup$

While going through page 1 of Lecture 24: Weighted and Generalized Least Squares [PDF], I got the following questions. Weighted sum of squares is defined as below: $$ \sum_{i = 0}^{n}{w_i(Y_i - X_ib)^2}$$ And this could be written in matrix notation as follows $$(Y−Xb)'W(Y−Xb)$$

Only thing I did not get is how $W$ (weights) got into the middle? And why should it be a diagonal matrix?

I get that $\sum_{}x^2$ could be written as $X^T * X $. But how $\sum_{}wx^2$ is written as $X^TWX$ , any clue?

$\endgroup$
  • $\begingroup$ @RodrigodeAzevedo Thank you for the edits, I get that $\sum_{}x^2$ could be written as $X^T * X $. But how $\sum_{}wx^2$ is written as $X^TWX$ , any clue?? $\endgroup$ – Sonnu Jul 8 '18 at 0:51
  • 1
    $\begingroup$ To weight the rows of a matrix, left-multiply by a diagonal matrix. To weight the columns of a matrix, right-multiply by a diagonal matrix. $\endgroup$ – Rodrigo de Azevedo Jul 8 '18 at 0:57
  • $\begingroup$ Related: math.stackexchange.com/q/2721222/339790 $\endgroup$ – Rodrigo de Azevedo Jul 8 '18 at 2:19
0
$\begingroup$

\begin{align} \begin{bmatrix} x_1 & x_2 & \cdots & x_n \end{bmatrix} \begin{bmatrix} w_1 & 0 & \cdots & 0 \\ 0 & w_2 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & 0 & w_n \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} &= \begin{bmatrix} x_1 & x_2 & \cdots & x_n \end{bmatrix} \begin{bmatrix} w_1x_1 \\ w_2x_2 \\ \vdots \\ w_nx_n \end{bmatrix} \\[3mm] &= \sum_{i=1}^n w_i x_i^2 \end{align}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.