alashworth / test-issue-import

0 stars 0 forks source link

multiple outputs of RNGs #75

Open alashworth opened 5 years ago

alashworth commented 5 years ago

Issue by bob-carpenter Monday Jul 20, 2015 at 15:07 GMT Originally opened as https://github.com/stan-dev/stan/issues/1558


It would be nice to have new RNG functions that generate more than one draw at a time. E.g.,

generated quantities {
  int y[N];
  y <- poisson_rng(N, lambda);
}

instead of

generated quantities {
  int y[N];
  for (n in 1:N)
    y[n] <- poisson_rng(lambda);
}
alashworth commented 5 years ago

Comment by VMatthijs Thursday Dec 13, 2018 at 13:19 GMT


Has this been fixed yet? Didn't @bbbales2 do this?

alashworth commented 5 years ago

Comment by bob-carpenter Thursday Dec 13, 2018 at 14:12 GMT


No. @bbbales2 did vectorization, which allows

real[10] lambda;
int[10] y = poisson_rng(lambda);

but nothing allows poisson_rng(int n, scalar lambda), which should produce n outputs using the scalar lambda as expected count.