pinv | R Documentation |
Calculation of the Moore-Penrose (MP) pseudo-inverse of a matrix X
.
pinv(X, tol = sqrt(.Machine$double.eps))
X |
A |
tol |
A relative tolerance to detect zero singular values. |
A list of outputs, such as:
Xplus |
The MP pseudo-inverse. |
n <- 10
p <- 6
set.seed(1)
X <- matrix(rnorm(n * p, mean = 10), ncol = p, byrow = TRUE)
y <- rnorm(n)
set.seed(NULL)
pinv(X)
tcrossprod(pinv(X)$Xplus, t(y))
lm(y ~ X - 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.