Constrain on parameters for Negative Log Likelihood Minimization

208 Views Asked by At

I am trying to fit a 5 parameter (a, b, c, d, e) model, where one of the parameters is constrained by another, let's say,

0< d < 1

e < |d|

I am currently using zfit which as far as I know, uses iMinuit

I have only created the zfit.Parameters and put the limits such that the ranges accessible to them are valid, again, let's say:

d = zfit.Parameter('d', value=0.5, lower_limit=0.3, upper_limit=1.0, step_size=0.01)

e = zfit.Parameter('e', value=0.1, lower_limit=0.0, upper_limit=0.3, step_size=0.01)

It has been working well so far, but I think it is not the right way to do it.

So my question is, what is the correct way to deal with this kind of constraint?

Cheers

1

There are 1 best solutions below

3
On BEST ANSWER

I would use this limits with caution, as they block the variables, ideally, they should be far off the final value.

There are two ways to achieve what you want:

  • either impose a constraint "mathematically" as a logical consequence, so define one parameter from another using a composed parameter (which is a function of other parameters). If possible, this should be the preferred way.
  • Another option is to impose this restrictions in the likelihood with an additional term. This, however, can have repercussions as you modify the likelihood. The minimizer will find a minimum, but this is maybe not the minimum you have looked for. What you can use are SimpleConstraints and add a penalty term to the likelihood if any of the above is violated (e.g. tf.cast(tf.greater(d, 1), tf.float64) * 100.). Maybe make also sure that minuit is run with use_minuit_grad.