We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ints bernoulli_rng(real theta)
Add implementation of bernoulli_rng which generates an array of bernoulli outcomes for a single value of theta.
bernoulli_rng
theta
Currently, it is necessary to use a loop, e.g.
real theta = beta_rng(1, 1); array[N] int y; for (n in 1:N) { y[n] = bernoulli_rng(theta); }
The vectorized alternative is:
real theta = beta_rng(1, 1); array[N] int y; y = bernoulli_rng(rep_array(theta, N_obs));
This is problematic for 2 reasons:
thetas
It would be nice to be able to do the following:
real theta = beta_rng(1, 1); array[N] int y; y = bernoulli_rng(rtheta);
v4.8.1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
Add implementation of
bernoulli_rng
which generates an array of bernoulli outcomes for a single value oftheta
.Example
Currently, it is necessary to use a loop, e.g.
The vectorized alternative is:
This is problematic for 2 reasons:
thetas
Expected Output
It would be nice to be able to do the following:
Current Version:
v4.8.1
The text was updated successfully, but these errors were encountered: