in R programming, concerning on inverse matrix and its multiplication

前端 未结 2 627
梦谈多话
梦谈多话 2021-01-15 00:14

this is my solving process from the exercise of [a beginner\'s guide to R]

> Q
     [,1] [,2] [,3]
[1,]    1    2    3
[2,]    4    2    1
[3,]    2             


        
2条回答
  •  借酒劲吻你
    2021-01-15 01:08

    Use the zapsmall function on the final result. Due to floating point representation and rounding errors anything more than simple arithmatic (and even that sometimes) will result in values that are very close, but not exactly the same as what is expected. In this case you are seeing a value that has 16 0's after the decimal place before the first non-zero digit. The zapsmall function will convert these small, essentially 0, values to 0 so that what you see matches what you expect.

提交回复
热议问题