pymc-devs / pymc-experimental

https://pymc-experimental.readthedocs.io
Other
72 stars 46 forks source link

Support batched constant arguments when marginalising `DiscreteUniform` #290

Open zaxtax opened 6 months ago

zaxtax commented 6 months ago

Right now, models like the following fail:

    with MarginalModel() as m:
        mu = pm.DiscreteUniform("mu", lower=[0,10,20], upper=40)
        y = pm.Normal("y", mu=mu, sigma=1.0)
    m.marginalize([mu])

Since lower here takes all constant values, it should be possible to support this

ricardoV94 commented 6 months ago

We could take min, max which will work if only a bit inefficient if the intervals have little overlap.