Inversa generalizada

Description

Calcula a inversa generalizada de Moore-Penrose de uma matriz X.

Usage

1
ginv(X, tol = sqrt(.Machine$double.eps))

Arguments

X

Matriz para a qual deseja-se a inversa de Moore-Penrose.

tol

Uma tolerancia relativa para detectar valores singulares zero.

Value

Uma inversa generalizada de Moore-Penrose para X.

References

VENABLES, W. N.; RIPLEY, B. D. Modern Applied Statistics with S-PLUS. Third Edition. Springer. 1999. p. 100.

See Also

Veja tambem: solve, svd, eigen.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
# The function is currently defined as
function(X, tol = sqrt(.Machine$double.eps))
{
## Generalized Inverse of a Matrix
  dnx <- dimnames(X)
  if(is.null(dnx)) dnx <- vector("list", 2)
  s <- svd(X)
  nz <- s$d > tol * s$d[1]
  structure(
    if(any(nz)) s$v[, nz] %*% (t(s$u[, nz])/s$d[nz]) else X, dimnames = dnx[2:1])
}

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.