mml-book / mml-book.github.io

Companion webpage to the book "Mathematics For Machine Learning"
13.21k stars 2.43k forks source link

page 118 eq 4.60&61 Diagonal matrix is wrong a11 and a22 should be replaced with one another #607

Open gorkemcanates opened 3 years ago

gorkemcanates commented 3 years ago

Describe the mistake A clear and concise description of what the mistake is.

Location Please provide the

  1. version (bottom of page)
  2. Chapter
  3. page
  4. line number/equation number

Proposed solution A clear and concise description of what you would like to change.

Additional context Add any other context about the problem here.

mpd37 commented 3 years ago

According to my computation, the matrix is correct.

A = 1/2 * np.array([[5,-2],[-2,5]])
P = np.array([[1,1],[-1,1]])/np.sqrt(2)

np.linalg.inv(P) @ A @ P 
array([[3.5, 0. ],
           [0. , 1.5]])