small update

This commit is contained in:
Morten Hjorth-Jensen
2023-09-03 14:22:23 +02:00
parent 3cc1f701c0
commit 7f3ecb7bb7
103 changed files with 16669 additions and 1168 deletions
+4 -2
View File
@@ -147,9 +147,11 @@ values and the column vectors of $\bm{V}$.
===== Code for SVD and Inversion of Matrices =====
How do we use the SVD to invert a matrix $\bm{X}^\bm{X}$ which is singular or near singular?
The simple answer is to use the linear algebra function for pseudoinvers, that is
The simple answer is to use the linear algebra function for the computation of the pseudoinverse of a given matrix $\bm{X}$, that is
!bc pycod
Ainv = np.linlag.pinv(A)
import numpy as np
X = np.array( [ [1,2,3],[2,4,5],[3,5,6]])
Xinv = np.linlag.pinv(X)
!ec
Let us first look at a matrix which does not causes problems and write our own function where we just use the SVD.