-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Feature/incrwmean #256
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
Feature/incrwmean #256
Conversation
|
@MatthewCochrane This is awesome! For an incremental algorithm which only relies on maintaining the weighted mean and the sum of weights, see here. Re: default weight. Personally, I would require a weight to always be provided. Meaning, we would not support a default weight. Otherwise, when reading code which uses Re: TypeScript files. Yes! We only recently started adding declaration files and have yet to add declaration files to the Thanks for working on this! |
|
Not a problem, happy to work on it! Yep, that's fair. I'm not sure I'd call it 'out of band knowledge' since it's in the jsdoc header, and most (sane) people use editors with documentation lookup these days. Though the saving would be quite small and you're right that it's probably worth the small amount of extra verbosity to save potential misinterpretations. I removed the default, as suggested :). Thanks, for that link. I've updated the algorithm to use the one from the paper. It benchmarks very slightly faster than the one I had implemented. |
kgryte
left a comment
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.
@MatthewCochrane Thanks for updating! Left some comments and suggestions. Once resolved, this should be ready for merge!
Co-Authored-By: MatthewCochrane <matthew.cochrane.eng@gmail.com>
kgryte
left a comment
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.
@MatthewCochrane Looks great! Thanks!
Resolves #45 .
Checklist
develop.developbranch.Description
This pull request:
Related Issues
This pull request:
incrwmean#45Questions
Do you agree that the weight should default to 1.0? then
incrwmeanwith one parameter is equivalient toincrmean(though slower).Other
I'm not sure that other incremental stat functions have typescript definitions. Didn't see why I shouldn't add one for this though. Let me know if there's some reason I shouldn't.
I wasn't aware of a more efficient way to implement this algorithm, I don't believe there's a shortcut like for
incrmean.@stdlib-js/reviewers