Description Usage Arguments Value Examples
This function returns general inverse of a matrix.
1 | gi(A)
|
A |
A is a numberical matrix |
aplus is the general inverse of A.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (A)
{
svda <- svd(A, nu = nrow(A), nv = ncol(A))
dplus <- t(A)
dplus[] <- 0
diag(dplus) <- svda$d
dplus[which(as.matrix(dplus) < 0.1^(4))] <- 0
dplus[which(as.matrix(dplus) != 0)] <- 1/dplus[which(as.matrix(dplus) !=
0)]
aplus <- svda$v %*% dplus %*% t(svda$u)
return(aplus)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.