Search code examples
pythonzfit

How can I fix a parameter on creation in zfit?


I want to perform several fits with multiple parameters, some of the which are fixed in the first fit. How can I define a parameter that is not floating and how to change that? Creating without limits does not seem to make it fixed.


Solution

  • To create a parameter that is fixed (but can be made floating), you can specify floating as False:

    param = zfit.Parameter('param', 1, 0, 2, floating=False)
    

    In order to make it floating later on, use the attribute floating:

    param.floating = True