-
-
Notifications
You must be signed in to change notification settings - Fork 685
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
bench: refactor random number generation in stats/base/dists/levy
#5883
base: develop
Are you sure you want to change the base?
Conversation
…ts/levy Signed-off-by: hemantmm <hemant29mehta@gmail.com>
Coverage Report
The above coverage report was generated for the changes in this PR. |
Signed-off-by: hemantmm <hemant29mehta@gmail.com>
Signed-off-by: hemantmm <hemant29mehta@gmail.com>
Signed-off-by: hemantmm <hemant29mehta@gmail.com>
Signed-off-by: hemantmm <hemant29mehta@gmail.com>
Signed-off-by: hemantmm <hemant29mehta@gmail.com>
Signed-off-by: hemantmm <hemant29mehta@gmail.com>
@anandkaranubc have a look at the PR. |
@kgryte have a look at the PR. |
x = new Float64Array( len ); | ||
for ( i = 0; i < len; i++ ) { | ||
mu[ i ] = uniform( -50.0, 50.0 ); | ||
x[ i ] = uniform( mu[ i ], 50.0 ); |
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.
x[ i ] = uniform( mu[ i ], 50.0 ); | |
x[ i ] = uniform( mu[ i ], 100.0 ); |
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.
The range should remain the same as original. This also applies throughout the PR.
mycdf = cdf.factory( mu, scale ); | ||
for ( i = 0; i < len; i++ ) { | ||
x[ i ] = uniform( -4.0, 4.0 ); |
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.
x[ i ] = uniform( -4.0, 4.0 ); | |
x[ i ] = uniform( 0.0, 4.0 ); |
Same comment as above.
mu = new Float64Array( len ); | ||
c = new Float64Array( len ); | ||
for ( i = 0; i < len; i++ ) { | ||
mu[ i ] = ( uniform( -50.0, 50.0 ) ); |
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.
mu[ i ] = ( uniform( -50.0, 50.0 ) ); | |
mu[ i ] = uniform( EPS, 10.0 ); |
No need of outside brackets.
c = new Float64Array( len ); | ||
for ( i = 0; i < len; i++ ) { | ||
mu[ i ] = ( uniform( -50.0, 50.0 ) ); | ||
c[ i ] = ( uniform( EPS, 20.0 ) ); |
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 as above.
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.
for this c[ i ] = ( uniform( EPS, 20.0 ) );
i have to make the changes as EPS,10.0
?
dist.c = y; | ||
if ( dist.c !== y ) { | ||
dist.c = y[ i % len ]; | ||
if ( dist.c !== y[ i % len] ) { |
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.
if ( dist.c !== y[ i % len] ) { | |
if ( dist.c !== y[ i % len ] ) { |
dist = new Levy( mu, c ); | ||
for ( i = 0; i < len; i++ ) { | ||
x[ i ] = uniform( EPS, 100.0 ); |
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.
x[ i ] = uniform( EPS, 100.0 ); | |
x[ i ] = uniform( 1.0 + EPS, 100.0 ); |
@hemantmm, thanks for raising a PR for this issue. I have left a few comments that need to be addressed. These comments apply throughout the PR, including areas where they were not explicitly mentioned. Additionally, please review this discussion comment: #4993 (comment) and incorporate the suggested changes as well. Also, the title should be updated to (for consistency): bench: refactor random number generation in (Note: The backticks should be included around Good luck! |
stats/base/dists/levy
…ts/levy
Resolves #4977
Description
This pull request:
Related Issues
This pull request:
stats/base/dists/levy
#4977Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers