-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat: add Wald distribution PDF #9324
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
base: develop
Are you sure you want to change the base?
Conversation
| if ( | ||
| isnan( mu ) || | ||
| isnan( lambda ) | ||
| ) { | ||
| return constantFunction( NaN ); | ||
| } | ||
| if ( mu <= 0.0 ) { | ||
| return constantFunction( NaN ); | ||
| } | ||
| if ( lambda < 0.0 ) { | ||
| return constantFunction( NaN ); | ||
| } |
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.
You can go ahead and consolidate these into a single if condition, given that all result in constantFunction( NaN ).
| if ( | ||
| isnan( x ) || | ||
| isnan( mu ) || | ||
| isnan( lambda ) | ||
| ) { | ||
| return NaN; | ||
| } | ||
| if ( mu <= 0.0 ) { | ||
| return NaN; | ||
| } | ||
| if ( lambda < 0.0 ) { | ||
| return NaN; | ||
| } |
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.
Same comment about collapsing the if conditions into one.
| if ( | ||
| stdlib_base_is_nan( x ) || | ||
| stdlib_base_is_nan( mu ) || | ||
| stdlib_base_is_nan( lambda ) | ||
| ) { | ||
| return 0.0/0.0; // NaN | ||
| } | ||
| if ( mu <= 0.0 ) { | ||
| return 0.0/0.0; // NaN | ||
| } | ||
| if ( lambda < 0.0 ) { | ||
| return 0.0/0.0; // NaN | ||
| } |
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.
Same comment.
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.
Overall, this is looking good thus far!
Resolves #209
Description
This pull request:
Tests, docs, examples and benchmark is yet to added, pending approval of the core implementation.
Related Issues
This pull request has the following related issues:
Questions
No.
Other
I have used this Wiki page as a reference.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
@stdlib-js/reviewers