Conditional fits with fixed non-POI parameters #1603
-
I've got a question which feels like it should very simple, but I can't seem to find any indication of how to do it in the documentation. I've got a likelihood model with a pretty common structure: some yields in bins from different sources, which each have a few modifiers attached. These represent systematic NPs or unconstrained normalization parameters in the fit, etc. I want to run a simple MLE fit holding some of these parameters fixed at values that I specify at the python level (and allowing all the others to vary as usual). I know that there's a dedicated function that does this holding the POI fixed, but I want to fix other parameters. I'd be surprised if the python API doesn't support this, but I can't seem to find it documented anywhere. Does anyone know how to do this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The |
Beta Was this translation helpful? Give feedback.
The
infer.mle.fit
API takes a list of initial parameter values and a list of booleans to denote whether a given parameter is meant to be held constant. If it is set to constant, it will take the initial parameter value. So you can usemodel.config.par_names
to identify the position in the list of parameters that a given parameter you want to hold constant is located at, then usemodel.config.suggested_init()
andmodel.config.suggested_fixed()
to get the default settings for initial values / fixed parameters, edit these lists as desired (parameter order matchesmodel.config.par_names
), and pass the new lists toinfer.mle.fit
while using theinit_pars
andfixed_params
keyword arguments.