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.51k stars 7.84k forks source link

Chapter 2 Normal Distribution #462

Open MinTTT opened 5 years ago

MinTTT commented 5 years ago

Hello, I'm a newbie of Bayesian statistics, thanks for authors' awesome work. I found the demo code of Normal Distribution may have a problem. the scipy.stats function norm has a keyword scale, and it is defined as the standard deviation. As mentioned in the description, $1/ \tau$ is equal to $\sigma^2$. Thus, the code in row 11 shall be plt.plot(x, nor.pdf(x, _mu, scale=np.sqrt(1./_tau)),, if I didn't miss anything.