stan-dev / stan-dev/math

unit_vector transform should work with zero-length unconstrained

Open
#2,569 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

Unit vector transforms should work with a zero-length unconstrained vector.

Example

The size-1 unit vector is just a constant [1]'. This should be the result of transforming the unconstrained 0-vector []'.

Expected Output

Stan programs that use:

parameters {
  unit_vector[1] alpha;
}

should lead to alpha == [1]'.

Current Version:

v4.1.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 unit_vector transform entry point and its existing tests. Reproduce the Stan program with unit_vector[1] alpha and the unconstrained 0-vector, then verify that the transformed value is [1] and that the relevant tests 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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.