chkginv {lazy.irtx}R Documentation

Check if the the second matrix is a generalized inverse of the first one, or vice versa.

Description

Check if the the second matrix is a generalized inverse of the first one, or vice versa.

Usage

chkginv(A, Ainv, eps = 1e-08)

Arguments

A

matrix

Ainv

Possible generalized inverse of A

eps

criterion for zero

Details

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

Value

A list of:
check=list(g01,g02,g1,g2,g3,g4) and maxad=list(d01,d02,d1,d2,d3,d4)

Examples

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)


[Package lazy.irtx version 1.0.1 Index]