mml-book / mml-book.github.io

Companion webpage to the book "Mathematics For Machine Learning"
13.04k stars 2.41k forks source link

Basis change direction mistake #638

Open AlbertoGuastalla opened 3 years ago

AlbertoGuastalla commented 3 years ago

From the book: Approach 1 To get started with the linear algebra approach, we identify both {b1, b2} and {c1, c2} as bases of R2 (see Section 2.6.1 for a recap). What we effectively perform is a change of basis from (b1, b2) to (c1, c2), and we are looking for the transformation matrix that implements the basis change.

Same error in Approach 2.

I'm not sure the the basis change is from (b1, b2) to (c1, c2) but for me is from (c1, c2) to (b1, b2) as reported in the basis change matrix J.

Location version 2021-01-14 Chapter 5.3 page 151 Approach 1/2

However it is an extraordinary book... I love it! A big thanks to the authors!

phamson02 commented 3 years ago

Just correct me since I feel like this is a vector transformation rather than a change of basis.

AlbertoGuastalla commented 3 years ago

I also think that the authors wanted to mean a linear transformation rather than a change of basis.

KraZZH commented 3 years ago

Actually, in a sense the function is doing a basis change...When I input a coordinate vector with respect to one basis, the function is giving me a vector which has the same coordinates, with respect to 'a different basis'. In other words the function changes the basis with respect to which it (input vector) is the coordinate vector, and gives the resultant vector. This is just an interpretation though.

ckwastra commented 8 months ago

I encountered a similar issue, and I observed a related problem documented as issue #646, which essentially outlines the same challenge. Both instances revolve around the contrasting perspectives on the process of changing the basis. A comprehensive explanation of these perspectives is provided in this answer. Additionally, a visual aid from this video, presented in the following screenshot, may contribute to a clearer understanding of the distinction:

0

Upon reviewing the content, it appears that in the book, a transformation matrix designed for a basis change from $B$ to $\tilde{B}$ is intended to map coordinates with respect to $\tilde{B}$ onto coordinates w.r.t. $B$. This interpretation is derived from the text quoted on pages 55-56 (draft 2023-12-19):

... When we perform a basis change from $B$ to $\tilde{B}$ in $V$ and from $C$ to $\tilde{C}$ in $W$, we can determine the corresponding transformation matrix $\boldsymbol{\tilde{A}}_{\Phi}$ as follows: First, we find the matrix representation of the linear mapping $\Psi_{B\tilde{B}}: V \to V$ that maps coordinates with respect to the new basis $\tilde{B}$ onto the (unique) coordinates with respect to the “old” basis $B$ (in $V$). ...

In light of the above, the content on page 151 maintains consistency with the notion of change-of-basis matrices:

Approach 1 To get started with the linear algebra approach, we identify both $\lbrace\boldsymbol{b}_1, \boldsymbol{b}_2\rbrace$ and $\lbrace\boldsymbol{c}_1, \boldsymbol{c}_2\rbrace$ as bases of $\mathbb{R}^2$ (see Section 2.6.1 for a recap). What we effectively perform is a change of basis from $(\boldsymbol{b}_1, \boldsymbol{b}_2)$ to $(\boldsymbol{c}_1, \boldsymbol{c}_2)$, ...

However, the content discussing approach 2 on page 152 seems to be erroneously oriented towards the change of basis considered in this context:

For this approach, we consider a function $\boldsymbol{f}: \mathbb{R}^2 \to \mathbb{R}^2$ that performs a variable transformation. In our example, $\boldsymbol{f}$ maps the coordinate representation of any vector $\boldsymbol{x} \in \mathbb{R}^2$ with respect to $(\boldsymbol{b}_1, \boldsymbol{b}_2)$ onto the coordinate representation $\boldsymbol{y} \in \mathbb{R}^2$ with respect to $(\boldsymbol{c}_1, \boldsymbol{c}_2)$. ...

Regarding a potential revision, a straightforward adjustment could involve interchanging the positions of $(\boldsymbol{b}_1, \boldsymbol{b}_2)$ and $(\boldsymbol{c}_1, \boldsymbol{c}_2)$ in the aforementioned text for clarification.