Hi all,

I am trying to calculate a Hessian. I am using numdifftools for this (https://pypi.python.org/pypi/Numdifftools).

My question is, is it possible to make it using pure numpy?.

The actual code is like this:

import numdifftools as nd
import numpy as np

def log_likelihood(params):
    sum1 = 0; sum2 = 0
    mu = params[0]; sigma = params[1]; xi = params[2]
    for z in data:
        x = 1 + xi * ((z-mu)/sigma)
        sum1 += np.log(x)
        sum2 += x**(-1.0/xi)
    return -((-len(data) * np.log(sigma)) - (1 + 1/xi)*sum1 - sum2) # negated so we can use 'minimum'

kk = nd.Hessian(log_likelihood)

Thanks in advance.