Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable sampling of transformed variables from prior_predictive #5349

Closed
wants to merge 1 commit into from

Conversation

markvrma
Copy link
Contributor

What are the (breaking) changes that this PR makes?

removed the if statement that appends rv_var.name to names and rv_var to vars_to_sample

resolves #5076

@ricardoV94
Copy link
Member

Hi @markvrma thanks for opening the PR! These lines should also be updated:

pymc/pymc/sampling.py

Lines 2003 to 2006 in a823043

var_names : Iterable[str]
A list of names of variables for which to compute the posterior predictive
samples. Defaults to both observed and unobserved RVs. Transformed values
are not included unless explicitly defined in var_names.

And more importantly, SMC is relying on prior predictive to get a bunch of transformed samples here:

pymc/pymc/smc/smc.py

Lines 179 to 184 in e6fc2ec

return sample_prior_predictive(
self.draws,
var_names=[v.name for v in self.model.unobserved_value_vars],
model=self.model,
return_inferencedata=False,
)

That could will have to be refactored to make use of this function:

def make_initial_point_fn(
and calling it a bunch of times

@@ -2062,12 +2062,6 @@ def sample_prior_predictive(
names.append(name)
vars_to_sample.append(transformed_rv_var)

# If the user asked for the transformed variable in var_names, but not the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lines above are also related to this logic

@ricardoV94
Copy link
Member

Closing this PR due to inactivity. Feel free to reopen a new one anytime!

@ricardoV94 ricardoV94 closed this Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable sampling of transformed variables from prior_predictive
2 participants