Hessian Matrix

Gist

Looking to understand the curvature of a function? Useful for optimization because it gives us the local behavior

Definition

For a scalar-valued function, the Hessian matrix calculates the second partial derivative. It is a matrix of functions that should be evaluated at some points:

H=[2fx22fxy2fyx2fy2] 

Example

Let's say we have the equation below:

f(x,y)=3x2sin(y)

Let us calculate the first partial derivative with respect to x and y:

fx=6xsin(y)

and

fy=3x2cos(y)

Then we can take the derivative of fx with respect to x and y:

2fx2=6sin(y)2fxy=6xcos(y)

as well as with fy with respect to x and y:

2fyx=6xcos(y)

and

2fy2=3x2sin(y)

Therefore the Hessian matrix of f(x,y) is:

H=[6sin(y)6xcos(y)6xcos(y)3x2sin(y)] 

We then calculate the Determinant

How to interepret

Properties

  1. Symmetric

Usage

You can figure out if you’re at a maximum/minimum point by calculating the Hessian.

Though

The Hessian is generally not used for some optimizationmethod because of the computational intensity it takes to fill it and invert it.

For Maximum-likelihood

As we're trying to maximum the log-likelihood when estimating parameters wtih Maximum likelihood, it makes sense we use the Hessian matrix.

Additionally, the asymptomatic covariance matrix of the parameters is given by the inverse of the negative of the Hessian matrix.

The negative Hessian evaluated at the MLE is the same as the observed Fisher information matrix evaluated at the MLE.

Association with the Taylor Series

The Hessian matrix arises naturally in the second-order Taylor Series of a scalar function.

References