Re: [R] Matrix multiplication in R is inaccurate!!

2005-01-28 Thread Uwe Ligges
Vikas Rawal wrote: If you multiply a matrix by its inverse you should get an identity matrix. In R, you get an answer that is accurate up to about 16 decimal points? Why can't one get a perfect answer? Because R makes use of a digital computer which cannot work exactly using floating-point

[R] Matrix multiplication in R is inaccurate!!

2005-01-27 Thread Vikas Rawal
If you multiply a matrix by its inverse you should get an identity matrix. In R, you get an answer that is accurate up to about 16 decimal points? Why can't one get a perfect answer? See for example: c(5,3)-x1 c(3,2)-x2 cbind(x1,x2)-x solve(x)-y x%*%y Vikas Rawal