LoslegenKostenlos loslegen

Adjusting the Massey Matrix

For our WNBA Massey Matrix model, some adjustments need to be made for a solution to our rating problem to exist and be unique. This is because the matrix we currently have is not (computationally) invertible.

One way we can change this is to add a row of 1's on the bottom of the matrix \(M\), column of -1's to the far right of \(M\), and a 0 to the bottom of the vector of point differentials \(\vec{f}\). In this exercise, you will actually add all of these to the matrix \(M\).

Diese Übung ist Teil des Kurses

Linear Algebra for Data Science in R

Kurs anzeigen

Anleitung zur Übung

  • Add a row of 1's to the bottom of the matrix M using the command rbind(). Assign the result to M_2.
  • Add a column of -1's to the right of M_2 using the command cbind(). Assign the result to M_3.
  • Set the 13x13 element of M_3 to 1.
  • Print the resulting matrix.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Add a row of 1's
M_2 <- rbind(M, ___)

# Add a column of -1's 
M_3 <- ___(M_2, rep(-1, 13))

# Change the element in the lower-right corner of the matrix
M_3[___, ___] <- 1

# Print M_3
print(___)
Code bearbeiten und ausführen