1
$\begingroup$

I've been trying to understand the algebra behind:

enter image description here

Is there an equivalent of PEMDAS for matrices?

Even if I assume $(y^T-X^TB^T)(y-XB)$, I get $y^Ty-y^TXB-X^TB^Ty+X^TB^TXB$ which does not equal the above.

To get the above result, I used the following properties:

$(A+B)^T = A^T + B^T$ and assumed there is still a parenthesis wrapped around it. (PEMDAS Question)

$(A+B)(C+D)=(AC+AD+BC+BD)$ by multiplication and distributive property.

What above simplifications am I missing?

1 Answers 1

1

It is $(y-XB)'=(y'-B'X')$

The order of $XB$ has to be interchanged when you transpose it.

Multiplying out the brackets of $(y'-B'X')(y-XB)$

$yy'-y'XB-B'X'y+B'X'XB$

$y'XB$ is a scalar. Thus $y'XB=B'X'y$

$yy'-2y'XB+B'X'XB$

Remark

Let $X$ be a $m\times n$ matrix and $B$ a $n\times 1$ vector. Then $X'B'$ wouldn´t work because $X'$ is a $n\times m$ matrix and $B'$ a $1\times n$ vector.

  • 0
    Thanks for the reply, I don't quite understand the scalar part. Why is it that $y'XB = B'X'y$? I get that they are both end up being 1x1, but what theorem makes them equal?2017-02-05
  • 1
    **Scalar part:** You have a product of transposed matrices. Thus the result is transposed as well. We have $(XB)'=B'X'$ and $XB$. It follows that the result of $B'X'$ is the transposed result of $XB$. And a transposed scalar is equal to the scalar.. **Next question**: You transpose $y'XB$. You interchange the order. $B$ comes first and gets transposed. $y'$ goes to the last position and gets transposed. And $X$ gets transposed and remain in the middle position.2017-02-05
  • 1
    For more information (with numerical example) for the transposed matrix product see here:http://www.web-formulas.com/Math_Formulas/Linear_Algebra_Properties_of_Transposes.aspx2017-02-05
  • 1
    Your are welcome and thanks for the acceptation. But I don´t know what do you mean by abc + .... + .... In matrix calculation the order matters in general.2017-02-05
  • 0
    Scratch my earlier comment, need to just calculate by hand to prove to myself the scalar result is the same. Edit #2: I completely get your point now about the two being the same. Re-read the transpose rule on product of matrices!2017-02-05
  • 1
    That´s a very good idea. Take a $1x2$ vector, $2x2$ matrix and a $2x1$ vector. Then you need not to caclulate to much. Ad Edit#2: That´s nice.2017-02-05