Skip to content

Inconsistency between sections 8.4 and 9.5 of the Stan Reference Manual #196

@MRvdMeer

Description

@MRvdMeer

Summary:

Hi, there seems to be a small inconsistency in the Stan Reference Manual: sections 8.4 and 9.5 seem to contradict each other.

Description:

Section 8.4 (Program Block: transformed data) reads:

Restriction on Operations in transformed data

The statements in the transformed data block are designed to be executed once and have a deterministic result. Therefore, log probability is not accumulated and sampling statements may not be used. Random number generating functions are also prohibited.

Section 9.5 (User-Defined Functions: Function Bodies) reads:

Random Number Generating Functions

Functions that call random number generating functions in their bodies must have a name that ends in _rng; attempts to use random-number generators in other functions lead to a compile-time error.

Like other random number generating functions, user-defined functions with names that end in _rng may be used only in the generated quantities block and transformed data block, or within the bodies of user-defined functions ending in _rng.

After some quick testing it seems that the text in 9.5 is correct - you can use _rng functions in the transformed data block. I'd propose to simply remove that one sentence from section 8.4.

Current Version:

v2.23

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions