Skip to content

feat: add stats/base/dists/halfnormal/pdf#9694

Open
Om-A-osc wants to merge 11 commits intostdlib-js:developfrom
Om-A-osc:feat/halfnormal-pdf
Open

feat: add stats/base/dists/halfnormal/pdf#9694
Om-A-osc wants to merge 11 commits intostdlib-js:developfrom
Om-A-osc:feat/halfnormal-pdf

Conversation

@Om-A-osc
Copy link
Copy Markdown
Contributor

Progresses #9416.

Description

This pull request:

  • Adds the probability density function (PDF) implementation for the half-normal distribution.
  • Includes JavaScript and native implementations, along with tests, benchmarks, examples, and Julia fixtures for validation.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance.

I used AI assistance to verify the mathematical formula for the half-normal PDF and to confirm expected numerical values.


@stdlib-js/reviewers

---
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: 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
---
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Jan 11, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

👋 Hi there! 👋

And thank you for opening your first pull request! We will review it shortly. 🏃 💨

Getting Started

Next Steps

  1. A project maintainer will approve GitHub Actions workflows for your PR.
  2. All CI checks must pass before your submission can be fully reviewed.
  3. You'll need to address any failures in linting or unit tests.

Running Tests Locally

You can use make to run any of the CI commands locally from the root directory of the stdlib repository:

# Run tests for all packages in the math namespace:
make test TESTS_FILTER=".*/@stdlib/math/.*"

# Run benchmarks for a specific package:
make benchmark BENCHMARKS_FILTER=".*/@stdlib/math/base/special/sin/.*"

If you haven't heard back from us within two weeks, please ping us by tagging the "reviewers" team in a comment on this PR.

If you have any further questions while waiting for a response, please join our Zulip community to chat with project maintainers and other community members.

We appreciate your contribution!

Documentation Links

@stdlib-bot stdlib-bot added First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review. labels Jan 11, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented Jan 11, 2026

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/halfnormal/pdf $\color{green}279/279$
$\color{green}+0.00%$
$\color{green}21/21$
$\color{green}+0.00%$
$\color{green}4/4$
$\color{green}+0.00%$
$\color{green}279/279$
$\color{green}+0.00%$

The above coverage report was generated for the changes in this PR.

Copy link
Copy Markdown
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening your first PR!

Please address the review comments and workflow failures.

Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/docs/repl.txt Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/docs/repl.txt Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/test/test.factory.js Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/src/pdf.c Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/src/pdf.c Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/test/test.factory.js Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/test/test.factory.js Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/test/test.factory.js Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/test/test.pdf.js Outdated
---
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: passed
  - 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
    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: passed
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - 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
---
@Planeshifter Planeshifter changed the title feat: add implementation of halfnormal/pdf feat: add stats/base/dists/halfnormal/pdf Jan 11, 2026
Copy link
Copy Markdown
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR should be getting close; left one more round of comments.

Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/README.md Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/README.md Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/README.md
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/test/test.factory.js Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/test/test.pdf.js Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/docs/types/index.d.ts Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/src/pdf.c Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/lib/factory.js Outdated
---
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: 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
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - 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: passed
  - task: lint_license_headers
    status: passed
---
@Om-A-osc
Copy link
Copy Markdown
Contributor Author

Hello @Planeshifter, I’ve updated the PR with the changes you requested and addressed the new comments. Could you please take another look when you have time? Let me know if everything looks good to proceed with merging. Thank you!

@Om-A-osc Om-A-osc requested a review from Planeshifter January 14, 2026 14:59
Copy link
Copy Markdown
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did another pass.

Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/manifest.json Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/manifest.json Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/examples/c/example.c Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/test/test.js Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/test/test.native.js Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/test/test.native.js Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/test/test.native.js Outdated
---
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: 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: 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
---
@Om-A-osc
Copy link
Copy Markdown
Contributor Author

@Planeshifter Thank you for carefully reviewing my changes. This is my first time contributing to stdlib, and I really appreciate you taking the time to point out and help me correct my mistakes. I’ve addressed your previous comments and made the requested changes please have another look and let me know if everything looks good now.

@Om-A-osc Om-A-osc requested a review from Planeshifter January 18, 2026 18:26
@stdlib-bot stdlib-bot removed the First-time Contributor A pull request from a contributor who has never previously committed to the project repository. label Jan 22, 2026
Copy link
Copy Markdown
Member

@Planeshifter Planeshifter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left another round of comments.

Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/src/main.c
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/README.md Outdated
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/README.md
Comment thread lib/node_modules/@stdlib/stats/base/dists/halfnormal/pdf/benchmark/benchmark.js Outdated
@Planeshifter Planeshifter added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Mar 1, 2026
---
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: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - 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: passed
  - 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
---
@Om-A-osc
Copy link
Copy Markdown
Contributor Author

Om-A-osc commented Mar 1, 2026

@Planeshifter did the changes.

@Om-A-osc Om-A-osc requested a review from Planeshifter March 1, 2026 07:44
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Changes Pull request which needs changes before being merged. Needs Review A pull request which needs code review. Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants