how do I calculate Hessian of this function?

272 Views Asked by At

I have a function $f(x) = (\mathbf x ^ \top \mathbf x) ^ {p/2}$.

Its gradient is $\nabla f(x) = 2p (\mathbf x ^ \top \mathbf x) ^ {(p-2)/2} \mathbf x$

How do I compute its Hessian $\nabla^2f(x) $? Should I use product rule? Can someone show me how to do it or refer me to some resource?

Thanks

1

There are 1 best solutions below

1
On

Let's do it with indexes: $$ \frac{\partial^2}{\partial x_i \partial x_j} \left( x_k x_k \right)^{p/2} = \frac{\partial}{\partial x_i} \left\{ p \left( x_k x_k \right)^{p/2-1} x_j \right\} = p \left( x_k x_k \right)^{p/2-1} \delta_{i,j} - p(p-2) \left( x_k x_k \right)^{p/2-2} x_i x_j $$ Now rewriting this in coordinate free notations: $$ \nabla \otimes \nabla f(x) = p \left( x^\top x \right)^{p/2-1} \mathbb{I} - p(p-2) \left( x^\top x \right)^{p/2-2} x \otimes x^\top $$