Skip to content

feat: add @stdlib/stats/strided/dttest#11228

Open
shaktimaanO-O wants to merge 2 commits intostdlib-js:developfrom
shaktimaanO-O:feat/stats-strided-dttest
Open

feat: add @stdlib/stats/strided/dttest#11228
shaktimaanO-O wants to merge 2 commits intostdlib-js:developfrom
shaktimaanO-O:feat/stats-strided-dttest

Conversation

@shaktimaanO-O
Copy link
Copy Markdown

@shaktimaanO-O shaktimaanO-O commented Mar 30, 2026

This adds @stdlib/stats/strided/dttest, a one-sample Student's t-test for double-precision strided arrays. Part of #179.

Modeled closely on dztest. Main differences are that sigma is not a parameter since it gets estimated from the data using dmeanvar in a single pass, the CDF is Student's t instead of normal, and the output includes df and mean fields. Minimum N is 2 since you need at least 2 points to estimate variance.

Files included: lib/ndarray.js, lib/dttest.js, lib/main.js, lib/index.js, test/test.js, benchmark/benchmark.js, examples/index.js, docs/repl.txt, docs/types/index.d.ts, README.md

JS only for now. The t/cdf C backend is blocked because betainc has no C implementation yet.

Reference check against R: t.test(c(4,4,6,6,5), mu=0) gives t=11.18034, df=4, p=0.000369. dttest gives statistic=11.180340, df=4, pValue=0.000364.

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

⚠️ Issue Reference Review

An automated check found potentially unrelated issue/PR references in this PR:

Reference Assessment Reasoning
#179 suspicious PR adds @stdlib/stats/strided/dttest (Student's t-test), but issue #179 is an RFC specifically requesting the Boltzmann distribution (@stdlib/stats/base/dists/boltzmann). A Student's t-test and the Boltzmann distribution are unrelated statistical topics.

Why this matters: GitHub automatically closes issues referenced with closing keywords (Resolves, Closes, Fixes) when the PR is merged. Incorrect references can accidentally close unrelated issues.

What to do:

  • If the reference is correct, no action needed. This check may produce false positives.
  • If the reference is incorrect, please update your PR description.

This assessment was generated by an AI model and is informational only.

Generated by Check PR Issue References ·

@github-actions github-actions bot mentioned this pull request Mar 31, 2026
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