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))
Matrix to calculate the g-inverse.
Tolerance.
Returns the g-inverse.
The function is useful to avoid singularities.
# NOT RUN { data(iris) x=as.matrix(iris[,1:4]) S= t(x) # } # NOT RUN { <!-- %*% x --> # } # NOT RUN { Ginv(S) # }
Run the code above in your browser using DataLab