Skip to content
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

[Add]: Create new package stats/incr/nanwmean to handle NaN values #5743

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ChaitanyaZunzurkar
Copy link

@ChaitanyaZunzurkar ChaitanyaZunzurkar commented Mar 2, 2025

Resolves #{{issue number}}.

Description

This pull request introduces the @stdlib/stats/incr/nanwmean package, which computes the incremental weighted arithmetic mean while handling NaN values. Unlike @stdlib/stats/incr/wmean, this implementation specifically excludes NaN values in the mean calculation.

Key Changes:

  • Adds a NaN-handling mechanism to the weighted arithmetic mean computation.
  • Ensures that NaN values do not propagate through the mean calculation.
  • Tests, documentation, and examples have been updated accordingly to reflect this behavior.

Related Issues

This pull request resolves #5743.

Tests and Benchmarks

All tests, examples, and benchmarks have been successfully run and validated:

  • Unit tests for proper NaN handling.
  • Examples demonstrating the behavior with NaN values.
  • Benchmarks to assess performance.

Checklist

  • Tests have been added or updated.
  • Documentation and examples have been updated.
  • Benchmarks have been validated.
  • Pull request follows the contributing guidelines.
  • Read, understood, and followed the contributing guidelines

@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. 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 Mar 2, 2025
@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot
Copy link
Contributor

Hello! 👋

I've noticed that your commit doesn't contain the expected YAML metadata blocks. This typically happens when your development environment isn't properly set up with the stdlib git hooks.

Here's how to fix this:

  1. Install project dependencies (run this command in the top-level directory of the project):

    make install
  2. Initialize the development environment (this sets up the Git hooks among other things):

    make init

If you're still having issues, please check our development guide for more information.

Thank you for your contribution!

Copy link
Contributor

@stdlib-bot stdlib-bot left a comment

Choose a reason for hiding this comment

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

👋 Hi there! 👋

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

@stdlib-bot
Copy link
Contributor

stdlib-bot commented Mar 2, 2025

Coverage Report

Package Statements Branches Functions Lines
stats/incr/nanwmean $\color{red}190/194$
$\color{green}+97.94\%$
$\color{red}12/15$
$\color{green}+80.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{red}190/194$
$\color{green}+97.94\%$

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

@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
---

---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
---

---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
---

---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
---
@ChaitanyaZunzurkar ChaitanyaZunzurkar force-pushed the feature/stats-incr-nanwmean branch from 536ec86 to 7553fc6 Compare March 3, 2025 13:52
@stdlib-bot
Copy link
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. Statistics Issue or pull request related to statistical functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants