Your book has been awesome thus far! I came across a potential issue in your NormalPdf class, specifically when working with the example on adult female heights from the BRFSS dataset (page 76-77).
Per your code, the definition of the Density function looks to simply return the scipy.stats.norm.pdf() method. What I found was that running pdf.Density(mean + std) does not yield the same results as running the scipy.stats.norm.pdf() method.
Your book has been awesome thus far! I came across a potential issue in your NormalPdf class, specifically when working with the example on adult female heights from the BRFSS dataset (page 76-77).
Per your code, the definition of the Density function looks to simply return the
scipy.stats.norm.pdf()
method. What I found was that runningpdf.Density(mean + std)
does not yield the same results as running thescipy.stats.norm.pdf()
method.thinkstats2 Module
mean, var = 163, 52.8
std = math.sqrt(var)
pdf = thinkstats2.NormalPdf(mean, std)
pdf.Density(mean + std)
yields 0.0333001scipy.stats
scipy.stats.norm.pdf(mean + std)
yields 0.0Am I mistaken that both approaches are the same at the core?
Thanks!