-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Moore-Penrose inverse #469
base: develop
Are you sure you want to change the base?
Commits on Nov 7, 2023
-
Test Eigenvectors can handle numerical imprecision
To mimic the error found in the QR algorithm, we have to test with matrices that have duplicate eigenvalues and introduce numerical precision errors. To do this, a list of perturbed eigenvalues is passed to the eigenvectors method. The perturbation is achieved by adding a random +/- offset on an order of magnitude smaller than the default matrix error. This should allow the math to work out fine while causing the floating point comparison to fail.
Configuration menu - View commit details
-
Copy full SHA for 32f8bff - Browse repository at this point
Copy the full SHA 32f8bffView commit details -
Replace array_search with floating-point filter
array_search seems to fail in most cases when looking for a float in an array of floats. And even if it does find a match, if the key is 0, php evaluates `!0` to true. To find a match, we can instead loop through and compare the numbers with `Arithmetic::almostEqual` and then explicitly check if `$key === false`
Configuration menu - View commit details
-
Copy full SHA for 163c0f9 - Browse repository at this point
Copy the full SHA 163c0f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 67c9097 - Browse repository at this point
Copy the full SHA 67c9097View commit details -
Add NumericMatrix->pseudoInverse()
Calculates the Moore-Penrose inverse of the matrix using SVD
Configuration menu - View commit details
-
Copy full SHA for 50a3147 - Browse repository at this point
Copy the full SHA 50a3147View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8331a97 - Browse repository at this point
Copy the full SHA 8331a97View commit details -
Configuration menu - View commit details
-
Copy full SHA for 48b5b6d - Browse repository at this point
Copy the full SHA 48b5b6dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 93eddf9 - Browse repository at this point
Copy the full SHA 93eddf9View commit details -
If it isn't, create a permutation matrix, P, such that SP is diagonal. Multiply V by its inverse to balance the eqn.
Configuration menu - View commit details
-
Copy full SHA for efdfcf6 - Browse repository at this point
Copy the full SHA efdfcf6View commit details -
After diagonalizing S and ensuring its values are positive, check that its values are sorted. If not, permute it
Configuration menu - View commit details
-
Copy full SHA for e622e7f - Browse repository at this point
Copy the full SHA e622e7fView commit details
Commits on Dec 4, 2023
-
SVD: Refactor diagonalization for 'tall' matrices
The method of diagonalization permuted columns. However, if the row count exceeds the column count, there's a chance the column permutation won't diagonalize S. To address this, the diagonalization has been refactored to sort on the bigger dimension.
Configuration menu - View commit details
-
Copy full SHA for 379bdb4 - Browse repository at this point
Copy the full SHA 379bdb4View commit details -
Configuration menu - View commit details
-
Copy full SHA for aa34e9a - Browse repository at this point
Copy the full SHA aa34e9aView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd4c22c - Browse repository at this point
Copy the full SHA fd4c22cView commit details -
Configuration menu - View commit details
-
Copy full SHA for b52e36a - Browse repository at this point
Copy the full SHA b52e36aView commit details -
SVD: allow zero rows in diagonalize
Because 0 can be a singular value, the S matrix can have zero-entries along the diagonal. To allow this, we first check if the vector magnitude is 0 before calling getStandardBasisIndex
Configuration menu - View commit details
-
Copy full SHA for 746303b - Browse repository at this point
Copy the full SHA 746303bView commit details -
SVD: add error to getStandardBasisIndex
Since we're checking for non-zero components using Arithmetic::almostEqual, it seems appropriate to pass in the error of the matrix
Configuration menu - View commit details
-
Copy full SHA for 8399246 - Browse repository at this point
Copy the full SHA 8399246View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ff591e - Browse repository at this point
Copy the full SHA 3ff591eView commit details -
Add two failures to SVDTestCase
Adds the case from the pseudoinverse test
Configuration menu - View commit details
-
Copy full SHA for 9d3c271 - Browse repository at this point
Copy the full SHA 9d3c271View commit details -
Check for floating point in SVD diagonal
If the diagonal has duplicate eigenvalues that are floats, the sort operation can shuffle them around. The strict equivalence then fails when it technically should not. Instead, we can compare the diagonal entries to the sorted entries using `AlmostEqual` with the matrix error for tolerance.
Configuration menu - View commit details
-
Copy full SHA for 9764083 - Browse repository at this point
Copy the full SHA 9764083View commit details -
Numeric: use error in isRectangularDiagonal
Previously was just using the default error of `Support::isZero`
Configuration menu - View commit details
-
Copy full SHA for 77de387 - Browse repository at this point
Copy the full SHA 77de387View commit details