Skip to content

sample_posterior_predictive wrongly considers Deterministic variables as source of volatility #7183

Open
@ricardoV94

Description

@ricardoV94

Description

As shown in one of the new examples in #7014

import pymc as pm

with pm.Model() as model:
    x = pm.Normal("x")
    y = pm.Normal("y")
    det_xy = pm.Deterministic("det_xy", x + y ** 2)
    z = pm.Normal("z", det_xy)
    det_z = pm.Deterministic("det_z", pm.math.exp(z))
    obs = pm.Normal("obs", det_z, 1, observed=[20])

    idata = pm.sample(tune=10, draws=10, chains=2)

    pm.sample_posterior_predictive(idata, var_names=["det_xy", "det_z"])
    # Sampling: [z]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions