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

sample_posterior_predictive produces wrongly shaped output #192

Closed
thomas-haslwanter opened this issue Jan 19, 2019 · 1 comment
Closed

Comments

@thomas-haslwanter
Copy link

The shape of pm.sample_posterior_predictive is wrong.
For example, the code

data = np.random.randn(100)
with pm.Model() as model:
    mu = pm.Normal('mu', mu=0, sd=1)
    sd = pm.HalfNormal('sd', sd=1)
    obs = pm.Normal('obs', mu=mu, sd=sd, observed=data)
    
    trace = pm.sample()
with model:
    post_pred = pm.sample_posterior_predictive(trace, samples=500, size=5)
post_pred['obs'].shape

produces

(500, 5, 100)

instead of the expected (500, 5)

@twiecki
Copy link
Member

twiecki commented Jan 19, 2019

You probably meant to open this here instead: https://github.com/pymc-devs/pymc3

@twiecki twiecki closed this as completed Jan 19, 2019
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

No branches or pull requests

2 participants