Skip to content

Commit

Permalink
improved rng
Browse files Browse the repository at this point in the history
  • Loading branch information
snaketron committed Feb 14, 2024
1 parent 5795904 commit da979c8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions inst/stan/dgu.stan
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@ functions {
}

int zibb_rng(int y, int n, real mu, real phi, real kappa) {
if(y==0) {
if (bernoulli_rng(kappa) == 1) {
return (0);
} else {
return (beta_binomial_rng(n, mu * phi, (1 - mu) * phi));
}
if (bernoulli_rng(kappa) == 1) {
return (0);
} else {
return (beta_binomial_rng(n, mu * phi, (1 - mu) * phi));
}
return (beta_binomial_rng(n, mu * phi, (1 - mu) * phi));
}

real z_rng(real a, real b, real zi) {
Expand Down

0 comments on commit da979c8

Please sign in to comment.