Skip to content

Disable sampling of transformed variables from prior_predictive #5076

Closed
@ricardoV94

Description

@ricardoV94

This was added to facilitate sampling from the prior as a starting point for SMC, but with the new functions added in #4983 this is no longer needed.

pymc/pymc3/sampling.py

Lines 1983 to 1999 in 6d2aa5d

# Any variables from var_names that are missing must be transformed variables.
# Misspelled variables would have raised a KeyError above.
missing_names = vars_.difference(names)
for name in missing_names:
transformed_value_var = model[name]
rv_var = model.values_to_rvs[transformed_value_var]
transform = transformed_value_var.tag.transform
transformed_rv_var = transform.forward(rv_var, rv_var)
names.append(name)
vars_to_sample.append(transformed_rv_var)
# If the user asked for the transformed variable in var_names, but not the
# original RV, we add it manually here
if rv_var.name not in names:
names.append(rv_var.name)
vars_to_sample.append(rv_var)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions