powered by
Calculation of the Moore-Penrose (MP) pseudo-inverse of a matrix \(X\).
pinv(X, tol = sqrt(.Machine$double.eps))
The MP pseudo-inverse.
singular values.
X-data (\(n, p\)).
A relative tolerance to detect zero singular values.
n <- 7 ; p <- 4 X <- matrix(rnorm(n * p), ncol = p) y <- rnorm(n) pinv(X) tcrossprod(pinv(X)$Xplus, t(y)) lm(y ~ X - 1)
Run the code above in your browser using DataLab