ComenzarEmpieza gratis

Alternatives to the Regular Matrix Inverse

In the last video, we talked briefly about generalized or pseudo-inverses.

In this exercise, you'll use the Moore-Penrose generalized inverse in the `MASS' package and find that it produces the regular inverse if the matrix you're working with is already invertible!

The command ginv() computes the Moore-Penrose generalized inverse in R.

For more information on the Moore-Penrose inverse, see the following link.

Este ejercicio forma parte del curso

Linear Algebra for Data Science in R

Ver curso

Instrucciones del ejercicio

  • The WNBA Massey Matrix M and vector of point differentials f are loaded for you. Print M again.
  • Apply the regular inverse to M to f and print the result.
  • The MASS package is already loaded for you. Apply the generalized inverse ginv(M) to `f' and print the result.

Ejercicio interactivo práctico

Prueba este ejercicio completando el código de muestra.

# Print M
print(M)

# Find the rating vector the conventional way
r <- ___%*%f
colnames(r) <- "Rating"
print(r)

# Find the rating vector using ginv
r <- ___ ___ ___
colnames(r) <- "Rating"
print(r)
Editar y ejecutar código