Minuit2 contours with parameter limits

I’m trying to produce contour maps for some parameters with limits, and Minuit2 seems intent on drifting into regions outside of the limits.

Is this a known issue? Is there a workaround?

[code]>>> from minuit2 import Minuit2

def f(x,y):
… if x < 0 or y < 0:
… print ‘x = %.2f, y = %.2f’ % (x,y)
… raise Exception
… return x2 + y2

m = Minuit2(f)
m.limits[‘x’] = 0, 10
m.limits[‘y’] = 0, 10
m.migrad()
xy = m.contour(‘x’,‘y’,3)
Info in : MnMinos UP value has changed, need to update FunctionMinimum class
x = -9.95, y = 0.00
Traceback (most recent call last):
File “”, line 1, in
File “”, line 4, in f
Exception[/code]

Hi,

Which version of Minuit2 are you using, it looks to me you are using some Python wrapper, which I do not have.
Can you post if possible an example of this in C++ code ?

Thank you

Lorenzo