diff --git a/cosmosis/samplers/maxlike/maxlike_sampler.py b/cosmosis/samplers/maxlike/maxlike_sampler.py index a8d1290c..d11754d9 100755 --- a/cosmosis/samplers/maxlike/maxlike_sampler.py +++ b/cosmosis/samplers/maxlike/maxlike_sampler.py @@ -144,6 +144,10 @@ def run_optimizer(self, inputs): } optimizer_result = pybobyqa.solve(likefn, start_vector, **kw) opt_norm = optimizer_result.x + # bobyqa calls it .hessian but scipy calls it .hess, so copy it here + # if available + if optimizer_result.hessian is not None: + optimizer_result.hess = optimizer_result.hessian else: # Use scipy mainimizer instead optimizer_result = scipy.optimize.minimize(likefn, start_vector, method=self.method,