8 Aug 09:31 2014

### Calculation of a hessian

Kiko <kikocorreoso <at> gmail.com>

2014-08-08 07:31:59 GMT

2014-08-08 07:31:59 GMT

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.

_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion <at> scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion