docs icon indicating copy to clipboard operation
docs copied to clipboard

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

Open mitzimorris opened this issue 1 year ago • 1 comments

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?

mitzimorris avatar Apr 10 '24 17:04 mitzimorris

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.

bob-carpenter avatar Apr 10 '24 17:04 bob-carpenter