Skip to content
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

Use pseudo inverse to match matlab/book behaviour #4

Open
mahdiolfat opened this issue Nov 21, 2023 · 1 comment
Open

Use pseudo inverse to match matlab/book behaviour #4

mahdiolfat opened this issue Nov 21, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@mahdiolfat
Copy link
Owner

No description provided.

@mahdiolfat
Copy link
Owner Author

The mrdivide(A, B) matlab function (or simply A / B) serves multiple purposes, one of which is a least squares fit "if A is a rectangular m-by-n matrix with m ~= n, and B is a mtrix with n columns...", see https://www.mathworks.com/help/matlab/ref/mrdivide.html

The equivalent of this in numpy is achieved with numpy.linalg.lstsq(A.T, B.T).T

@mahdiolfat mahdiolfat added the bug Something isn't working label Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant