# \#discrete-parameters

**URL:** https://discourse.mc-stan.org/tag/discrete-parameters/187.md

[Latest](https://discourse.mc-stan.org/latest.md) · [Categories](https://discourse.mc-stan.org/categories.md) · [Tags](https://discourse.mc-stan.org/tags.md)

---

## [Modeling missing discrete covariates in regression model?](https://discourse.mc-stan.org/t/modeling-missing-discrete-covariates-in-regression-model/38726)

<div class="topic-metadata">

**Author:** [@maxdrohde](https://discourse.mc-stan.org/u/maxdrohde)\
**Replies:** 8\
**Last updated:** [February 10, 2025, 11:50pm UTC](https://discourse.mc-stan.org/t/modeling-missing-discrete-covariates-in-regression-model/38726 "2025-02-10T23:50:05Z")

</div>

I am looking to model missing covariates in a regression model using Stan and/or brms. I am able to do this when the covariate is continuous, for example using the mi() syntax in brms as in the “Imputation during model …

---

## [Help with specifying a hierarchical poisson - binomial - gaussian mixture](https://discourse.mc-stan.org/t/help-with-specifying-a-hierarchical-poisson-binomial-gaussian-mixture/36387)

<div class="topic-metadata">

**Author:** [@louisfh](https://discourse.mc-stan.org/u/louisfh)\
**Replies:** 7\
**Last updated:** [September 12, 2024, 11:54am UTC](https://discourse.mc-stan.org/t/help-with-specifying-a-hierarchical-poisson-binomial-gaussian-mixture/36387 "2024-09-12T11:54:11Z")

</div>

I’m struggling to specify my model. I’m new to hierarchical models, so may be missing some conceptual clarity too. I’m modeling the output of an automated classifier for detecting a species in an audio clip as a 2-compo…

---

## [Marginalize out discrete intermediate variable and possibility of in-chain parallelization](https://discourse.mc-stan.org/t/marginalize-out-discrete-intermediate-variable-and-possibility-of-in-chain-parallelization/36267)

<div class="topic-metadata">

**Author:** [@buf](https://discourse.mc-stan.org/u/buf)\
**Replies:** 7\
**Last updated:** [September 6, 2024, 9:59am UTC](https://discourse.mc-stan.org/t/marginalize-out-discrete-intermediate-variable-and-possibility-of-in-chain-parallelization/36267 "2024-09-06T09:59:48Z")

</div>

Hi everyone, I am working on a model with continuous parameters that creates a discrete “intermediate variable” which causes some problems. I asked regarding this issue a while ago here: Slow sampling for phenological m…

---

## [How to enter discrete data to stan model and modelling mixed posterior probability?](https://discourse.mc-stan.org/t/how-to-enter-discrete-data-to-stan-model-and-modelling-mixed-posterior-probability/31283)

<div class="topic-metadata">

**Author:** [@Meqdad\_Hasan](https://discourse.mc-stan.org/u/Meqdad_Hasan)\
**Replies:** 3\
**Last updated:** [October 13, 2023, 5:43pm UTC](https://discourse.mc-stan.org/t/how-to-enter-discrete-data-to-stan-model-and-modelling-mixed-posterior-probability/31283 "2023-10-13T17:43:56Z")

</div>

Hello stan users; I am new to stan. I still can not use \<I got the whole concept of stan language. However, I am in a hurry to answer one of my main questions. I am trying to model 46 nodes with almost 82 connections Ba…

---

## [Integer array in parameters block](https://discourse.mc-stan.org/t/integer-array-in-parameters-block/31195)

<div class="topic-metadata">

**Author:** [@happyRan](https://discourse.mc-stan.org/u/happyRan)\
**Replies:** 8\
**Last updated:** [April 26, 2023, 5:25am UTC](https://discourse.mc-stan.org/t/integer-array-in-parameters-block/31195 "2023-04-26T05:25:53Z")

</div>

Hi, I’m a novice and currently working on a project involving IBP stick-breaking. However, I have encountered an issue where the Bernoulli distribution in the model block requires the int matrix to be in the parameters b…

---

## [Bi-annual question on discrete parameters](https://discourse.mc-stan.org/t/bi-annual-question-on-discrete-parameters/25219)

<div class="topic-metadata">

**Author:** [@laifuthegreat](https://discourse.mc-stan.org/u/laifuthegreat)\
**Replies:** 11\
**Last updated:** [April 19, 2023, 8:57am UTC](https://discourse.mc-stan.org/t/bi-annual-question-on-discrete-parameters/25219 "2023-04-19T08:57:55Z")

</div>

So I recognize that discrete parameters have been asked for many times, and I’m fully convinced that most models would be much more efficiently computed by marginalization/Rao-Blackwellization and that many models that c…

---

## [Up-dating parameters for every iteration of a Stan model (MGARCH-Dirichlet Process Mixture)](https://discourse.mc-stan.org/t/up-dating-parameters-for-every-iteration-of-a-stan-model-mgarch-dirichlet-process-mixture/28451)

<div class="topic-metadata">

**Author:** [@F\_Louisa](https://discourse.mc-stan.org/u/F_Louisa)\
**Replies:** 2\
**Last updated:** [August 6, 2022, 2:54am UTC](https://discourse.mc-stan.org/t/up-dating-parameters-for-every-iteration-of-a-stan-model-mgarch-dirichlet-process-mixture/28451 "2022-08-06T02:54:34Z")

</div>

Dear Stan Community, My question in short: Is it possible to update the parameters of a stan model with every iteration? My question: I am a student trying to implement the MGARCH-DPM methodology of Maheu and Shamsi’…

---

## [Evaluation of my single arm treatemt](https://discourse.mc-stan.org/t/evaluation-of-my-single-arm-treatemt/28217)

<div class="topic-metadata">

**Author:** [@Rani](https://discourse.mc-stan.org/u/Rani)\
**Replies:** 1\
**Last updated:** [July 18, 2022, 6:37pm UTC](https://discourse.mc-stan.org/t/evaluation-of-my-single-arm-treatemt/28217 "2022-07-18T18:37:55Z")

</div>

Hello all, I am going to Evaluation of combined surgical and antibiotic treatment for Diabetic foot ulcers, 30 patients with Diabetic foot ulcers were enrolled in this study, and the date of first and last visit was rec…

---

## [Estimation, not marginalisation, of discrete parameters: a solution?](https://discourse.mc-stan.org/t/estimation-not-marginalisation-of-discrete-parameters-a-solution/27540)

<div class="topic-metadata">

**Author:** [@ChrisWymant](https://discourse.mc-stan.org/u/ChrisWymant)\
**Replies:** 3\
**Last updated:** [May 18, 2022, 9:22pm UTC](https://discourse.mc-stan.org/t/estimation-not-marginalisation-of-discrete-parameters-a-solution/27540 "2022-05-18T21:22:44Z")

</div>

Received wisdom seems to be that one cannot estimate discrete parameters in Stan. If they are latent one should marginalise over them oneself, but if they are not latent - if their value is the object of interest - I hav…

---

## [Workaround for likelihood involving many mixtures](https://discourse.mc-stan.org/t/workaround-for-likelihood-involving-many-mixtures/23997)

<div class="topic-metadata">

**Author:** [@noctilux](https://discourse.mc-stan.org/u/noctilux)\
**Replies:** 2\
**Last updated:** [August 25, 2021, 3:00pm UTC](https://discourse.mc-stan.org/t/workaround-for-likelihood-involving-many-mixtures/23997 "2021-08-25T15:00:44Z")

</div>

Hi all, I’m currently doing some modelling of Formula 1 race results with Stan and I got a little stuck, so I’d appreciate some advice! I coded up the following likelihood, which I believe to be Luce’s extension of the…

---

## [Marginalizing over discrete parameter with gamma distribution](https://discourse.mc-stan.org/t/marginalizing-over-discrete-parameter-with-gamma-distribution/23220)

<div class="topic-metadata">

**Author:** [@dherrera1911](https://discourse.mc-stan.org/u/dherrera1911)\
**Replies:** 16\
**Last updated:** [June 29, 2021, 1:38am UTC](https://discourse.mc-stan.org/t/marginalizing-over-discrete-parameter-with-gamma-distribution/23220 "2021-06-29T01:38:53Z")

</div>

Hi, I am having some trouble figuring out how to marginalize a discrete parameter in my model. I have never done this before and I couldn’t figure out how to apply any of the explanations I found online. The problem I a…

---

## [Confusion about discrete parameter marginalization in manual Bayesian model averaging](https://discourse.mc-stan.org/t/confusion-about-discrete-parameter-marginalization-in-manual-bayesian-model-averaging/21543)

<div class="topic-metadata">

**Author:** [@martinmodrak](https://discourse.mc-stan.org/u/martinmodrak)\
**Replies:** 2\
**Last updated:** [March 28, 2021, 11:04am UTC](https://discourse.mc-stan.org/t/confusion-about-discrete-parameter-marginalization-in-manual-bayesian-model-averaging/21543 "2021-03-28T11:04:08Z")

</div>

EDIT: Turns out I really was confused about marginalization. I think I finally figured it out. Edited to only show what I believe is the correct solution. No more answers needed, unless you believe the current solution i…
