Partsworth estimation causes "bad energy" warning on some observations

Hi Daniel! It’s difficult to be categorical (pun intended) without the data, but just to check:

  • Are you sure there are no Nans in your observations (the stuff you give to observed in pm.Categorical)?
  • Are you sure your observations are all integers? Otherwise, I think Categorical will complain
  • If your observations are aggregated (i.e multinomial), are there zeros in it? Same here: Multinomial won’t like it
  • Finally, maybe try:
pm.Multinomial(f"Obs_selection.name", n=1, p=softmax,
               observed=selection[nan_mask.values].values)

instead of pm.Categorical(bla bla bla). I remember Categorical was misbehaving – it is fixed now but I don’t remember if it’s already released or still on master.