[R] ginv and matlab's pinv give different results

From: Pedro Mardones <mardones.p_at_gmail.com>
Date: Fri, 22 Feb 2008 23:12:10 -0500


Dear all;
I'm kind of confused with the results obtained using the ginv function from package MASS and pinv function from Matlab. Accroding to the documentation both functions performs a Moore-Penrose generalized inverse of a matrix X. The problem is when I change the tolerance value, say to 1E-3.

Here is some output from ginv

195.2674402	235.6758714	335.0830253	8.977515484	-291.7798965
428.8266383	165.9809056	284.0561017	-74.35007018	-210.3373981
440.6537582	42.44715935	290.4538488	-58.74366626	-86.71457799
246.4469887	-36.24936825	397.6034028	-107.7574448	10.7545897
-17.07138404	30.43896492	399.3831596	-88.49681959	12.33524917


ad here from pinv
1.988794963	4.931306729	-12.72706642	-3.903229019	-4.516082822
3.017403231	4.799144574	-14.43317599	-5.388596501	-5.872449411
4.951830097	4.684716091	-17.13075023	-6.584430072	-7.142673623
7.457154317	2.896685565	-21.59318352	-11.38286985	-10.58210901
7.841116927	0.836247791	-23.12560946	-13.99460333	-11.8333927

I'm sure it must be some explanation that I'm not aware of. If anyone can (want) to run the test I can email the data set Thanks for any idea

PM



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 23 Feb 2008 - 04:17:39 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 24 Feb 2008 - 19:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive