1. Learn
  2. /
  3. Courses
  4. /
  5. Linear Algebra for Data Science in R

Exercise

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.

Instructions

100 XP
  • 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.