3
$\begingroup$

I am reading an iteration method for computing the Moore- Penrose genralized inverse of a given matrix $A$, which is given as follows:

$X_{k+1} = (1+\beta)X_{k} - \beta X_{k} A X_{k}$

where $X_{k}$, k = 0,1,... is a sequence of approximations for computing Moore- Penrose genralized inverse

$ X_{0} = \beta A' $ is the initial approximation , $0<\beta\leq 1$ and $A'$ is the transpose of matrix $A$

$d_{k} = \|X_{k+1} - X_{k}\|_{fro}$ is the error matrix norm (frobenius norm)

I have made following matlab program for computing Moore- Penrose genralized inverse by above mentioned method. But i am unable to make code for stopping criterion which says that.

perform the iteration untill

$|d_{k+1}/d_{k} - \beta -1|> 10^{-4}$

enter image description here

Please help me with this. I would be very much thankful to you.

  • 1
    You can post the MATLAB code on your post. Check the "code sample" button, the one with the "{}".2012-09-11
  • 0
    Why are you unable to make code for the stopping criterion? Do you mean do you don't know how to do it, or that when you try, it doesn't work? Can't you use a while loop?2012-09-12
  • 0
    @ChristopherA.Wong Dear sir, i m beginner in matlab. I don't know how to do that? I need help.2012-09-12
  • 0
    @srijan, you should change your for loop to a while loop that checks the value of the error.2012-09-14

1 Answers 1

2

The prep before your loop should stay the same. The appropriate script is

A = ...; % as you have given beta = ...; % whatever you want X0 = beta*A'; % calculate initial estimate  % (these initial values may need to be changed, I don't have a copy of %    matlab in front of me)     dklast = NaN; dk = NaN; % initialise to begin loop  iter = 0; maxiter = 100;  while (abs(dk/dklast - beta - 1) > 1e-4) && (iter < maxiter) % loop until tolerance met     iter = iter + 1; % keep count of iteration      X1 = (1+beta)*X0 -beta*X0*A*X0; % calculate new iterate      dklast = dk; % move old difference "new estimate to previous iterate"     dk = norm(X1-X0,'fro'); % determine new difference       X0 = X1; % copy current iterate to "old" iterate for next iteration  end 

I am wondering why you are using this convergence test at all. I would recommend using

dk = norm(X1*X0-I,'fro'); 

which measures how close X1 is to the left inverse of $A$. Your termination criteria would then be

while dk > (some_tolerance) && iter < maxiter     .... end 

As you currently have, you are measuring how much X1 changes from X0, which may be small, but still not an approximate inverse (or pseudoinverse) for $A$.

  • 0
    First of all thanks for replying me. I took beta = 1/norm (A,2)^2 , but program is not running.2012-09-14
  • 0
    What error are you receiving? I have seen this algorithm with `beta=1`, not anything else. As I said, those two lines may need to be changes. You could initialise the process with `dklast=-30` and `dk=-20` and it should work then.2012-09-14
  • 0
    Programm is not running..just Matrix A is coming...not getting x1..2012-09-14
  • 0
    If `X1` is not defined at the end of the iteration, then the loop is not running. As I said in my above comment, try with the values I have given there. The `NaN` terms may be invalidating the condition.2012-09-14
  • 0
    Dear i am not getting what you mean by x1 is not defined at the end of iteration bro..x1 is the sequence of approximation..nd you have defined that2012-09-14
  • 0
    `X1` is your current approximation for the inverse. If it is not defined in the matlab workspace, then the line `X1 = (1+beta)...` is never executed. Have a look at [this paper](http://tesla.pmf.ni.ac.rs/people/dexter/Papers/SMSdexJoined.pdf) which outlines how the method works.2012-09-14
  • 0
    Or use the inbuilt matlab function pinv(...). Type `help pinv` to display the help for this function.2012-09-14
  • 0
    i am reading the same paper ..And I am trying to implement taht method on matlab...but still no success...2012-09-14
  • 0
    I will get my matlab version on and check.2012-09-14
  • 0
    let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/4823/discussion-between-daryl-and-srijan)2012-09-14