stan-dev / stan-dev/docs

describe how to make sum-to-zero parameters "optional" in User's Guide

Open
#909 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
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

  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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.