chkginv {lazy.irtx} | R Documentation |
Check if the the second matrix is a generalized inverse of the first one, or vice versa.
chkginv(A, Ainv, eps = 1e-08)
A |
matrix |
Ainv |
Possible generalized inverse of A |
eps |
criterion for zero |
This function checks if the following four conditons are met.
g1) A - A %*% Ainv %*% A
g2) Ainv - Ainv %*% A %*% Ainv
g3) A %*% Ainv - t(A %*% Ainv)
g4) Ainv %*% A - t(Ainv %*% A)
In addition, when the input matrix is square, the following two conditons
are added.
g01) I - A %*% Ainv
g02) I - Ainv %*% A
A list of:
check=list(g01,g02,g1,g2,g3,g4) and
maxad=list(d01,d02,d1,d2,d3,d4)
chkginv( demomat(3,3), matSwp(demomat(3,3)) ) # called from Ginv or matSwp A=demomat(9,4); A=t(A)%*%A; Ainv=matSwp(A,chkginv=1)