Corrections for juliadatascience book

It’s incredible what wrong definitions the authors of the juliadatascience give in their online book, accessible at: https://juliadatascience.io/.
There are so many scientists on this forum and no one has read what this book contains? I suggest to publish chapters online only after a review because the definitions I’ve just read in the chapter Distributions damage the image of Julia community.
https://juliadatascience.io/stats_dist
Example: Probability of an event is a set of numbers!!! :frowning:

The axioms of probability that follow this definition are also mind blowing. And the list is much longer…

Well, it clearly states that it is a work in progress. You could create issues or even pull requests in their repository if you want to invest the time.

https://github.com/JuliaDataScience/JuliaDataScience

11 Likes

The way we work in this book is by moving fast. We’ve set up the build of the book to be fully automatic, so for any PR, the build runs all the code and generates a PDF. Once the PR is merged, the website and PDF are updated in roughly 20 minutes. The statistics chapter that you seem to be referring to was added after someone suggested on Twitter that our data science book contained only data transformations and plotting. That was a fair point. So, after working with some great speed, the statistics chapter was added 2 weeks after the remark on Twitter.

Unfortunately, with great speed come mistakes. Like said above, you are very welcome to open a PR to our repository. Or, you can always tell us here, send us a PM via Slack, via Zulip or even a mail. Finally, you can just wait and it’s likely that it the issues are fixed in a few weeks.

I’ve opened an issue at the repository (https://github.com/JuliaDataScience/JuliaDataScience/issues/150).

17 Likes

@rikh With so many friends who like your high speed approach I can only wish you good luck. But beware that high speed can cause accidents.

I don’t get it. Most of probability textbooks defines probability from the axiomatic Kolmogorov definition and then anchors it on set theory.

For example, this is one of such:

(Daphne Koller- Probabilistic Graphical Models)

What different definition or notation would you use to define probability?

We used the following definition: " The probability of an event is a real number between 0 and 1, where 0 indicates the impossibility of the event and 1 indicates the certainty of the event ."

We would love to have different voices and opinions so we could build upon it to have better content.

@Storopoli The definition you state here is not identical to the excerpt posted by the op.

2 Likes

As I understand, the problem pointed out in the OP is that P(A) is described as being a set

6 Likes

The measure theory guys are going to get cross at the assertion that a probability of zero indicates impossibility… see eg here. BTW I think the book itself is a great idea!

3 Likes

No, it’s not only the statement that the probability of an event is a set. The definition of the probability that follows this statement, and many other, are confusing.
Since I received messages in my julia discourse inbox, asking why I manifest such an attitude,
and the author friends appreciated the arguments given by @rikh, I give here my arguments and the right Kolmogorov axioms, not in a PR or an issue opened on the book repo.
I stumbled upon a link to juliadatascience.io here on discourse. The first click was on the section Distribution. I didn’t know it is a work in progress. But even for a WIP the presentation must be clear, and correct, if it is already posted online, because it can be read by a lot of people. That’s why I posted that message on discourse.

I give here a link to a pdf, I edited as an answer: https://drive.google.com/file/d/1dOgOWk3kUKnYnpkuxMH2JAvR1AP7TuCJ/view?usp=sharing

If you have read the text in the above pdf file you can now compare with author axioms.

The image below illustrates how incorrect is their “axiom” stating that for any two mutually exclusive events, A, B, P(A)=1-P(B).
AcapBempty

Involving a probability density function in the definition of the probability (their third axiom) is totally unacceptable, because at that point we don’t know completely what a probability is, and much less a probability density. It’s a logical error.

As I said the list of unacceptable definitions in the section Distributions is much longer, but I consider that the authors must clarifies first, for themselves, all involved notions and present them in their own words.

6 Likes

Thank you. I think that you are completely right.

In the current form of what we call the Kolmogorov axioms, the possible events A_1, A_2, \dots are not explicitly said to have an empty intersect, so \Sigma_{n \in \mathbb{N}} P(A_n) could be higher than 1.

I also don’t see how the “additivity” axiom equals the third axiom (\sigma-additvity) from Kolmogorov.

I’ll hereby take responsibility to get this fixed before we print the final version. I won’t promise it’s gonna be perfect, but at least closer.

However, I’m don’t see why we should take it offline given the “But beware that high speed can cause accidents.” warning. If the text hadn’t been online, you wouldn’t have spotted our mistakes and we might have actually printed the book with the mistakes. I also don’t see how people could get hurt (accident) by our text. I’ll add a DRAFT footer to every page. Currently, that footer is only in the PDF.

Thank you again for taking the time to clarify the mistakes.

6 Likes

@rikh

I also don’t see how the “additivity” axiom equals the third axiom (
σ-additvity) from Kolmogorov.
They are not equivalent. I don’t understand the reason for which you given that additivity as an axiom.

However, I’m don’t see why we should take it offline given the “But beware that high speed can cause accidents.” warning.
A high speed approach can cause accidents is a metaphor. Let us say that a student who took a probability course this fall, reads your Kolmogorov axioms and use them in his mid term exam. Clearly this can cause an accident for him because he can fail that exam :frowning:
Generally it is supposed that someone who decided to author or co-author a book had a solid background in the book subject. If it shows a poor background his (their) book will not be read. That’s why it is recommended to post the text online only when you are sure that it doesn’t contain major mistakes.

Isn’t that what peer review is for? Testing on the target audience may not be optimal. Better sort out any mistakes, typos, etc. on a limited readership consisting of experts…

There is now a DRAFT note at the bottom of the page.

Fair point. Our idea was to be open about our book from the start. So, not being working in a private repository in secret only to come out into the daylight at some point. If you change your critique to “you should have advertised less”, then I can see your point.

You are hereby invited to become a peer reviewer.

Don’t get me wrong: I think the whole effort is admirable. But I have seen too many textbooks with serious mistakes not to feel strongly about exposing readers to questionable material. :wink:

Some points without further comment: Formula (9) and Axiom 2 as mentioned should be corrected, and then Axiom 3 too (that shouldn’t be a sum of “all possible events”). In formula (10) (the real numbers are not an element of the unit interval, and neither vice versa), in formula (12) pmf should have the argument x and perhaps be called p, in formula (13) a pdf is not equal to the probability of an interval. Formula (14) should use F as function symbol as usual and what was chosen in formula (12) as function symbol (e.g. p) should be used here in the sum. In Figure 14 the cdf of a dice throw is not a line but a step function or just some bars.

3 Likes

I recommend to the author of the section Distributions to take a look at the way the basic notions of probability are presented in this book: https://probability4datascience.com/

4 Likes

We refactored. Our target audience are not math enthusiasts.
Thanks for the feedback.

I did not recommend this book to follow its line, but at least to see the right definitions that were incorrect or confusing in the section Distributions.

That’s a nice resource, thanks for pointing it out. It looks like adding Julia code for the Matlab and Python examples would not be hard, and would be a nice project.

Thanks, I need to check that out, it’s funny how close the following picture is to what I have on my slides:

2 Likes