feat: add implementation of stats/base/dists/anglit/entropy#10620
feat: add implementation of stats/base/dists/anglit/entropy#10620bhargava-d16 wants to merge 3 commits intostdlib-js:developfrom
stats/base/dists/anglit/entropy#10620Conversation
Signed-off-by: Bhargav Dabhade <bhargava2005dabhade@gmail.com>
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: passed
- task: lint_package_json
status: passed
- task: lint_repl_help
status: passed
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: passed
- task: lint_javascript_tests
status: passed
- task: lint_javascript_benchmarks
status: passed
- task: lint_python
status: missing_dependencies
- task: lint_r
status: na
- task: lint_c_src
status: missing_dependencies
- task: lint_c_examples
status: missing_dependencies
- task: lint_c_benchmarks
status: missing_dependencies
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: passed
- task: lint_license_headers
status: passed
---
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: missing_dependencies
- task: lint_r
status: na
- task: lint_c_src
status: missing_dependencies
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
Coverage Report
The above coverage report was generated for the changes in this PR. |
Neerajpathak07
left a comment
There was a problem hiding this comment.
@bhargava-d16 Thanks for your PR's so far!! Also might be worth while to take a sneak peak through your other PR's to check if they follow similar changes.
| }); | ||
| sigma = uniform( 100, 0.1, 10.0, { | ||
| 'dtype': 'float64' | ||
| }); |
There was a problem hiding this comment.
| }); | |
| arrayOpts = { | |
| 'dtype': 'float64' | |
| }); | |
| mu = uniform( 100, -5.0, 5.0, arrayOpts ); | |
| sigma = uniform( 100, 0.1, 10.0, arrayOpts ); |
you can represent this a bit better this way.
| Location parameter. | ||
|
|
||
| sigma: number | ||
| Scale parameter. Must be greater than `0`. |
There was a problem hiding this comment.
| Scale parameter. Must be greater than `0`. | |
| sigma: number | |
| Scale parameter. |
Correct me if I am wrong here but we only describe what the particular parameter represents. To state that is must be greater than 0 is stated by L7 where we expect sigma to be greater than 0 else it will return NaN
|
|
||
| int main( void ) { | ||
| double mu; | ||
| double sigma; |
There was a problem hiding this comment.
| double sigma; | |
| int main( void ) { | |
| double sigma; | |
| double mu; |
Ordering by length
| mu = random_uniform( -5.0, 5.0 ); | ||
| sigma = random_uniform( 0.5, 5.0 ); | ||
| y = stdlib_base_dists_anglit_entropy( mu, sigma ); | ||
| printf( "mu: %lf, sigma: %lf, h(X;mu,sigma): %lf\n", mu, sigma, y ); |
There was a problem hiding this comment.
| printf( "mu: %lf, sigma: %lf, h(X;mu,sigma): %lf\n", mu, sigma, y ); | |
| printf( "μ: %lf, σ: %lf, h(X;μ,σ): %lf\n", mu, sigma, y ); |
Here we expect to represent the variables with their respective symbols.
| var mu = uniform( 10, -5.0, 5.0, opts ); | ||
| var sigma = uniform( 10, 0.5, 5.0, opts ); | ||
|
|
||
| logEachMap( 'μ: %lf, σ: %lf, H(μ,σ): %lf', mu, sigma, entropy ); |
There was a problem hiding this comment.
| logEachMap( 'μ: %lf, σ: %lf, H(μ,σ): %lf', mu, sigma, entropy ); | |
| logEachMap( 'μ: %lf, σ: %lf, H(X;μ,σ): %lf', mu, sigma, entropy ); |
Let's stay consistent with the symbolization to represent Entropy as per done in the corresponding JS file.
| var mu = uniform( 25, -5.0, 5.0, opts ); | ||
| var sigma = uniform( mu.length, 0.5, 5.0, opts ); | ||
|
|
||
| logEachMap( 'mu: %0.4f, sigma: %0.4f, h(X;mu,sigma): %0.4f', mu, sigma, entropy ); |
There was a problem hiding this comment.
Do update the documented version with the changes in the corresponding JS file.
| ```c | ||
| The function accepts the following arguments: | ||
|
|
||
| - **x**: `[in] double` input value. |
There was a problem hiding this comment.
| - **x**: `[in] double` input value. |
Anglit Entropy utilizes only 2 parameters mu and sigma. I think describing x here causes discrepancies in the documentation.
| mu = random_uniform( -5.0, 5.0 ); | ||
| sigma = random_uniform( 0.5, 10.0 ); | ||
| y = stdlib_base_dists_anglit_entropy( mu, sigma ); | ||
| printf( "mu: %lf, sigma: %lf, h(X;mu,sigma): %lf\n", mu, sigma, y ); |
There was a problem hiding this comment.
Same Comment but w.r.t the C examples.
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: passed
- task: lint_package_json
status: na
- task: lint_repl_help
status: passed
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: passed
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: passed
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: missing_dependencies
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
|
@Planeshifter I have made the requested changes. Please let me know if there are any further changes to be made |
|
@Planeshifter Just a follow up on this PR |
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Progresses #9960
Description
This pull request:
stats/base/dists/anglit/entropyRelated Issues
This pull request has the following related issues:
Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
@stdlib-js/reviewers