Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mitzimorris opened this issue Apr 10, 2024 · 1 comment
Closed

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

mitzimorris opened this issue Apr 10, 2024 · 1 comment
Labels
question Further information is requested

Comments

@mitzimorris
Copy link
Member

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 mitzimorris added the question Further information is requested label Apr 10, 2024
@bob-carpenter
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants