Title: Implement Moore-Penrose pseudoinverse for PMMatrix · Issue #260 · PolyMathOrg/PolyMath · GitHub
Open Graph Title: Implement Moore-Penrose pseudoinverse for PMMatrix · Issue #260 · PolyMathOrg/PolyMath
X Title: Implement Moore-Penrose pseudoinverse for PMMatrix · Issue #260 · PolyMathOrg/PolyMath
Description: https://en.wikipedia.org/wiki/Moore–Penrose_inverse A simple (but slightly time-consuming) implementation can be based on SVD: PMMatrix >> pseudoinverse | svd u s v sPseudoinverse | svd := PMSingularValueDecomposition decompose: ...
Open Graph Description: https://en.wikipedia.org/wiki/Moore–Penrose_inverse A simple (but slightly time-consuming) implementation can be based on SVD: PMMatrix >> pseudoinverse | svd u s v sPseudoinverse | svd := ...
X Description: https://en.wikipedia.org/wiki/Moore–Penrose_inverse A simple (but slightly time-consuming) implementation can be based on SVD: PMMatrix >> pseudoinverse | svd u s v sPseudoinverse | s...
Opengraph URL: https://github.com/PolyMathOrg/PolyMath/issues/260
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Implement Moore-Penrose pseudoinverse for PMMatrix","articleBody":"https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_inverse\r\n\r\nA simple (but slightly time-consuming) implementation can be based on SVD:\r\n```st\r\nPMMatrix \u003e\u003e pseudoinverse\r\n\t| svd u s v sPseudoinverse |\r\n\tsvd := PMSingularValueDecomposition decompose: matrix.\r\n\r\n\tu := svd leftSingularMatrix.\r\n\ts := svd diagonalSingularValueMatrix.\r\n\tv := svd rightSingularMatrix.\r\n\r\n\tsPseudoinverse := self pseudoinverseOfDiagonal: s.\r\n\t^ v * sPseudoinverse * u transpose\r\n```\r\n```st\r\nPMMatrix \u003e\u003e pseudoinverseOfDiagonal: aMatrix [\r\n\t\"To get pseudoinverse of a diagonal rectangular matrix, we take reciprocal of any no-zero element of the main diagonal, leaving all zeros in place. Then we transpose the matrix.\"\r\n\r\n\t| pseudoinverse diagonalSize |\r\n\r\n\t\"Rows become columns and columns become rows because we transpose\"\r\n\tpseudoinverse := PMMatrix\r\n\t\tzerosRows: aMatrix numberOfColumns\r\n\t\tcols: aMatrix numberOfRows.\r\n\r\n\t\"The size of the main diagonal of a rectangular matrix is its smallest dimension\"\r\n\tdiagonalSize := aMatrix numberOfRows min: aMatrix numberOfColumns.\r\n\r\n\t\"Inverting the elements on the main diaginal\"\r\n\t1 to: diagonalSize do: [ :i |\r\n\t\tpseudoinverse at: i at: i put: ((aMatrix at: i at: i) = 0\r\n\t\t\tifTrue: [ 0 ] ifFalse: [ 1 / (aMatrix at: i at: i) ]) ].\r\n\r\n\t^ pseudoinverse\r\n```","author":{"url":"https://github.com/olekscode","@type":"Person","name":"olekscode"},"datePublished":"2022-04-26T18:45:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/260/PolyMath/issues/260"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1300e9f6-1f19-73ad-a101-99317bc3d474 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DA52:271EA5:CCD21:10991F:69802E60 |
| html-safe-nonce | f66bc95fc4453d9a6f3ea2fef90697a913e3e40e1f43bddbe578a114d74d6b3a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTUyOjI3MUVBNTpDQ0QyMToxMDk5MUY6Njk4MDJFNjAiLCJ2aXNpdG9yX2lkIjoiNzA4Mjc0NjgzMDYyNjIzODA0OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c3b54d874216ceddc71db198a2051ce23c7c1c290d5674b5b7d1ec3486b5bb30 |
| hovercard-subject-tag | issue:1216345028 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PolyMathOrg/PolyMath/260/issue_layout |
| twitter:image | https://opengraph.githubassets.com/febcea7e4b08fba5265b7915890dc80c4d04f77fe60e6295232816ec10e1ddf7/PolyMathOrg/PolyMath/issues/260 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/febcea7e4b08fba5265b7915890dc80c4d04f77fe60e6295232816ec10e1ddf7/PolyMathOrg/PolyMath/issues/260 |
| og:image:alt | https://en.wikipedia.org/wiki/Moore–Penrose_inverse A simple (but slightly time-consuming) implementation can be based on SVD: PMMatrix >> pseudoinverse | svd u s v sPseudoinverse | svd := ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | olekscode |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/PolyMathOrg/PolyMath git https://github.com/PolyMathOrg/PolyMath.git |
| octolytics-dimension-user_id | 17797985 |
| octolytics-dimension-user_login | PolyMathOrg |
| octolytics-dimension-repository_id | 54906925 |
| octolytics-dimension-repository_nwo | PolyMathOrg/PolyMath |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 54906925 |
| octolytics-dimension-repository_network_root_nwo | PolyMathOrg/PolyMath |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width