-
-
Notifications
You must be signed in to change notification settings - Fork 451
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
Fix bug 1218 #1236
Fix bug 1218 #1236
Conversation
Wouldn't it be better to implement something like Welford's algorithm? |
@@ -111,6 +111,7 @@ serde_json = "1.0" | |||
rand_xorshift = "0.3" | |||
rand_isaac = "0.3" | |||
criterion = { version = "0.4", features = ["html_reports"] } | |||
nalgebra = { path = ".", features = ["debug", "compare", "rand", "macros"]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s an interesting trick!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Did it because rust-analyzer was giving errors whenever I opened the tests
folder, since it only parses the code reachable with the default features
Thanks! |
A proposed fix to bug 1218. The bug was a typical case of Catastrophic cancellation, where the variance was computed as$E[X^2] - E[X]^2$ and not as $E[(X-E[X])^2]$ . The bug is fixed now, the only downside I see is the usage of two folds over the array, one of which is for computation of the mean of the matrix entries $E[X]$ . Looking forward to any feedback.