[R] Matrix multiplication in R is inaccurate!!
Uwe Ligges
ligges at statistik.uni-dortmund.de
Fri Jan 28 09:12:22 CET 2005
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 arithmetics ...
Please read some textbook about a numerics and computers.
Uwe Ligges
> See for example:
>
> c(5,3)->x1
> c(3,2)->x2
> cbind(x1,x2)->x
> solve(x)->y
> x%*%y
>
> Vikas Rawal
>
> ==============================================
>
> This Mail was Scanned for Virus and found Virus free
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
More information about the R-help
mailing list