# Generated quantities from bernoulli\_logit\_glm model

**URL:** <https://discourse.mc-stan.org/t/generated-quantities-from-bernoulli-logit-glm-model/25124>\
**Category:** Modeling\
**Created:** [November 4, 2021, 6:36pm UTC](https://discourse.mc-stan.org/t/generated-quantities-from-bernoulli-logit-glm-model/25124 "2021-11-04T18:36:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohrsignal](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@mohrsignal](https://discourse.mc-stan.org/u/mohrsignal)\
**Post date:** [November 4, 2021, 6:36pm UTC](https://discourse.mc-stan.org/t/generated-quantities-from-bernoulli-logit-glm-model/25124/1 "2021-11-04T18:36:12Z")

</div>

Hi,

Does the absence of a function `bernoulli_logit_glm_rng` imply that something like `bernoulli_logit_rng` should be used for generated quantities?

Side note: Version 2.28 of the Stan Function Reference appears to have duplicate definitions of the `bernoulli_logit_glm_lpmf` and `bernoulli_logit_glm_lupmf` functions, here:

[13.3 Bernoulli-logit generalized linear model (Logistic Regression) | Stan Functions Reference](https://mc-stan.org/docs/2_28/functions-reference/bernoulli-logit-glm.html)

Thanks!

---

<div class="post-metadata">

**Author:** ![martinmodrak](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/martinmodrak/32/133_2.png) [@martinmodrak](https://discourse.mc-stan.org/u/martinmodrak)\
**Post date:** [November 10, 2021, 1:50pm UTC](https://discourse.mc-stan.org/t/generated-quantities-from-bernoulli-logit-glm-model/25124/2 "2021-11-10T13:50:52Z")

</div>

Yes, you probably need to use `bernoulli_logit_rng` - it however appears the `_rng` version exists in the math library - [math/bernoulli\_logit\_glm\_rng.hpp at 92075708b1d1796eb82e3b284cd11e544433518e · stan-dev/math · GitHub](https://github.com/stan-dev/math/blob/92075708b1d1796eb82e3b284cd11e544433518e/stan/math/prim/prob/bernoulli_logit_glm_rng.hpp) so it is probably a simple omission that it is not exposed.

Maybe @rok_cesnovar or @stevebronder would know who to ask about this?

---

<div class="post-metadata">

**Author:** ![rok\_cesnovar](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@rok\_cesnovar](https://discourse.mc-stan.org/u/rok_cesnovar)\
**Post date:** [November 10, 2021, 1:54pm UTC](https://discourse.mc-stan.org/t/generated-quantities-from-bernoulli-logit-glm-model/25124/3 "2021-11-10T13:54:12Z")

</div>

As far as I know there is no reason to not add it, so just oversight. Made an issue so that we don’t repeat that mistake: [Expose bernoulli\_logit\_glm\_rng · Issue #1031 · stan-dev/stanc3 · GitHub](https://github.com/stan-dev/stanc3/issues/1031)

Thanks for digging that up Martin!

---

<div class="post-metadata">

**Author:** ![mohrsignal](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@mohrsignal](https://discourse.mc-stan.org/u/mohrsignal)\
**Post date:** [November 12, 2021, 2:32pm UTC](https://discourse.mc-stan.org/t/generated-quantities-from-bernoulli-logit-glm-model/25124/4 "2021-11-12T14:32:08Z")

</div>

Thank you both!
