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 #27

Closed alecshaw closed 2 years ago

alecshaw commented 2 years ago

1.4 Discrete random variables: An example using the binomial distribution https://vasishth.github.io/bayescogsci/book/sec-binomialcloze.html#sec:binomialcloze

For discrete random variables such as the binomial, the probability distribution p(y|θ) is called a probability mass function (PMF). The PMF defines the probability of each possible outcome. In the above example, with n=10 trials, there are 11 possible outcomes: y=0,1,2,...,10 successes. Which of these outcomes is most probable depends on the parameter θ in the vinomial distribution that represents the probability of success.

vinomial > binomial

Here, n represents the total number of trials, k the number of successes (this could range from 0 to 10), and θ the probability of success. The term (nk), pronounced n-choose-k, represents the number of ways in which one can choose k successes out of n trials. For example, 1 success out of 10 can occur in 10 possible ways: the very first trial could be a 1, the secone trial could be a 1, etc. The term (nk) expands to n!k!(n−k)!. In R, it is computed using the function choose(n,k), with n and k representing positive integer values.

secone > second

vasishth commented 2 years ago

fixed; thanks for catching these.

alecshaw commented 2 years ago

Thanks for making the fix. Would you prefer that further typos be filed under a new issue or would you like to reopen this issue?

https://vasishth.github.io/bayescogsci/book/sec-binomialcloze.html#generate-simulated-data-from-a-mathitbinomialntheta-distribution

As mentioned earlier, if there is only one trial, then instead of the binomial distribution, we have a Bernoulli distribution. For example, if we have 10 observations from a Bernoulli distribution, where the probability of success if 0.5, we can simulate data as follows using the function rbern from the package extraDistr.

if > is

vasishth commented 2 years ago

Thanks; this is also fixed now. You can open new issues for each typo/mistake. I will react to it either way :).

I've added your name to the acknowledgements. Thanks again for catching these mistakes, much appreciated.

If there is anything that is unclear, don't hesitate to post a complaint, I/we will try to make things clearer.