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

draw_values not generating samples from joint distribution with HalfNormal or Bound(Normal) #3685

Closed
adrn opened this issue Nov 19, 2019 · 1 comment · Fixed by #3686
Closed

Comments

@adrn
Copy link
Contributor

adrn commented Nov 19, 2019

Description of your problem

draw_values() does not draw from the joint distribution for HalfNormal, or Bound'ed Normal distributions.

My understanding of #3273 is that draw_values() should now properly generate samples in joint distributions instead of the individual marginals. This works for, e.g., Normal, but doesn't seem to work for a Bound(Normal), or for HalfNormal, as demonstrated in this notebook: https://gist.github.com/f4269724588b4bfbe4ae597cf5c6d39a

Versions and main components

  • PyMC3 Version: 3.7
  • Theano Version: 1.0.7
  • Python Version: 3.7.3
  • Operating system: macOS
  • How did you install PyMC3: pip
@ColCarroll
Copy link
Member

I'll dig in more, but just want to verify I can reproduce. Also, problem persists with sample_prior_predictive, but sample works fine still (thank goodness).

with pm.Model() as model:
    P = pm.Uniform('P', 1, 100)
    sigma_e = pm.Deterministic('sigma_e', 1/P)
    e = pm.HalfNormal('e', sigma=sigma_e)
    prior = pm.sample_prior_predictive(100_000)
    trace = pm.sample(25_000)

az.plot_joint(prior, var_names=['P', 'e'], joint_kwargs=dict(s=1));

image

az.plot_joint(trace, var_names=['P', 'e'], joint_kwargs=dict(s=1));

image

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 a pull request may close this issue.

2 participants