Improved Qrginv Algorithm for Computing Moore-Penrose Inverse Matrices

Katsikis et al. presented a computational method in order to calculate the Moore-Penrose inverse of an arbitrary matrix (including singular and rectangular) (2011). In this paper, an improved version of this method is presented for computing the pseudo inverse of an m × n real matrix A with rank r > 0. Numerical experiments show that the resulting pseudoinverse matrix is reasonably accurate and its computation time is significantly less than that obtained by Katsikis et al.


Introduction
Let R × denote the set of all  ×  matrices over the field of real numbers, R. The symbols   , rank(  ) will stand for the transpose and rank of  ∈ R m× , respectively.For a matrix  ∈ R × , the Moore-Penrose inverse of , denoted by  † , is the unique matrix  ∈ R × satisfying the following equations: (i)  = , (ii)  = , (iii) ()  = , (iv) ()  = .
In this paper, we aim to improve their method so that it can be used for any kind of matrices, square or rectangular, full rank or not.The numerical examples show that our method is competitive in terms of accuracy and is much faster than the commonly used methods and can also be used for large sparse matrices.
This paper is organized as follows.In Section 2 the improved version of this method is presented for computing the pseudoinverse of an  ×  real matrix  with rank  > 0. In Section 3, the numerical results of some test matrices are given.Section 4 is devoted to the concluding remarks.

Improved Qrginv Method (IMqrginv)
In [9], a method (qrginv) for computing the Moore-Penrose inverse of an arbitrary matrix was presented.They made use of the QR-factorization, as well as an algorithm based on a known reverse order law for generalized inverse matrices, and also they apply a method (ginv), presented in [4], based on a full rank Cholesky factorization of possibly singular symmetric positive matrices.
In the current paper, we improved qrginv algorithm using the QR-factorization by Gram-Schmidt orthonormalization (GSO) and Theorem 1 for faster computing Moore-Penrose inverse of arbitrary matrices (including singular and rectangular).We should note that we invoke ginv algorithm.In order to support and state our achievement we need to remind Gram-Schmidt orthonormalization (GSO) and the QR-factorization.

The Gram-Schmidt Procedure.
Let us remind a generalization of the Gram-Schmidt orthonormalization process (shortly GSO) which is applied for singular matrices.Let A = { 1 ,  2 , . . .,   } ⊆ R  be a set of vectors spanning a subspace , This process generates a set of mutually Q is obtained using the Gram-Schmidt orthonormalization process (shortly GSO) as follows: The integer  found by the GSO process is the dimension of the subspace .The integers { 1 , . . .,   } are the indices of a maximal linearly independent subset {  1 , . . .,    } of A.

The QR-Factorization. Let us remind the QR-factorization for arbitrary matrices (including singular and rectangular).
Let the orthonormal set { 1 ,  2 , . . .,   } be obtained from the set of vectors { 1 ,  2 , . . .,   } by the GSO process described in Section 2.1, and let with rank() =  > 0, be the corresponding matrices.Then there exist matrices Ã, , and  such that where (i)  is a permutation matrix (therefore orthonormal); , where Q and  denote matrices whose columns are an orthonormal basis of () and (  ), respectively; It follows that Ã has a Q R-factorization.A nonzero matrix can be expressed as the product of a matrix of full column rank and a matrix of full row rank.In fact, for given  ∈ R × (rank() =  > 0) there exist matrices  ∈ R × and  ∈ R × such that  =  [2].Such factorization, which is the so-called a full rank factorization, turns out to be a powerful tool in the study of generalized inverses.
The following theorem is due to C. C MacDuffe [10] who apparently was the first one to point out that a full rank factorization of a matrix  leads to an explicit formula for its Moore-Penrose inverse,  † .Theorem 1.If  ∈ R × matrix, with rank() =  > 0, has a full rank factorization  = , then As a direct consequence of Theorem 1, we have the following.
Proof.With  = Ã,  = Q, and  = R in Theorem 1 one obtains and consequently The function IMqrginv 4 provided all implementation details of the above solution, in MATLAB code.To calculate

