0
Aは長方形で、次にコードに従うので、私はRのAの逆行列を求めようとしています。 iが見つけ1つの逆AIであり、iは計算場合AI Aはムーア - ペンローズ行列逆行列R
> A = matrix(
+ c(1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1,0,0,0,1),
+ nrow=5, ncol=4, byrow = TRUE)
> A
[,1] [,2] [,3] [,4]
[1,] 1 1 1 1
[2,] 1 1 1 1
[3,] 0 1 1 1
[4,] 0 0 1 1
[5,] 0 0 0 1
> (AA <- t(A) %*% A)
[,1] [,2] [,3] [,4]
[1,] 2 2 2 2
[2,] 2 3 3 3
[3,] 2 3 4 4
[4,] 2 3 4 5
> (AAI <- ginv(AA))
[,1] [,2] [,3] [,4]
[1,] 1.500000e+00 -1.000000e+00 5.551115e-16 2.220446e-16
[2,] -1.000000e+00 2.000000e+00 -1.000000e+00 -1.110223e-16
[3,] 1.332268e-15 -1.000000e+00 2.000000e+00 -1.000000e+00
[4,] -2.220446e-16 -1.110223e-16 -1.000000e+00 1.000000e+00
> AI <- AAI %*% t(A)
> AI
[,1] [,2] [,3] [,4] [,5]
[1,] 5.000000e-01 5.000000e-01 -1.000000e+00 7.771561e-16 2.220446e-16
[2,] 3.330669e-16 3.330669e-16 1.000000e+00 -1.000000e+00 -1.110223e-16
[3,] 2.220446e-16 2.220446e-16 -1.110223e-15 1.000000e+00 -1.000000e+00
[4,] -1.110223e-16 -1.110223e-16 1.110223e-16 2.220446e-16 1.000000e+00`
> A %*% AI %*% A
[,1] [,2] [,3] [,4]
[1,] 1.000000e+00 1.000000e+00 1.000000e+00 1
[2,] 1.000000e+00 1.000000e+00 1.000000e+00 1
[3,] 8.881784e-16 1.000000e+00 1.000000e+00 1
[4,] 2.220446e-16 -7.771561e-16 1.000000e+00 1
[5,] -2.220446e-16 -1.110223e-16 1.110223e-16 1
`