Skip to content

API proposal: Add sample_all() #5299

@twiecki

Description

@twiecki

All the good Bayesians who are following the proper Bayesian workflow are writing things like:

with model:
    idata = pm.sample()
    idata.extend(pm.sample_prior_predictive())
    idata.extend(pm.sample_posterior_predictive(idata_simple))

these days. Besides this syntax not being that pretty because of the extend, it's also verbose. So how about instead we have a pm.sample_all() that returns an InferenceData with posterior, prior, prior predictive, and posterior predictive, all in one command?

I think that would also help enforce best practices and make it much simpler, especially for beginners to do The Right Thing.

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