pyhf icon indicating copy to clipboard operation
pyhf copied to clipboard

par_order vs parameters in model config

Open alexander-held opened this issue 5 years ago • 2 comments

Question

What is the difference between

pyhf.Workspace(...).model().config.par_order

and

pyhf.Workspace(...).model().config.parameters

?

It seems par_order is the order the parameters appear in the workspace, while parameters is in alphabetic order.

Is the order in parameters needed somewhere? The order visible to the minimizer seems to also be par_order. If this is the only relevant order to the outside, maybe parameters could not be part of the public API?

Relevant Issues and Pull Requests

maybe #547

alexander-held avatar Aug 11 '20 09:08 alexander-held

I noticed that the order in which auxdata is specified in Workspace(...).data(...), given by

pyhf.Workspace(...).model().auxdata_order

is different from config.par_order (which is the order of parameters for fits), but seems to match the config.parameters order (with the difference that of course there is no auxdata for every parameter).

I guess this may answer the original question for what the config.parameters order is used for. As a follow-up question, could these orders be harmonized? I see a potential risk that ordering them the same way leads to confusions of auxdata vs parameters, but it seems like it could be nice for consistency.

alexander-held avatar Nov 18 '20 13:11 alexander-held

With par_order now being alphabetically ordered in pyhf 0.7, is there any reason left for having .parameters in the API?

alexander-held avatar Sep 25 '22 16:09 alexander-held