Test for Orthonormality in a Matrix

DESCRIPTION:
Either tests whether or not a Matrix has orthonormal rows and columns, or else gives a metric by which such a test can be made.

USAGE:
is.Orthonormal(x, tol, byrow = F)
is.ColOrthonormal(x, tol)
is.RowOrthonormal(x, tol)
Orthonormal.test(x)

REQUIRED ARGUMENTS:
x:
an numeric or complex matrix.

OPTIONAL ARGUMENTS:
tol:
tolerance for the testing for orthonormality.
byrow:
tells whether or not to do the tests using the rows rather than on the columns. The default is to use the columns.

VALUE:
For is.Orthonormal, is.ColOrthonormal and is.RowOrthonormal a logical value is returned. If tol is missing from is.Orthonormal, this value is equivalent to inherits(x, "Orthonormal"). Otherwise the result is TRUE if the maximum of the modulus of the inner products between rows or columns of the matrix and the difference of the norms of rows or columns from 1 is less than or equal to tol, and FALSE otherwise.

For Orthonormal.test, the maximum of the modulus of the inner products between rows or columns of the matrix and the difference of the norms of rows or columns from 1 is returned.


SEE ALSO:
.Machine .

EXAMPLES:
v <- rnorm(3)
v <- v /vecnorm(v)
x <- diag(3) - 2 * (v %*% t(v))
is.Orthonormal(x)
# [1] F

is.Orthonormal(x, tol = .Machine$double.eps) # [1] F

is.Orthonormal(x, tol = sqrt(.Machine$double.eps)) # [1] T

Orthonormal.test(x)