... | @@ -11,7 +11,12 @@ So far, we were used the simple [`numpy.linalg.inv()`](https://numpy.org/doc/sta |
... | @@ -11,7 +11,12 @@ So far, we were used the simple [`numpy.linalg.inv()`](https://numpy.org/doc/sta |
|
|
|
|
|
In the above figures, the quantity 'inv' refers to the `numpy.linalg.inv()` function. In the right plot, the quantity 'k' refers to the index of the off-diagonal array; k>0 for diagonals above the main diagonal, and k<0 for diagonals below the main diagonal. Note that the off-diagonal elements are substantially larger than zero for the left-hand inverse matrix only, and also not consistent with the case of the right-hand inverse matrix.
|
|
In the above figures, the quantity 'inv' refers to the `numpy.linalg.inv()` function. In the right plot, the quantity 'k' refers to the index of the off-diagonal array; k>0 for diagonals above the main diagonal, and k<0 for diagonals below the main diagonal. Note that the off-diagonal elements are substantially larger than zero for the left-hand inverse matrix only, and also not consistent with the case of the right-hand inverse matrix.
|
|
|
|
|
|
To resolve this issue, we propose to use the Moore-Penrose pseudo-inverse method. This method calculates the generalized inverse of a matrix using its singular-value decomposition (SVD) and including all large singular values. We use the numpy inbuild function [`numpy.linalg.pinv()`](https://numpy.org/doc/stable/reference/generated/numpy.linalg.pinv.html). At this moment, let us focus on the above comparison as we showed for the
|
|
To resolve this issue, we propose to use the Moore-Penrose pseudo-inverse method. This method calculates the generalized inverse of a matrix using its singular-value decomposition (SVD) and including all large singular values. We use the numpy inbuild function [`numpy.linalg.pinv()`](https://numpy.org/doc/stable/reference/generated/numpy.linalg.pinv.html). If $`\Sigma`$ is a $`n\times n`$ nonsingular matrix, then its inverse is given by
|
|
|
|
```math
|
|
|
|
\Sigma = U \: D \: V^T \ \ \text{or} \ \ \Sigma^{-1} = V \: D^{-1} \: U^T
|
|
|
|
```
|
|
|
|
|
|
|
|
At this moment, let us focus on the above comparison as we showed for the
|
|
`numpy.linalg.inv()` function.
|
|
`numpy.linalg.inv()` function.
|
|
|
|
|
|
<img src="uploads/4692d03ff868fcc538ab06803102a7c3/pinv.png" width="440" ><img src="uploads/8d64ddc718f1fe06d54b62ca6028d123/pinv_off_diag.png" width="440" >
|
|
<img src="uploads/4692d03ff868fcc538ab06803102a7c3/pinv.png" width="440" ><img src="uploads/8d64ddc718f1fe06d54b62ca6028d123/pinv_off_diag.png" width="440" >
|
... | | ... | |