1

I have tried to set limits on parameters using iminuit with the example code:

import iminuit

def func(x,y):
  fun = 2*x**2 + 3*y + 5
  return fun

m = iminuit.Minuit(func, x=1, y=1, limit_x=(0,100), limit_y=(0,50))

What I get is the error message

/usr/local/lib/python3.6/dist-packages/iminuit/minuit.py in _make_init_state(pos2var, args, kwds)
   1537             if kw not in pos2var:
   1538                 raise RuntimeError(
-> 1539                     f"{kw} is not one of the parameters [{' '.join(pos2var)}]"
   1540                 )
   1541         nargs = len(kwds)

RuntimeError: limit_x is not one of the parameters [x y]

It is weird because the documentation shows the inclusion of limits in this way.

I am particularly interested in a minimization of a more complex function, with 6 or more parameters and it is important to specify the parameter space of 2 of them.

Marcos
  • 57
  • 5
  • 1
    I don't see where they mention setting limits that way. I do see that they mention setting them like `m = iminuit.Minuit(func, x=1, y=1)` and then `m.limits['x'] = (0,100)` and `m.limits['y'] = (0,50)`. – Axe319 Feb 12 '21 at 19:33
  • Thanks @Axe319, it solved the problem! – Marcos Feb 16 '21 at 13:05

0 Answers0