# Thread: how to multiply out "transpose"?

1. ## how to multiply out "transpose"?

Hi

I am really confused with the "transpose" related stuff.

Can anyone work me through it?

and the paritial differentiation with respect to it

===========================
why is

$\displaystyle (Y-X\beta)^T(Y-X\beta)=Y^TY-2\beta^TX^TY^T+\beta^TX^TX\beta$

$\displaystyle (Y-X\beta)^T(Y-X\beta) =(Y^T-\beta^TX^T)(Y-X\beta) =Y^TY-Y^TX\beta-\beta^TX^TY+\beta^TX^TX\beta$

and differentiate with respect to beta is

$\displaystyle =-2X^TY+X^TX\beta$

2. Originally Posted by casperyc
Hi

I am really confused with the "transpose" related stuff.

Can anyone work me through it?

and the paritial differentiation with respect to it
If we are working with matrices, how do we know beta and beta hat commute? Or are we working with vector? What is beta?

$\displaystyle (\hat{\beta}-\beta)(\hat{\beta}^T-\beta^T)=\hat{\beta}\hat{\beta}^T-\hat{\beta}\beta^T-\beta\hat{\beta}^T+\beta\beta^T$

3. Originally Posted by dwsmith
If we are working with matrices, how do we know beta and beta hat commute? Or are we working with vector? What is beta?

$\displaystyle (\hat{\beta}-\beta)(\hat{\beta}^T-\beta^T)=\hat{\beta}\hat{\beta}^T-\hat{\beta}\beta^T-\beta\hat{\beta}^T+\beta\beta^T$
Hi there,

I think what you have writtern is pretty obvious going to give me my answer.

So, my actual problem is dont understand the order of the multiplication,

say$\displaystyle (A-B)(A^T-B^T)$

what I would do is

$\displaystyle (A-B)(A^T-B^T)=A A^T - AB^T - B A^T + BB^T$

which give me a different 'middle' term...

$\displaystyle \beta$ is just a vector

and if you could see the second pic (which is just next to it)
it confuses me more....

4. Originally Posted by casperyc
Hi there,

I think what you have writtern is pretty obvious going to give me my answer.

So, my actual problem is dont understand the order of the multiplication,

say$\displaystyle (A-B)(A^T-B^T)$

what I would do is

$\displaystyle (A-B)(A^T-B^T)=A A^T - AB^T - B A^T + BB^T$

which give me a different 'middle' term...

$\displaystyle \beta$ is just a vector
Your multiplication is correct. You will receive two different middle terms. If we can show the terms commute, we could combine them.

5. If beta is a vector, $\displaystyle \beta\hat{\beta}^T$ is inner product.

6. Originally Posted by dwsmith
If beta is a vector, $\displaystyle \beta\hat{\beta}^T$ is inner product.

Thanks.
I will think it through

Then what about the differentiation thing?
(which I have typed it out in the post)

7. Are the Xs and Ys matrices?

8. Originally Posted by dwsmith
Are the Xs and Ys matrices?
just suppose

$\displaystyle y=n \times 1$

$\displaystyle X=n \times p$

$\displaystyle \beta=p \times 1$

9. Originally Posted by dwsmith
If we are working with matrices, how do we know beta and beta hat commute? Or are we working with vector? What is beta?

$\displaystyle (\hat{\beta}-\beta)(\hat{\beta}^T-\beta^T)=\hat{\beta}\hat{\beta}^T-\hat{\beta}\beta^T-\beta\hat{\beta}^T+\beta\beta^T$
Since these are vectors and we are dealing with inner product, $\displaystyle (\hat{\beta}-\beta)(\hat{\beta}^T-\beta^T)=\hat{\beta}\hat{\beta}^T-\hat{\beta}\beta^T-\beta\hat{\beta}^T+\beta\beta^T=\hat{\beta}\hat{\b eta}^T-2\hat{\beta}\beta^T+\beta\beta^T$

10. If in the second problem if beta is a scalar and X and Y are vectors, the quantity will simplify down to $\displaystyle Y^TY-2Y^TX\beta+X^TX\beta$