ginv function

G inverse

G inverse

Calculates the g-inverse of a squared matrix using the eigen decomposition and removing the eigenvalues smaller than a tolerance.

ginv(X, tol = sqrt(.Machine$double.eps))

Arguments

  • X: Matrix to calculate the g-inverse
  • tol: Tolerance.

Details

The function is useful to avoid singularities.

Returns

Returns the g-inverse

Author(s)

Jose Luis Vicente Villardon

Examples

data(iris) x=as.matrix(iris[,1:4]) S= t(x) ginv(S)
  • Maintainer: Jose Luis Vicente Villardon
  • License: GPL (>= 2)
  • Last published: 2023-11-21

Useful links