Learn R Programming

haplo.stats (version 1.2.1)

Ginv: Compute Generalized Inverse of Input Matrix

Description

Singular value decomposition (svd) is used to compute a generalized inverse of input matrix.

Usage

Ginv(x)

Arguments

x
A matrix.

Value

  • List with components:
  • GinvGeneralized inverse of x.
  • rankRank of matrix x.

References

Press WH, Teukolsky SA, Vetterling WT, Flannery BP. Numerical recipes in C. The art of scientific computing. 2nd ed. Cambridge University Press, Cambridge.1992. page 61.

Anderson, E., et al. (1994). LAPACK User's Guide, 2nd edition, SIAM, Philadelphia.

Details

The svd function uses the LAPACK library standard to compute the singular values of the input matrix, and the rank of the matrix is determined by the number of singular values that are at least as large as max(svd)*eps, where eps is a small value (currently eps = .000001). For S-PLUS, the Matrix library is required.

See Also

svd

Examples

Run this code
# for matrix x, extract the generalized inverse and 
# rank of x as follows
#   > save <- Ginv(x)
#   > ginv.x <- save$Ginv
#   > rank.x <- save$rank

Run the code above in your browser using DataLab