[,1]
[1,] 0
[2,] 2
[3,] 2
[4,] 0
(This is ex Ch1, 2.2 of Artin, Algebra).
So, 3 eqs in 4 unknowns. One can easily use row-reductions to find a
homogeneous solution(b=0) of:
X_1 = 0, X_2 = -c/2, X_3 = c, X_4 = 0
and solutions of the above system are:
X_1 = 2/3, X_2 = -1/3-c/2, X_3 = c, X_4 = 0.
So the Kernel is 1-D spanned by X_2 = -X_3 /2, (nulliity=1), rank is 3.
In R I use solve():
solve(a,b)
Error in solve.default(a, b) :
Lapack routine dgesv: system is exactly singular
and it gives the error that the system is exactly singular, since it seems
to be trying to invert a.
So my question is:
Can R only solve non-singular linear systems? If not, what routine should I
be using? If so, why? It seems that it would be simple and useful enough to
have a routine which, given a system as above, returns the null-space
(kernel) and the particular solution.
--
View this message in context: http://r.789695.n4.nabble.com/Finding-solution-set-of-system-of-linear-equations-tp3541490p3541490.html
Sent from the R help mailing list archive at Nabble.com.
[,1]
[1,] 0
[2,] 2
[3,] 2
[4,] 0
(This is ex Ch1, 2.2 of Artin, Algebra).
So, 3 eqs in 4 unknowns. One can easily use row-reductions to find a
homogeneous solution(b=0) of:
X_1 = 0, X_2 = -c/2, X_3 = c, X_4 = 0
and solutions of the above system are:
X_1 = 2/3, X_2 = -1/3-c/2, X_3 = c, X_4 = 0.
So the Kernel is 1-D spanned by X_2 = -X_3 /2, (nulliity=1), rank is 3.
In R I use solve():
solve(a,b)
Error in solve.default(a, b) :
Lapack routine dgesv: system is exactly singular
and it gives the error that the system is exactly singular, since it seems
to be trying to invert a.
So my question is:
Can R only solve non-singular linear systems? If not, what routine should I
be using? If so, why? It seems that it would be simple and useful enough to
have a routine which, given a system as above, returns the null-space
(kernel) and the particular solution.
--
View this message in context:
http://r.789695.n4.nabble.com/Finding-solution-set-of-system-of-linear-equations-tp3541490p3541490.html
Sent from the R help mailing list archive at Nabble.com.
================================================================
Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: ral at lcfltd.com
Least Cost Formulations, Ltd. URL: http://lcfltd.com/
824 Timberlake Drive Tel: 757-467-0954
Virginia Beach, VA 23464-3239 Fax: 757-467-2947
"Vere scire est per causas scire"
Thanks Robert. That all seems to work. I also found the MASS::Null() function
that gives the null space for the matrix(transpose) given as argument. I am
still trying to appreciate the math behind the Moore-Penrose inverse matrix.
If you have any suggestions for understanding how to use R to solve these
kinds of systems, please send me the pointer.
I think the R documentation for solve() should state right up front that it
only solves non-singular systems, and it should point me to MASS::ginv() and
how to use it to solve this obvious kind of problem. Better, there could be
a generalized solve() which produces a particular solution, the null space,
image space (basis thereof). This other solution (using ginv() and giA%*%A -
I for the kernel) seems deeply embedded in a particular solution technique
(and should be available), but the generalized solve_lin_sys(), as I
suggested, seems generally quite useful..
Don
--
View this message in context: http://r.789695.n4.nabble.com/Finding-solution-set-of-system-of-linear-equations-tp3541490p3542930.html
Sent from the R help mailing list archive at Nabble.com.