Python Forum
Inverse of singular matrix
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inverse of singular matrix
#2
This matrix is of shape (30, 20). Therefore, it couldn't be inverted in traditional sense. The main question here is why do you need to invert such matrix? May be you need to solve a system of linear equation with that matrix, e.g. Ax = b. In this case, your system is probably overdetermined and has no solution in classical sense, but it could be solved in least squares sense.
Even if the matrix has insufficient rank, e.g. rank(A) < 20, you can obtain least squares solution using Moore-Penrose inversion. It is implemented in numpy: np.linalg.pinv.
So, least squares solution could be obtained as follows:

x = np.linalg.pinv(A) @ b, where
b is known vector of shape (30, 1); you can use np.dot(np.linalg.pinv(A), b) instead of @ (if you work with Py < 3.5).
Reply


Messages In This Thread
Inverse of singular matrix - by Divanova94 - May-04-2019, 10:12 AM
RE: Inverse of singular matrix - by scidam - May-04-2019, 10:42 AM
RE: Inverse of singular matrix - by Divanova94 - May-04-2019, 10:51 AM
RE: Inverse of singular matrix - by scidam - May-05-2019, 11:19 AM
RE: Inverse of singular matrix - by scidam - May-11-2019, 02:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Differencing Time series and Inverse after Training donnertrud 0 4,146 May-27-2020, 06:11 AM
Last Post: donnertrud
  Help with Maths (inverse squares) michael1789 5 3,027 Dec-11-2019, 07:30 AM
Last Post: Gribouillis
  Beta Inverse Function ankur2207 5 8,196 Jul-23-2018, 10:07 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020