fasiha / ebisu

Public-domain Python library for flashcard quiz scheduling using Bayesian statistics. (JavaScript, Java, Dart, and other ports available!)
https://fasiha.github.io/ebisu
The Unlicense
312 stars 32 forks source link

Typo in formula for Posterior(p|k,n) #39

Closed MarcelloNastri closed 3 years ago

MarcelloNastri commented 3 years ago

Where you say "Combining all these into one expression, we have:" the term \frac{1}{δ B(α, β)} should not be there as it is cancelled for appearing both on the numerator and the denominator via the Prior(p) = P(p) function.

Here's the P(p) function extracted from the text: P(p_t^δ) = \frac{p^{(α - δ)/δ} · (1-p^{1/δ})^{β-1}}{δ · B(α, β)}. (the small dot at the end of this equation is a typo in the code) You can note that \frac{1}{δ B(α, β)} is a constant and it works similarly to the \binom{n}{k} which appears both on the numerator and the denominator of the function Posterior(p|k,n) and, thus, gets cancelled out;

The original equation I noticed the typo is Posterior(p|k, n) = \frac{1}{δ B(α, β)} \frac{ p^{α/δ - 1} (1-p^{1/δ})^{β - 1} p^k (1-p)^{n-k} }{ \int_0^1 p^{α/δ - 1} (1-p^{1/δ})^{β - 1} p^k (1-p)^{n-k} \, dp }

fasiha commented 3 years ago

Yes!!! Thank you for noticing this and for taking time to tell me, I am so so so grateful! In #29, I made a quick note about a typo here but of course lost track of the specifics, and have been worrying about it since then. Fixed 🙇‍♂️!

(the small dot at the end of this equation is a typo in the code)

😄 I was taught to add punctuation at the end of equations a long time ago (example) but maybe this is not the best 😅