returns the solution space (basis and translation vector) for an equation system
returns the solution space (basis and translation vector) for an equation system
solutionSpace(A, b)
A |
numeric matrix |
b |
numeric vector |
For a linear equationsystem, Ax = b, the solution space then is
x = A'b + (I - A' A)
where A' is the Moore-Penrose pseudoinverse of A. The QR decomposition of I - A'A determines the dimension of and basis of the solution space.
basis |
matrix containing the basis of the solution space |
translate |
translation vector |
A <- matrix(rnorm(21),3,7) b <- c(1,2,3) subspace <- solutionSpace(A,b) dims <- ncol(subspace$basis) # we now have a 4D solution space ## now pick any vector from this space. E.g y <- 1:dims solution <- subspace$basis%*%y+subspace$translate # this is one solution for the equation above A%*%solution ## pretty close
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.