
Last chance! 50% off unlimited learning
Sale ends in
Generalised inverse solution of
Solve (A, B = diag(nrow = nrow(A)), tol = sqrt(.Machine$double.eps))
a vector with the generalised inverse solution.
numeric matrix containing the coefficients of the equations
numeric matrix containing the right-hand sides of the equations; the default is the unity matrix, in which case the function will return the Moore-Penrose generalized inverse of matrix A.
tolerance for selecting singular values.
Karline Soetaert <karline.soetaert@nioz.nl>
package MASS
:
Venables, W. N. & Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth Edition. Springer, New York. ISBN 0-387-95457-0
A <- matrix(nrow = 4, ncol = 3, data = c(1:8, 6, 8, 10, 12)) # col3 = col1+col2
B <- 0:3
X <- Solve(A, B) # generalised inverse solution
A %*% X - B # should be zero (except for roundoff)
(gA <- Solve(A)) # generalised inverse of A
Run the code above in your browser using DataLab