Repository navigation
feat: add stats/base/dists/wald/logcdf - #13880
Conversation
---
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_pkg_readmes
status: na
- task: lint_markdown_docs
status: na
- 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: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- 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
---
---
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_pkg_readmes
status: passed
- task: lint_markdown_docs
status: na
- task: lint_markdown
status: na
- 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: na
- 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
---
Coverage Report
The above coverage report was generated for the changes in this PR. |
| function gen( x, mu, lambda, name ) | ||
| z = Array{Float64}( undef, length(x) ); | ||
| for i in eachindex(x) | ||
| z[ i ] = log( cdf( InverseGaussian( mu[i], lambda[i] ), x[i] ) ); |
There was a problem hiding this comment.
For this package the fixtures for testing were generated in the following manner. The reason being I went with this was that while using
logcdf( InverseGaussian( mu[i], lambda[i] ), x[i] ) );The fixtures generated had higher diffs and even while testing the ULP diffs would naturally exceed 1500.
There was a problem hiding this comment.
In general, we shouldn't be "cooking" the tests to get the results we want. If there are meaningful discrepancies with equivalent APIs in reference implementations, the answer is to investigate and understand why the discrepancies exist in the first place. Some may be legitimate; others may encourage us to update our implementation. But simply seeking out the answer that we want in order to make the tests "look better" is never--never--the answer. That simply is not the stdlib way.
Planeshifter
left a comment
There was a problem hiding this comment.
Looks good to me after some clean-up.
Most notably, the implementation was tested against log(cdf(x)) of Julia instead of its dedicated logcdf function, masking numerical issue in the right tail where the sum ≈ 1 gives unbounded relative error as logCDF → 0⁻.
The high ULP difference is consistent with what we have for normal/logcdf after regenerating the fixtures and updating the implementation.
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Resolves None.
Description
This pull request:
stats/base/dists/wald/logcdf.Related 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
{{TODO: add disclosure if applicable}}
@stdlib-js/reviewers