unit_vector transform should work with zero-length unconstrained
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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