Learn R Programming

MultBiplotR (version 23.11.0)

ginv: G inverse

Description

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

Usage

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

Value

Returns the g-inverse

Arguments

X

Matrix to calculate the g-inverse

tol

Tolerance.

Author

Jose Luis Vicente Villardon

Details

The function is useful to avoid singularities.

Examples

Run this code
data(iris)
x=as.matrix(iris[,1:4])
S= t(x) 
ginv(S)

Run the code above in your browser using DataLab