powered by
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))
Returns the g-inverse
Matrix to calculate the g-inverse
Tolerance.
Jose Luis Vicente Villardon
The function is useful to avoid singularities.
data(iris) x=as.matrix(iris[,1:4]) S= t(x) ginv(S)
Run the code above in your browser using DataLab