I'm not sure how you apply the rules of a derivative on a quadratic form. I've been trying to find the solution on google but no luck:(adsbygoogle = window.adsbygoogle || []).push({});

Basicallly:

[tex]J=\frac{1}{2} (z-X \theta)^T (z-X \theta)[/tex]

and

[tex]\frac{ \partial J}{\partial \theta}= -X^T z +X^TX\theta[/tex]

I cant for the life of me figure out how they got from the upper equation to the lower equation. The reason is that the transpose is really screwing things up in terms of the deriatives. There is some rule being applied to matrix differentiation of a transpose of a quadratic form that I am ignorant of, which wont let me get to the same expression on the second line.......

Every time I try to expand the top line out I end up with 2*cross product term that doesnt drop out, but is clearly not shown in the second line.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Cost Function

**Physics Forums | Science Articles, Homework Help, Discussion**