## Moore-Penrose pseudoinverse
.pinv <- function(X, tol=.Machine$double.eps)
X <- as.matrix(X)
xsvd <- svd(X)
nze <- sum( xsvd$d > (tol*xsvd$d) )
return (if(nze > 1L) xsvd$v[,1:nze] %*% diag(1/xsvd$d[1:nze]) %*% t(xsvd$u[,1:nze])
else outer(xsvd$v[,1],xsvd$u[,1]) / xsvd$d
Any scripts or data that you put into this service are public.
Add the following code to your website.
Copy to clipboard
For more information on customizing the embed code, read Embedding Snippets.