stan-dev / docs

Documentation for the Stan language and CmdStan
https://mc-stan.org/docs/
Other
37 stars 107 forks source link

Functions Refernce: return type of `bernoulli_rng` - `R` or `ints`? #756

Closed mitzimorris closed 3 months ago

mitzimorris commented 4 months ago

Summary:

The bernoulli_rng function - https://mc-stan.org/docs/functions-reference/binary_distributions.html#bernoulli-distribution has return type R:

R bernoulli_rng(reals theta)

Shouldn't this be ints?

Description:

Description: https://mc-stan.org/docs/functions-reference/conventions_for_probability_functions.html#return-type

Discrete distributions return ints and continuous distributions return reals, each of appropriate size. The symbol R denotes such a return type.

What about binary distributions?

bob-carpenter commented 4 months ago

Shouldn't this be ints?

Yes. It will be int if theta is real and int[] if theta is a one-dimensional array, vector, or row vector.