I am looking for a general way to find the solution (in R) to the determined parts of an under-determined linear equation system, like the following one
# Let there be an A * x = b equation system
# with three coefficients A,B,C
# where only the coefficient A has a unique solution (A=2)
A <- rbind(c(0,1,1), c(1,0,0), c(0,0,0))
colnames(A) <- LETTERS[1:3]
b <- c(1,2,0)
cbind(A,b)
# A B C b
# [1,] 0 1 1 1
# [2,] 1 0 0 2
# [3,] 0 0 0 0
I would like to solve for the parameter (A) that is determined and receive nothing for the under-determined parts, in this case should be
A = 2
Importantly, I am searching for a general way to determine the unique solutions that is not specific to the above example.
I have tried playing around with the QR-decomposition qr.coef(qr(A),b)
, which only shows me that C
has no solution, but lacks the information that B
has none.
I also played around with the single value decomposition svd(A)
but the decomposition d
in the result of the latter just indicates that one of the three parameters has a solution.
I am sure I am missing something obvious here -- thanks a bunch for the help!