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

distribution_plotting.ipynb not longer working with latest pymc version #2

Open
tkanngiesser opened this issue Jan 4, 2023 · 1 comment

Comments

@tkanngiesser
Copy link


AttributeError Traceback (most recent call last)
in
----> 1 ax = pm.Normal.dist(mu=0, sigma=2).plot()

AttributeError: 'TensorVariable' object has no attribute 'plot'

@maxtheman
Copy link

Here's a quick thing I put together for a binomial distribution, it should be easy to adapt to a continuous variable.

samples = pm.draw(pm.Binomial.dist(n=6, p=0.2), draws=1000) x = np.arange(np.min(samples), np.max(samples)+1) plt.plot(x, np.exp(pm.logp(pm.Binomial.dist(n=6, p=0.2), x)).eval(), "-o")

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