vasishth / bayescogsci

Draft of book entitled An Introduction to Bayesian Data Analysis for Cognitive Science by Nicenboim, Schad, Vasishth
100 stars 27 forks source link

Typos in section 2.2 #30

Closed jhaeberl closed 1 year ago

jhaeberl commented 2 years ago

In 2.2, the following code yields 0.125 which is in fact smaller than 0.137 obtained when using theta = 0.8, not larger as claimed in the text.

theta <- runif(100, min=0.7, max=0.9) estimated_means <- rbinom(n=100, size=10, prob=theta)/10 sd(estimated_means)

At the bottom of section 2.2.3 it should be B(84,24) , not B(83,23).

vasishth commented 1 year ago

Corrected, many thanks!

CGMoreh commented 1 year ago

I think the issue with describing the sd=0.125 in section 2.2 is still there ("... but not as small as when we assumed that θ was a point value ...")

vasishth commented 1 year ago

Thanks for catching these mistakes. I have rewritten the section like this:

The higher standard deviation is now coming from the uncertainty associated with the $\theta$ parameter. To see this, assume a "tighter" PDF for $\theta$, say $\theta \sim \mathit{Uniform}(0.3,0.8)$, then the variability in the estimated means would again be smaller, but not as small as when we assumed that $\theta$ was a point value:

theta<-runif(100,min=0.3,max=0.8)
estimated_means<-rbinom(n=100,size=10,prob=theta)/10
sd(estimated_means)

In other words, the greater the uncertainty associated with the parameter $\theta$, the greater the variability in the data.

I have now also corrected the end of section 2.2.3.