NullC {rstiefel} | R Documentation |
Null Space of a Matrix
Description
Given a matrix M
, find a matrix N
giving a basis for the null
space. This is a modified version of Null from the package MASS.
Usage
NullC(M)
Arguments
M |
input matrix. |
Value
an orthonormal matrix such that t(N)%*%M
is a matrix of
zeros.
Note
The MASS function Null(matrix(0,4,2))
returns a 4*2 matrix,
whereas NullC(matrix(0,4,2))
returns diag(4)
.
Author(s)
Peter Hoff
Examples
NullC(matrix(0,4,2))
## The function is currently defined as
function (M)
{
tmp <- qr(M)
set <- if (tmp$rank == 0L)
1L:nrow(M)
else -(1L:tmp$rank)
qr.Q(tmp, complete = TRUE)[, set, drop = FALSE]
}
[Package rstiefel version 1.0.1 Index]