[Math] How to determine stopping criteria in iterative methods

MATLABnumerical methods

I am reading an iterative methods to compute generalized inverses of a matrix.
Note that generalized inverse of a matrix $A$ is a matrix $X$ which satisfy

$AXA = A$

I am using matlab program to code various iterative methods to compute generalized inverse of a matrix. I need help to understand how to determine when to stop the iteration. There is a function pinv(A) in a matlab that determines the Moore- Penrose generalized inverse of the matrix. For small order of matrices it is easy to guess when to stop. But for large order matrices how to decide when to stop iteration? I read two different methods for computing generalized inverse

one method has taken stopping criterion as $\| A X_{k}A – A \|\leq 10^{-4} $ while another method has taken $\| A X_{k}A – A \|\leq 10^{-8}$. Where $X_{k}$ is the sequence of approximations for computing generalized inverse of matrix $A$.

Why they have taken different stopping criteria? I need help to understand this. I would be very much thankful.

Best Answer

For iterative methods the difference from one iteration to the other gets lower and lower as it is supposed to converge. Therefore absolute error or absolute squared error from one iteration to the other is usually defined as the stopping criterion. Of course there is one other way, that is to fix the number of iterations which is trivial. Important of choosing a threshold for the absolute error from one iteration to the next provides you a certain level of quality. If you set it to $10^{-8}$ it will take more time for the convergence but the quality of the approximation will be of course better than the case where you set it to $10^{-4}$. It is all related to the trade-off between speed of convergence and the quality of convergence which is determined by the user.

In your example, the thresholds are determined in a similar way. It is a subjective process but the quality can be objectively evaluated.