CamDavidsonPilon / Probabilistic-Programming-and-Bayesian-Methods-for-Hackers

aka "Bayesian Methods for Hackers": An introduction to Bayesian methods + probabilistic programming with a computation/understanding-first, mathematics-second point of view. All in pure Python ;)
http://camdavidsonpilon.github.io/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/
MIT License
26.71k stars 7.88k forks source link

In "Ch2_MorePyMC_PyMC3" under "Including observations in the Model" section #514

Open doh-wrong-button opened 3 years ago

doh-wrong-button commented 3 years ago

This fixes 'normed' (which is deprecated) to 'density'. PS: I am a complete nooooob. If this is incorrect, I apologize. It worked for me :)....Thanks, signed your loving son, Homer

%matplotlib inline from IPython.core.pylabtools import figsize import matplotlib.pyplot as plt import scipy.stats as stats figsize(12.5, 4)

samples = lambda1.random(size=20000) #plt.hist(samples, bins=70, normed=True, histtype="stepfilled") normed is deprecated (old #code) #density performs the same as normed (new code below)_ plt.hist(samples, bins=70, density=True, histtype="stepfilled") plt.title("Prior distribution for $\lambda_1$") plt.xlim(0, 8);