pymc-experimental icon indicating copy to clipboard operation
pymc-experimental copied to clipboard

`MarginalModel.unmarginalize` doesn't accept `var_names`

Open ricardoV94 opened this issue 1 year ago • 2 comments

import pymc as pm
from pymc_experimental import MarginalModel

with MarginalModel() as m:
    x = pm.Bernoulli("x", p=0.5)
    y = pm.Normal("y", x)
    
m.marginalize(["x"])
m.unmarginalize(["x"])  # ValueError: list.remove(x): x not in list

m.unmarginalize([x]) is fine, but this is problematic because x may not be accessible to the caller

CC @zaxtax

ricardoV94 avatar Feb 14 '24 17:02 ricardoV94

Maybe by default m.unmarginalize() could also unmarginalize all marginalized_rvs

ricardoV94 avatar Feb 14 '24 17:02 ricardoV94

These are both good ideas

On Wed, 14 Feb 2024, 18:07 Ricardo Vieira, @.***> wrote:

Maybe by default m.unmarginalize() could also unmarginalize all marginalized_rvs

— Reply to this email directly, view it on GitHub https://github.com/pymc-devs/pymc-experimental/issues/309#issuecomment-1944251868, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACCUJ74TBBBVTV6EZA6LDYTTVO3AVCNFSM6AAAAABDIUTBZGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBUGI2TCOBWHA . You are receiving this because you were mentioned.Message ID: @.***>

zaxtax avatar Feb 14 '24 19:02 zaxtax