Just to elaborate more in my question.
I said default compilation does not work I meant the following
Running the following in R
a<- matrix(rnorm(4*4),4)
and then compuiting the pseudoinverse and multiplying by itself I should get Identity
library(MASS)
ginv(a)%*%a
This is true SOMETIMES, here two answers :
> ginv(a)%*%a
[,1] [,2] [,3] [,4]
[1,] 0.07823858 -0.22477713 0.028575229 -0.29368248
[2,] -0.22246013 0.94575174 0.006896415 -0.07087804
[3,] -0.19005871 -0.04634697 1.005891949 -0.06055462
[4,] -0.18891406 -0.04606784 0.005856464 0.93981008
> ginv(a)%*%a
[,1] [,2] [,3] [,4]
[1,] 1.000000e+00 -1.665335e-16 -1.110223e-16 -4.267420e-16
[2,] 9.714451e-17 1.000000e+00 4.440892e-16 -4.718448e-16
[3,] 2.220446e-16 -2.220446e-16 1.000000e+00 1.595946e-16
[4,] 1.089406e-15 -3.330669e-16 0.000000e+00 1.000000e+00
Although, using
solve(a)%*%a
always work
Any help in this matter is highly appreciated.