describe how to make sum-to-zero parameters "optional" in User's Guide
Nobody has claimed this yet.
- Dominant language
- TeX
- Stars
- 43
- Forks
- 133
- Avg merge
- 11h 32m
- Merged PRs (30d)
- 4
Description
I liked this suggestion from @WardBrian and think it should be in the User's Guide, because it's a tricky edge case. The context is sum-to-zero vectors, but if there isn't a section on the optionality-with-arrays trick, we should add a whole section.
Note that the fix will just mean your code will be rejected with a nicer error -- you still won't be able to declare a size-0 `sum_to_zero_vector`, since the number of free parameters for this type is one fewer than the declared size, like a simplex.To make one 'optional', you can either do
array[NB] sum_to_zero_vector[S]or declare it as size-1 when it isn't needed, which will make it have no free parameters under the hood:sum_to_zero_vector[NB ? S : 1]
Contributor guide
No contributing guide indexed for this repository
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 sum-to-zero vector section in the User's Guide and read the linked discussion in Stan issue #3366. Document how arrays or a size-1 declaration can make sum-to-zero parameters optional, while noting that size-0 declarations remain invalid. Done means the edge case and both suggested approaches are clearly explained in the guide.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- tex
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100