mml-book / mml-book.github.io

Companion webpage to the book "Mathematics For Machine Learning"
13.04k stars 2.41k forks source link

clarifying steps in 5.158 #656

Closed javismiles closed 3 years ago

javismiles commented 3 years ago

Good day and congratulations for a great book; in page 146, definition 5.8 (taylor polynomials for the multivariate case), when you show the example for K=2, step 5.158, you establish that the result would be the Hessian at x_0 multiplied by the delta squared which is the outer product of delta, therefore = Hessian x delta x delta_transposed

a) and then suddenly you make this equal to the "tr" of all of that (which I understand must refer to the trace), b) and then that allows you to change the position of delta_transposed, so that you get = delta_transposed x Hessian x delta

What is the reasoning behind a)? why can you suddenly add the trace operator there?

the other part b) makes sense give that as explained here: https://math.stackexchange.com/questions/293120/trace-of-a-matrix-times-outer-product we can do: tr(Sxx⊤)=x⊤Sx

so the question is about what is it that allows us to add the trace suddenly in a)

I appreciate very much any clarity regarding that specific step, thank you very much :)

mpd37 commented 3 years ago

all expressions follow the structure in (5.160), where we sum out all dimensions. In the 2-dimensional case, that would correspond to an inner product, which itself can be written as the trace of an outer product.

javismiles commented 3 years ago

thank you for clarifying @mpd37