[R] Solving Matrices

wettenhall@wehi.EDU.AU wettenhall at wehi.EDU.AU
Thu Apr 15 12:52:03 CEST 2004

On April 15th, Elizabeth wrote:
>      In execises 39-42, determine if the columns of the matrix span
>      R4:
>(or x <- matrix(data=c(7, -5, 6, -7, 2, -3, 10, 9, -5,
>                        4, -2, 2, 8, -9, 7, 15), nrow=4, ncol=4)
>That is the whole of the question <snip>

Have you tried det(x) and/or eigen(x) ?

A zero determinant (within computer precision) means that the matrix does
not have full rank, i.e. it does not span R4.  Count how many eigenvalues
are zero (within computer precision).  What does this tell you?

>    In the Solutions Manual, there is mention of the gauss() and
>bgauss() functions which apparently written by Lay - these are to
>speed up matrix reduction but I have not noticed these functions in R.

Have you encountered speed problems in R?  Do you really need these
functions in R in addition to solve(), backsolve() etc. ?  If you just
want to learn about how they work you could have a look at the Matlab
code for these functions (which I think you have access to).  You could
even try rewriting them in R yourself.

Hope this helps,

More information about the R-help mailing list