Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Pseudoinverse in MATLAB
Replies: 12   Last Post: Mar 19, 2013 12:55 AM

 Messages: [ Previous | Next ]
 Greg Heath Posts: 6,385 Registered: 12/7/04
Re: Pseudoinverse in MATLAB
Posted: Mar 14, 2013 3:45 PM

"Daniel Vasilaky" wrote in message <khralp\$bgq\$1@newscl01ah.mathworks.com>...
> Elias Kyriakides <elias_kyriakides@hotmail.com> wrote in message <3AC15EAA.F5CACB12@hotmail.com>...
-----SNIP

> The SVD approach of pinv() is unstable.
-----SNIP

> %Example 1:
> format long;
> A = [1 0;0 0;0 0];
> b=[1;1;1];
> pA = pinv(A);
> x = pA*b
> dA = [1 0;0 10e-6;0 0];
> pdA = pinv(dA);
> x1 = pdA*b

That does NOT demonstrate that the SVD approach of pinv() is unstable
I think you are slightly confused about what pinv really needs to satisfy

help pinv

B = [ 1 0 ; 0 1e-5 ; 0 0 ]
pinvB = pinv(B)
pinvB = [ 1 0 0 ; 0 1e5 0]
B*pinvB = [1 0 0 ; 0 1 0; 0 0 0 ]
pinvB*B = [ 1 0 ; 0 1 ]

check1 = max(max(abs(B-B*pinvB*B)) ) % 1.694e-21
check2 = max(max(abs(pinvB-pinvB*B*pinvB)) ) % 1.456e-11
check3 = max(max(abs(pinvB*B-(pinvB*B)')) ) % 0
check4 =max( max(abs(B*pinvB-(B*pinvB)')) ) % 0

Hope this helps.

Greg

Date Subject Author
3/14/13 Bjorn Gustavsson
3/14/13 Bruno Luong
3/15/13 Bjorn Gustavsson
3/16/13 Bruno Luong
3/16/13 Bruno Luong
3/16/13 Greg Heath
3/19/13 Bruno Luong
3/14/13 Greg Heath