Showing posts with label Pseudo Inverse calculation. Show all posts
Showing posts with label Pseudo Inverse calculation. Show all posts

Tuesday, March 3, 2009

Pseudo Inverse calculation


Pseudo inverse matrix helps to get a satisfactory solution to linear equation which don't have any exact solution. This technique is used for curve fitting .

The pseudo inverse can be calculated like this . If A is the matrix

The pseudo inverse is this : Inverse[Transpose[a] * A ] * Transpose[A]

Normal inverse exists only for square matrix. So we can call this pseudo inverse as a general matrix inverse method.

Consider the following linear equations

5X1 + 4 X2 = 9
3X1 + 2X2 = 5
X1 + x2 = 3

Actually this set of equations doesn't have any exact solution.

A X R
5 4 x1 9
3 2 * x2 = 5
1 1 3


Clearly we can't calculate the normal inverse of A because it is not square matrix.
The pseudoinverse of A is

-.5 1.5 -1.0
.833 -1.833 1.333

So [Pseudoinverse]* [R] give the values for X1 and X2, which is the nearst solution for the equations.