# Constraining Output of Multinomial Distribution

**URL:** <https://discourse.mc-stan.org/t/constraining-output-of-multinomial-distribution/10900>\
**Category:** Modeling\
**Created:** [September 8, 2019, 5:01pm UTC](https://discourse.mc-stan.org/t/constraining-output-of-multinomial-distribution/10900 "2019-09-08T17:01:17Z")\
**Posts on this page:** 1\
**Showing post:** 30

<div class="post-metadata">

**Author:** ![mathDR](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/mathdr/32/1997_2.png) [@mathDR](https://discourse.mc-stan.org/u/mathDR)\
**Post date:** [December 24, 2021, 3:10am UTC](https://discourse.mc-stan.org/t/constraining-output-of-multinomial-distribution/10900/30 "2021-12-24T03:10:47Z")

</div>

linking a different discussion that has an analytical integral solution to the Multivariate Wallenius Noncentral Hypergeometric distribution

> [@Biased urn problem & Wallenius' noncentral hypergeometric distribution](https://discourse.mc-stan.org/t/biased-urn-problem-wallenius-noncentral-hypergeometric-distribution/21461/6):
>
> I played around and got the integrate\_1d to work for this distribution. No doubt that this is way slower than @mathDR approximation. This is my first time using the integrate functionality so that was cool! I’m sure there’s a more numerically stable way to code it (@andrjohns or @bbbales2 may know a good way to use the xc parameter here). functions { real wallenius\_integral(real t, // Function argument real xc, // Complement of function argument …

---

_[View the full topic](https://discourse.mc-stan.org/t/constraining-output-of-multinomial-distribution/10900)._
