Calculating the Hessian

87 Views Asked by At

I am working with a cost function:

\begin{eqnarray} (W^t\mathbf{p} - \boldsymbol\pi )^t \Lambda (W^t\mathbf{p} - \boldsymbol\pi) \end{eqnarray}

where $\mathbf{p} = \dfrac{1}{1+\exp \left[-\mathbf{X}\boldsymbol{\beta}\right]}$.

I calculated the gradient (with respect to $\boldsymbol{\beta}$) for this function to be

\begin{eqnarray} \nabla = 2\left(W\Lambda W^t\mathbf{p} - W\Lambda\pi\right)\dfrac{\partial\mathbf{p}}{\partial\boldsymbol\beta} \end{eqnarray}

...and I am stuck trying to calculate the Hessian (again, with respect to $\boldsymbol{\beta}$). Any hints?