Method
Time  the rank of R, one needs only the number of its columns having at least one value above a tolerance level in absolute terms.This tolerance is set to be equal to 10 −5 , which is also used by Katsikis et al. [9], and turns out to provide accurate results.

Numerical Examples
In this section, we compare the performance of the proposed method (IMqrginv function) to that of Katsikis et al. [9] for the computation of Moore-Penrose inverse matrices.Testing qrginv and IMqrginv was performed separately for random singular and singular matrices with "large" condition number from the Matrix Computation Toolbox (see [11]).We also tested the proposed method for some sparse matrices and obtained very fast and accurate results.Specifically, MATLAb 7.11 (R2010b) Service Pack 3 version of the software was used on an Intel Core 2 (Duo) 8400 Processor running 2.26 GHz with 3 GB of RAM memory using Windows Vista professional 32-bit operating system.

Random Singular Matrices.
We are computing the performance of the proposed method IMqrginv to that of [9] (qrginv function).In the same way of [4] we tested on a series of random singular matrices of size  × , with  = 2  ,  = 7, . . ., 11, and  = 2, which are rank deficient, with rank  = 7/8.In addition, the accuracy of the results is examined with the matrix 2-norm in error matrices corresponding to the four properties characterizing the Moore-Penrose inverses shown in Table 1.The computation error is less than 10 −12 per coefficient in the error matrices, in all cases.The computation time (in seconds) is reported in Table 1.We observe that the computation time of IMqrginv method is substantially less than that of the qrginv method.

Singular Matrices.
In this section we use a set of singular test matrices that includes singular matrices of size 200 × 200, obtained from the function matrix in the Matrix Computation Toolbox [11] (which inculdes test matrices from Matlab itself).The condition number of test matrices ranges from order 10 16 to 10 135 .Since the matrices are of relatively small size and so as to measure the time needed for each algorithm to compute the Moore-Penrose inverse accurately, each algorithm runs 100 distinct times.The reported time is the mean time over these 100 replications.For each case, the time responses together with the error results are presented in Tables 2, 3, 4, 5, 6, 7, 8, and 9.We observe that the computation time of IMqrginv method is shorter than the qrginv method for all matrices and is proved to be more efficient.

Matrix-Market Sparse Matrices.
For sparse matrices, we have chosen some matrices from Matrix-Market collection [11].We follow the same method as in [8], and we have the rank deficient matrices as where  is one of the chosen matrices and  is a zero matrix of order  × 100.The chosen matrices with their properties are shown in Table 10.The results of the methods are presented in Table 11.We observe that the Moore-Penrose inverses obtained by IMqrginv are reasonably accurate in all cases; the computation time required by the IMqrginv method is significantly less than the time required by the IMqrginv methods.On the other hand, we can see that the accuracy computation of the IMqrginv method is less than the qrginv method; however, in some cases, the accuracy of the results of both methods is low.We can conclude that IMqrginv method is a robust and efficient tool for obtaining the Moore-Penrose inverse of large sparse and rank deficient matrices.

Conclusion
In this paper we have presented a new method, called IMqrginv, for the fast computation of Moore-Penrose inverse of singular square, rectangular, full, or sparse matrices.This method is based on the GSO method and Theorem 1. Invoking the ginv function we improved qrginv methods presented by Katsikis et al. [9].We have compared the performance of the proposed method IMqrginv to the qrginv method.Numerical examples (see Tables 1-9 and 11) show that the proposed method is reasonably accurate, and its computation time is less than that of pseudoinverses obtained by the qrginv.Hence we conclude that the IMqrginv algorithm is a robust and efficient tool for computing the Moore-Penrose inverse of arbitrary matrices (including singular and rectangular).

Table 1 :
Error and computational time results for random singular matrices.= { 1 ,  2 , . . .,   } ⊆ R  having the property that Q is an orthonormalization basis for .

Table 10 :
Test problem information.