Lesson 12 of 15
Pseudoinverse
Moore-Penrose Pseudoinverse
The pseudoinverse generalises the matrix inverse to non-square and singular matrices. It gives the minimum-norm least-squares solution to :
For Full Column Rank (, rank )
When has full column rank, the pseudoinverse is:
This is exactly the least-squares formula.
For Square Invertible
Example
Your Task
Implement pseudoinverse(A) for matrices with full column rank using the formula . The helper inv_square handles both 1×1 and 2×2 square matrices.
Python runtime loading...
Loading...
Click "Run" to execute your code.