mml-book / mml-book.github.io

Companion webpage to the book "Mathematics For Machine Learning"
12.71k stars 2.36k forks source link

Confusing notation #736

Open tteodorescu0 opened 1 year ago

tteodorescu0 commented 1 year ago

Location

  1. version: Draft (2022-01-11)
  2. chapter: 6
  3. page: 218
  4. line number/equation number: 6.138 through 6.143, pasted below for convenience
Screenshot 2023-01-16 at 9 28 11 PM

Describe the mistakes

  1. In 6.139, the notation $f$ appears in both the left and the right sides of the equation, but they represent two different functions. The $f$ in the left hand side of the equation is $f_Y$, the pdf of $Y=U(X)$, while the $f$ in the right side of the equation is $f_X$, the pdf of $X$. It's confusing to denote different functions using the same label.
  2. Also in 6.139, note that the middle term should be $\frac{d}{dy}F_Y(y)$, where the subscript of $F$ should be $Y$ instead of $y$.
  3. In 6.141, there are two different $y$ used. As shown in the equation below, the red ${\color{red} y}$ is different than the blue ${\color{blue} y}$, where the red ${\color{red} y}$ is the $y$ in 6.139 and the blue ${\color{blue} y}$ is the $y$ in the substitution in 6.140.

$$f({\color{red} y})=\frac{d}{d{\color{red} y}} \int_a^{U^{-1}({\color{red} y})} f_x(U^{-1}({\color{blue} y})) {U^{-1}}'({\color{blue} y}) d{\color{blue} y}$$

  1. Also in 6.141, the lower and upper bounds in the definite integral are wrong. See the correct bounds below.

$$f({\color{red} y})=\frac{d}{d{\color{red} y}} \int_{U(a)}^{\color{red} y} f_x(U^{-1}({\color{blue} y})) {U^{-1}}'({\color{blue} y}) d{\color{blue} y}$$

  1. The first sentence in the paragraph after 6.141 is wrong. Obviously $f_x(U^{-1}(y))$ is a function of $y$ unlike what is stated there. I believe the intention is to make a distinction between $f_Y$ and $f_X$, but that's not what the sentence actually says.
  2. In 6.142 and 6.143 (and also in 6.144 on the next page), there is the same issue with $f$ denoting different functions.

Proposed solutions

  1. Before 6.138, clarify that the pdf of $X$ is denoted $f_X$, that the pdf of $Y$ is denoted $f_Y$, that these are two different functions, and that we are trying to obtain a formula for $f_Y$ in terms of $f_X$.

  2. Revise 6.138 as follows. $$F_Y(y)=\int_a^{U^{-1}(y)} f_X(x) dx$$

  3. Revise 6.139 as follows. $$f_Y(y)=\frac{d}{dy}F_Y(y)= \frac{d}{dy} \int_a^{U^{-1}(y)} f_X(x) dx$$

  4. Revise 6.140 as follows. $$\int f_X(U^{-1}(z)) {U^{-1}}'(z) dz= \int f_X(x) dx \ \ \mathrm{where} \ \ x=U^{-1}(z)$$

  5. Replace 6.141 as follows. $$fY(y)=\frac{d}{dy} \int{U(a)}^y f_X(U^{-1}(z)) {U^{-1}}'(z) dz$$

  6. Delete the first sentence in the paragraph that follows 6.141.

  7. Replace 6.142 as follows. Note the middle term that was added.

$$f_Y(y)= f_X(U^{-1}(y)) {U^{-1}}'(y) = f_X(U^{-1}(y)) \cdot (\frac{d}{dy} U^{-1}(y))$$

  1. Replace 6.143 as follows. $$f_Y(y)= f_X(U^{-1}(y)) \cdot | \frac{d}{dy} U^{-1}(y) |$$

  2. Replace 6.144 as follows.

$$f_Y(y)= f_X(U^{-1}(y)) \cdot | \det(\frac{d}{dy} U^{-1}(y)) |$$