stan-dev / stan-dev/math

log_mix(container, container) should check first argument is simplex

Open
#3,125 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature good first issue
Dominant language
C++
Stars
839
Forks
220
Avg merge
2d 4h
Merged PRs (30d)
14

Description

Description

The function log_mix taking two collections does not check that the first container is a simplex.

Expected Output

Rejection when the first argument is not a simplex, e.g.,

target += log_mix({0.5, 0.9}, {-1.2, -4.2});
Current Version:

v4.9.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 by locating the collection overload of log_mix and the validation tests for its arguments. Reproduce the issue with the Stan example in the report, then add coverage showing that a non-simplex first argument is rejected and confirm the existing valid cases still pass.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.