I am using the ginv function from MASS and have run across this problem
that I do not understand.  If I define the matrix A as below, its
g-inverse does not satisfy the Moore-Penrose condition 
 
A %*% ginv(A) %*% A = A.
 
The matrix A is X'WX in a quadratic regression using some very large
dollar values. 
The much simpler matrix B does satisfy the MP condition. Am I doing
something wrong? Is this due to the large values in A?
 
I am using v.1.8.1 on Windows XP.
 
> A <- matrix(c(15, 20157302,20157302,68854740000000), ncol=2, byrow
=T)
> A
         [,1]         [,2]
[1,]       15 2.015730e+07
[2,] 20157302 6.885474e+13
> ginv(A)
             [,1]         [,2]
[1,] 1.244696e-27 4.251721e-21
[2,] 4.251721e-21 1.452333e-14
> A %*% ginv(A) %*% A
             [,1]         [,2]
[1,] 5.901073e+00 2.015730e+07
[2,] 2.015730e+07 6.885474e+13
> B
     [,1] [,2]
[1,]    1    2
[2,]    2    1
> B %*% ginv(B) %*% B
     [,1] [,2]
[1,]    1    2
[2,]    2    1

 
Thanks in advance,
 
 
Richard Valliant, Ph.D.
University of Maryland
Joint Program for Survey Methodology
1218 Lefrak Hall
College Park MD 20742
(301)-405-0932
FAX: (301) 314-7912


	[[alternative HTML version deleted]]


