1. Matrix differentiation

I've never done matrix differentiation before, and I want to differentiate this:

$(Y-X\theta)^{T}(Y-X\theta)$ with respect to $\theta$. I'm told that, using the product rule, we get:

$2X^{T}(Y-X\theta)$.

(In the above, X, Y and $\theta$ are all column matrices). Can someone very quickly run through this for me please? Thanks.

2. Originally Posted by Amanda1990
I've never done matrix differentiation before, and I want to differentiate this:

$(Y-X\theta)^{T}(Y-X\theta)$ with respect to $\theta$. I'm told that, using the product rule, we get:

$2X^{T}(Y-X\theta)$.

(In the above, X, Y and $\theta$ are all column matrices). Can someone very quickly run through this for me please? Thanks.
they can't be all column matrices because then $X \theta$ wouldn't be defined. post the correct version of your problem if you still want to get help.

3. Yes, sorry. What I meant to say was that Y is an n x 1 column vector, X is an n x 2 matrix and $\theta$ is a 2 x 1 matrix.

(Although I think the idea is the same if X is just a n x p matrix and $\theta$ is a p x 1 matrix for a general p).