stan-dev / stan-dev/math

Beta cdf/lcdf/lccdf prob tests wrong

Open
#1,976 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

distributions testing
Dominant language
C++
Stars
839
Forks
220
Avg merge
2d 4h
Merged PRs (30d)
14

Description

Description

The cdf_function is supposed to be a reference implementation (see the exponential version as an example).

The beta distribution in Stan is just testing against itself:
https://github.com/stan-dev/math/blob/develop/test/prob/beta/beta_cdf_test.hpp
https://github.com/stan-dev/math/blob/develop/test/prob/beta/beta_cdf_log_test.hpp
https://github.com/stan-dev/math/blob/develop/test/prob/beta/beta_cdf_log_test.hpp

I'm not sure of the value of a lot of the reference implementations in the test framework (I assume they're just copied from early implementations in the library), but this is still a bit of a blindspot in the tests.

Current Version:

v3.2.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with test/prob/beta/beta_cdf_test.hpp and test/prob/beta/beta_cdf_log_test.hpp, then compare their structure with test/prob/exponential/exponential_cdf_test.hpp. Inspect how cdf_function is used and update the beta cdf, lcdf, and lccdf probability tests so they use an independent reference rather than testing the implementation against itself. Run the beta probability test suite to verify the reference checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.