Re: [R] Finding solution set of system of linear equations.

2011-05-22 Thread dslowik
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

[R] Finding solution set of system of linear equations.

2011-05-21 Thread dslowik
I have a simple system of linear equations to solve for X, aX=b: a [,1] [,2] [,3] [,4] [1,]1211 [2,]3004 [3,]1 -4 -2 -2 [4,]0000 b [,1] [1,]0 [2,]2 [3,]2 [4,]0 (This is ex Ch1, 2.2 of Artin, Algebra). So, 3 eqs

Re: [R] Finding solution set of system of linear equations.

2011-05-21 Thread Robert A LaBudde
solve() only works for nonsingular systems of equations. Use a generalized inverse for singular systems: A- matrix(c(1,2,1,1, 3,0,0,4, 1,-4,-2,-2, 0,0,0,0), ncol=4, byrow=TRUE) A [,1] [,2] [,3] [,4] [1,]1211 [2,]3004 [3,]1 -4 -2 -2 [4,]00