pm.Multinomial gives Sampling Error

@gms101 That’s definitely a bug, I opened an issue on the PyMC repository: Multinomial moment produces invalid values for some parameters · Issue #6233 · pymc-devs/pymc · GitHub

In the meantime you can tell PyMC to use a sample from the prior as the initval to avoid the error (or pass a valid numerial initval manually):

import pymc as pm

with pm.Model() as m:
  p = [0.1441,0.1363,0.1385,0.1348,0.1521,0.1500,0.1442]
  x = pm.Multinomial("x", n=[2, 6, 4], p=p, initval="prior")
1 Like