I'm trying to perform a minimisation where some parameters must sum to one using PyMinuit. I'm wondering if there is a standard method of implementing this kind of thing?
Is it usual to set the function to some large value if the constraint is not met? e.g.
def f(params):
if params.sum() != 1:
return 1e6
else:
... compute actual value ...
Is it a very bad idea to normalise the parameters each round? e.g.
if params.sum() != 1:
for param in params:
param = param / params.sum()
Thanks!