5
$\begingroup$

I wonder, if someone could help to understand a formula from a book please.

Bayesian Methods for Hackers: Probabilistic Programming and Bayesian Inference (Addison-Wesley Data & Analytics) (Addison-Wesley Data & Analytics) by Cameron Davidson-Pilon Davidson-Pilon

See also this.

This is the formula:

enter image description here

I am not 100% sure what N and S is. Let us say there are 2 ratings. 1 for star 4 and 1 for star 5. Would N = 2 (2 ratings/votes/users) and S = 4 + 5 = 9?

Thanks!

PS:

I think this is related to this, which I am sorry goes right over my head.

$\endgroup$
4
  • $\begingroup$ The quotation is explicit: it tells you $N$ is the number of possible stars in the rating system and "$S$ is the sum of all the ratings." $\endgroup$
    – whuber
    Commented Mar 3, 2022 at 17:18
  • 1
    $\begingroup$ @whuber In the passage, N is used with two different meanings. It’s the latter that should be used, but yes, it’s explicit. $\endgroup$ Commented Mar 3, 2022 at 17:19
  • 2
    $\begingroup$ @Arya Excellent point: I overlooked the switch in meanings. (One doesn't expect to see a variable that is introduced early in a paragraph to be completely redefined by the end!) I continue to lament the almost complete absence of real editorial review in publications during the last generation. $\endgroup$
    – whuber
    Commented Mar 3, 2022 at 17:22
  • $\begingroup$ Guess this confuses me. So using my simple example, what do you think would be N and S? $\endgroup$
    – cs0815
    Commented Mar 3, 2022 at 17:23

1 Answer 1

12
$\begingroup$

This is sloppy writing, and the author should be embarrassed :)

$N$ is the total number of ratings, and $S$ is the sum of "scores". Scores can be 1 or 0 (as in a binary voting system), or fractional (as in a star-rating system). I made a poor choice of variable names, and should have said:

An M-star rating system can be seen as a more continuous version of the preceding, and we can set $m$ stars rewarded as equivalent a score of $\frac{m}{M}$

In your example: observing a rating 4 and a rating 5 (assuming that $M=5$ stars is the best possible score). Then $N=2$, and $S = \frac{4}{5} + \frac{5}{5}$.

$\endgroup$
5
  • 7
    $\begingroup$ +1. I wish to reiterate that I attribute such lapses to editors, not to authors. After you have written something it becomes extremely difficult to read it as it is on the paper instead of as you originally intended it. That's why we need and value good editors! $\endgroup$
    – whuber
    Commented Mar 3, 2022 at 18:17
  • 2
    $\begingroup$ Thanks so much @Cam.Davidson.Pilon - an answer from the author himself (-: $\endgroup$
    – cs0815
    Commented Mar 3, 2022 at 18:28
  • $\begingroup$ Sorry one more example 3 users. 2 vote 4 and 5. This means N=3 and S=(2*(4/5)) + (1*(5/5))? Thanks. $\endgroup$
    – cs0815
    Commented Mar 3, 2022 at 18:32
  • 1
    $\begingroup$ @cs0815 yup that's correct $\endgroup$ Commented Mar 3, 2022 at 18:41
  • 3
    $\begingroup$ @whuber, I absolutely agree. I've read this paragraph many times, and never once caught this haha $\endgroup$ Commented Mar 3, 2022 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.