# \#mixture

**URL:** https://discourse.mc-stan.org/tag/mixture/127.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)

---

## [How to handle divergent chains in Stan mixture models](https://discourse.mc-stan.org/t/how-to-handle-divergent-chains-in-stan-mixture-models/41598)

<div class="topic-metadata">

**Author:** [@digikar](https://discourse.mc-stan.org/u/digikar)\
**Replies:** 3\
**Last updated:** [September 17, 2026, 2:52pm UTC](https://discourse.mc-stan.org/t/how-to-handle-divergent-chains-in-stan-mixture-models/41598 "2026-09-17T14:52:24Z")

</div>

Hello, I want to use a mixture model to decide whether my data is better explained by two components or by a single component. For example, let me take (simulated) data to be the following. The model behaves well (Reff …

---

## [Mixture, survival and ordinal models courses start in two weeks](https://discourse.mc-stan.org/t/mixture-survival-and-ordinal-models-courses-start-in-two-weeks/40056)

<div class="topic-metadata">

**Author:** [@lizzieinvancouver](https://discourse.mc-stan.org/u/lizzieinvancouver)\
**Replies:** 0\
**Last updated:** [August 3, 2025, 8:28pm UTC](https://discourse.mc-stan.org/t/mixture-survival-and-ordinal-models-courses-start-in-two-weeks/40056 "2025-08-03T20:28:43Z")

</div>

Hi all and happy post lammas day, Friendly (and probably final) reminder about upcoming online courses on mixture, survival and ordinal models and pairwise comparison modeling. Courses start 18 August and you can regist…

---

## [Constraining the cluster probabilities in mixture models](https://discourse.mc-stan.org/t/constraining-the-cluster-probabilities-in-mixture-models/39515)

<div class="topic-metadata">

**Author:** [@lorenzo\_cappiello](https://discourse.mc-stan.org/u/lorenzo_cappiello)\
**Replies:** 7\
**Last updated:** [May 27, 2025, 10:23pm UTC](https://discourse.mc-stan.org/t/constraining-the-cluster-probabilities-in-mixture-models/39515 "2025-05-27T22:23:43Z")

</div>

Hi Everyone, I have developed a hierarchical Beta bivariate mixture model with gaussian copula. And I need it to constrain it so that the only possible values are in between .01, and .99. However, it does not work. Can …

---

## [Diagnosing convergence under label-switching](https://discourse.mc-stan.org/t/diagnosing-convergence-under-label-switching/38867)

<div class="topic-metadata">

**Author:** [@g\_lewis](https://discourse.mc-stan.org/u/g_lewis)\
**Replies:** 5\
**Last updated:** [March 19, 2025, 9:29pm UTC](https://discourse.mc-stan.org/t/diagnosing-convergence-under-label-switching/38867 "2025-03-19T21:29:54Z")

</div>

Hi all, This is a little different than other label-switching questions I’ve found here, and it’s not really covered by Betancourt’s excellent vignette. Sorry for the long post. The quick summary is that I’m facing labe…

---

## [Aggregated model for mixture of Exponential distributions](https://discourse.mc-stan.org/t/aggregated-model-for-mixture-of-exponential-distributions/39041)

<div class="topic-metadata">

**Author:** [@BenKawam](https://discourse.mc-stan.org/u/BenKawam)\
**Replies:** 5\
**Last updated:** [March 18, 2025, 8:47pm UTC](https://discourse.mc-stan.org/t/aggregated-model-for-mixture-of-exponential-distributions/39041 "2025-03-18T20:47:53Z")

</div>

Hey everyone! I’m working on a time-to-event model. Waiting times come from a mixture of two exponential distributions, with a low- (e.g., 20 minutes) and a high (e.g., 5000 minutes) averages. After a certain waiting ti…

---

## [Adding a logit link to brms mixture model](https://discourse.mc-stan.org/t/adding-a-logit-link-to-brms-mixture-model/38925)

<div class="topic-metadata">

**Author:** [@carlyls](https://discourse.mc-stan.org/u/carlyls)\
**Replies:** 1\
**Last updated:** [March 5, 2025, 11:39am UTC](https://discourse.mc-stan.org/t/adding-a-logit-link-to-brms-mixture-model/38925 "2025-03-05T11:39:32Z")

</div>

Hi! I am fitting a mixture model with brms and using a mixture of two normal distributions. How can I set my theta2 parameter (mixing parameter) to have a logit link? My current code is below: mix \<- mixture(gaussian(),…

---

## [Best way to calculate the mean in a regression hurdle model](https://discourse.mc-stan.org/t/best-way-to-calculate-the-mean-in-a-regression-hurdle-model/38728)

<div class="topic-metadata">

**Author:** [@Paul\_Jones](https://discourse.mc-stan.org/u/Paul_Jones)\
**Replies:** 7\
**Last updated:** [February 25, 2025, 11:22pm UTC](https://discourse.mc-stan.org/t/best-way-to-calculate-the-mean-in-a-regression-hurdle-model/38728 "2025-02-25T23:22:55Z")

</div>

How to Compute Expected Value in a Hurdle Model Without Extreme Sensitivity to Outliers? Hi everyone, I’m working with a regression hurdle model where the zero/non-zero process is modeled using a constant probability (t…

---

## [Loglikelihood in bivariate beta mixture model with copula](https://discourse.mc-stan.org/t/loglikelihood-in-bivariate-beta-mixture-model-with-copula/36297)

<div class="topic-metadata">

**Author:** [@lorenzo\_cappiello](https://discourse.mc-stan.org/u/lorenzo_cappiello)\
**Replies:** 5\
**Last updated:** [January 20, 2025, 6:25pm UTC](https://discourse.mc-stan.org/t/loglikelihood-in-bivariate-beta-mixture-model-with-copula/36297 "2025-01-20T18:25:01Z")

</div>

\[edit: escaped the rest of the code\] Hi, I am trying to implement a hierarchical beta mixture model with fixed alphas and betas and prior on the components weights. Everything runs but I am having an hard time understa…

---

## [Parameter Estimation issue](https://discourse.mc-stan.org/t/parameter-estimation-issue/37405)

<div class="topic-metadata">

**Author:** [@Andrew\_fg](https://discourse.mc-stan.org/u/Andrew_fg)\
**Replies:** 4\
**Last updated:** [January 13, 2025, 10:44am UTC](https://discourse.mc-stan.org/t/parameter-estimation-issue/37405 "2025-01-13T10:44:15Z")

</div>

Please share your Stan program and accompanying data if possible. Good morning everyone, I have a question, and I hope you can help me. Based on the BayesHMM package (An Introduction to BayesHMM • BayesHMM), I develo…

---

## [Prior predictive checks in survival modeling with a mixture prior](https://discourse.mc-stan.org/t/prior-predictive-checks-in-survival-modeling-with-a-mixture-prior/38329)

<div class="topic-metadata">

**Author:** [@mazin.abdelghany](https://discourse.mc-stan.org/u/mazin.abdelghany)\
**Replies:** 1\
**Last updated:** [December 31, 2024, 7:39pm UTC](https://discourse.mc-stan.org/t/prior-predictive-checks-in-survival-modeling-with-a-mixture-prior/38329 "2024-12-31T19:39:14Z")

</div>

Hi all, I recently posted for help to build a survival model using a mixture prior. I was able to run this model without issue, code below: data { int\<lower=0\> K; // num covariates int\<lower=0\> N; …

---

## [Survival data modeling using mixture priors](https://discourse.mc-stan.org/t/survival-data-modeling-using-mixture-priors/37844)

<div class="topic-metadata">

**Author:** [@mazin.abdelghany](https://discourse.mc-stan.org/u/mazin.abdelghany)\
**Replies:** 2\
**Last updated:** [December 30, 2024, 9:37pm UTC](https://discourse.mc-stan.org/t/survival-data-modeling-using-mixture-priors/37844 "2024-12-30T21:37:57Z")

</div>

Hi all, This is my first post to the Stan forums, so if there is any helpful additions or modifications that I can make to my post, please let me know and thank you for your patience. I have successfully fit a survival…

---

## [Incorrect number of categories with categorical\_lpmf for a mixture model](https://discourse.mc-stan.org/t/incorrect-number-of-categories-with-categorical-lpmf-for-a-mixture-model/35101)

<div class="topic-metadata">

**Author:** [@psyguy](https://discourse.mc-stan.org/u/psyguy)\
**Replies:** 3\
**Last updated:** [September 23, 2024, 1:27pm UTC](https://discourse.mc-stan.org/t/incorrect-number-of-categories-with-categorical-lpmf-for-a-mixture-model/35101 "2024-09-23T13:27:15Z")

</div>

Hi there, I am trying to specify a mixture time series model that involves a mixing discrete variables. I get the following error for all chains while fitting the model, which I cannot figure out how to deal with: SAMP…

---

## [Bivariate-beta mixture model with copula](https://discourse.mc-stan.org/t/bivariate-beta-mixture-model-with-copula/36092)

<div class="topic-metadata">

**Author:** [@lorenzo\_cappiello](https://discourse.mc-stan.org/u/lorenzo_cappiello)\
**Replies:** 6\
**Last updated:** [August 7, 2024, 7:57am UTC](https://discourse.mc-stan.org/t/bivariate-beta-mixture-model-with-copula/36092 "2024-08-07T07:57:13Z")

</div>

Hi, I am trying to implement a hierarchical beta mixture model with fixed alphas and betas and prior on the components weights. I based my code off another post here and I added the copula on top. My aim is to get the c…

---

## [Combining a hurdle\_lognormal with lognormal in a mixture model](https://discourse.mc-stan.org/t/combining-a-hurdle-lognormal-with-lognormal-in-a-mixture-model/35496)

<div class="topic-metadata">

**Author:** [@johkaa](https://discourse.mc-stan.org/u/johkaa)\
**Replies:** 5\
**Last updated:** [June 16, 2024, 3:20am UTC](https://discourse.mc-stan.org/t/combining-a-hurdle-lognormal-with-lognormal-in-a-mixture-model/35496 "2024-06-16T03:20:37Z")

</div>

We would like to fit a model combining a hurdle model and a finite mixture model. We want to model the probability for a zero, and then for the non-zero values, we want to assume that the observations come from two separ…

---

## [Finite Mixture Vectorization](https://discourse.mc-stan.org/t/finite-mixture-vectorization/35466)

<div class="topic-metadata">

**Author:** [@jelly](https://discourse.mc-stan.org/u/jelly)\
**Replies:** 1\
**Last updated:** [June 13, 2024, 12:38pm UTC](https://discourse.mc-stan.org/t/finite-mixture-vectorization/35466 "2024-06-13T12:38:37Z")

</div>

Stan user manual says that vectorization is not supported for finite mixtures: Finite Mixtures Compare the following two models: model{ for (n in 1:N) { target += log\_mix(lambda, normal\_lpdf(y\[n\] …

---

## [Rootfinding of inverse-CDF of Gaussian mixture with Newton solver](https://discourse.mc-stan.org/t/rootfinding-of-inverse-cdf-of-gaussian-mixture-with-newton-solver/34459)

<div class="topic-metadata">

**Author:** [@spencergordon](https://discourse.mc-stan.org/u/spencergordon)\
**Replies:** 2\
**Last updated:** [March 14, 2024, 6:59pm UTC](https://discourse.mc-stan.org/t/rootfinding-of-inverse-cdf-of-gaussian-mixture-with-newton-solver/34459 "2024-03-14T18:59:25Z")

</div>

I have a series of sample quantiles with known probabilities, and I know the quantiles were calculated from a sample from a Gaussian mixture distribution. I assume the quantiles follow a normal distribution where the inv…

---

## [Sharing parameters across distributions in a mixture model](https://discourse.mc-stan.org/t/sharing-parameters-across-distributions-in-a-mixture-model/31285)

<div class="topic-metadata">

**Author:** [@bnicenboim](https://discourse.mc-stan.org/u/bnicenboim)\
**Replies:** 1\
**Last updated:** [July 14, 2023, 4:19pm UTC](https://discourse.mc-stan.org/t/sharing-parameters-across-distributions-in-a-mixture-model/31285 "2023-07-14T16:19:18Z")

</div>

Hi, I was wondering if I could share parameters across the distributions of a mixture in brms. Imagine a situation where a school grade depends on a predictor, but a school teacher might have favorite students who they …

---

## [HMM and Skew Normal mixture](https://discourse.mc-stan.org/t/hmm-and-skew-normal-mixture/31694)

<div class="topic-metadata">

**Author:** [@Andrew\_fg](https://discourse.mc-stan.org/u/Andrew_fg)\
**Replies:** 1\
**Last updated:** [June 9, 2023, 5:02pm UTC](https://discourse.mc-stan.org/t/hmm-and-skew-normal-mixture/31694 "2023-06-09T17:02:06Z")

</div>

Hello everyone, leveraging the package library(BayesHMM) I want to propose a combination of HMM and a mixture of skew-normal distribution in a regression setting. But I got different errors, see eg: Error in stanc(fil…

---

## [Nonsensical Mixing Proportions](https://discourse.mc-stan.org/t/nonsensical-mixing-proportions/31429)

<div class="topic-metadata">

**Author:** [@ShawnFoster](https://discourse.mc-stan.org/u/ShawnFoster)\
**Replies:** 2\
**Last updated:** [May 18, 2023, 8:17pm UTC](https://discourse.mc-stan.org/t/nonsensical-mixing-proportions/31429 "2023-05-18T20:17:30Z")

</div>

Short summary of the problem Hello all! I’m fairly new to Bayesian modelling and have been having some trouble with a Gaussian Mixture model. Specifically, I have two questions. Are mixtures of Gaussians an appropria…

---

## [Fixating same effect of covariate across mu1 and mu2 in mixture](https://discourse.mc-stan.org/t/fixating-same-effect-of-covariate-across-mu1-and-mu2-in-mixture/30673)

<div class="topic-metadata">

**Author:** [@AK10](https://discourse.mc-stan.org/u/AK10)\
**Replies:** 0\
**Last updated:** [March 8, 2023, 6:19pm UTC](https://discourse.mc-stan.org/t/fixating-same-effect-of-covariate-across-mu1-and-mu2-in-mixture/30673 "2023-03-08T18:19:13Z")

</div>

Dear all. I’m trying to fit a 2-component Gaussian mixture model using brms. Let’s say I have two covariates, x and z, that I want to use to model the two means, mu1 and mu2. In addition I would like to add the constrai…

---

## [Psychometric lapsing model for more than two possible categorical outcomes](https://discourse.mc-stan.org/t/psychometric-lapsing-model-for-more-than-two-possible-categorical-outcomes/30600)

<div class="topic-metadata">

**Author:** [@tiflo](https://discourse.mc-stan.org/u/tiflo)\
**Replies:** 3\
**Last updated:** [March 7, 2023, 2:20pm UTC](https://discourse.mc-stan.org/t/psychometric-lapsing-model-for-more-than-two-possible-categorical-outcomes/30600 "2023-03-07T14:20:50Z")

</div>

Hi, I’m wondering whether there is a way to use brms to fit a psychometric lapsing model for a multi-response (categorical rather than bernoulli-distributed) outcome? To make this more concrete, I’m trying to analyze wh…

---

## [Convergence issues with over-fitting mixtures](https://discourse.mc-stan.org/t/convergence-issues-with-over-fitting-mixtures/30241)

<div class="topic-metadata">

**Author:** [@paullabonne](https://discourse.mc-stan.org/u/paullabonne)\
**Replies:** 1\
**Last updated:** [February 9, 2023, 7:56pm UTC](https://discourse.mc-stan.org/t/convergence-issues-with-over-fitting-mixtures/30241 "2023-02-09T19:56:34Z")

</div>

Hi everyone, I am trying to fit a Spare Finite Mixture (SFM) (Malsiner-Walli et al. 2016) of Normal distributions using Stan in R. The idea of the SFM approach is to use many components but shrink the weights of superfl…

---

## [Error evaluating a 1D integral for Pareto/GGG Buy Till You Die marginal likelihood](https://discourse.mc-stan.org/t/error-evaluating-a-1d-integral-for-pareto-ggg-buy-till-you-die-marginal-likelihood/29927)

<div class="topic-metadata">

**Author:** [@brandonisherman](https://discourse.mc-stan.org/u/brandonisherman)\
**Replies:** 27\
**Last updated:** [January 18, 2023, 7:34pm UTC](https://discourse.mc-stan.org/t/error-evaluating-a-1d-integral-for-pareto-ggg-buy-till-you-die-marginal-likelihood/29927 "2023-01-18T19:34:09Z")

</div>

I am currently implementing the Pareto/GGG Buy Till You Die mixture model described in Platzer and Reutterer (2016). One of the parameters \\tau represents the customer lifetime and follows a tricky distribution conditio…

---

## [Bayesian Mixture Model](https://discourse.mc-stan.org/t/bayesian-mixture-model/29896)

<div class="topic-metadata">

**Author:** [@DIVAGORA](https://discourse.mc-stan.org/u/DIVAGORA)\
**Replies:** 2\
**Last updated:** [December 29, 2022, 7:35am UTC](https://discourse.mc-stan.org/t/bayesian-mixture-model/29896 "2022-12-29T07:35:51Z")

</div>

I’m newbie using STAN. I’m trying to perform a Bayesian mixture model (mixing Gaussian and GEV distributions). However, the model has convergence problem. Any comments on improving it.Thanks! functions{ real gev…

---

## [Mixture of generalized poisson distribution](https://discourse.mc-stan.org/t/mixture-of-generalized-poisson-distribution/14378)

<div class="topic-metadata">

**Author:** [@jacobcvt12](https://discourse.mc-stan.org/u/jacobcvt12)\
**Replies:** 18\
**Last updated:** [December 26, 2022, 11:55am UTC](https://discourse.mc-stan.org/t/mixture-of-generalized-poisson-distribution/14378 "2022-12-26T11:55:57Z")

</div>

I’m trying to fit a mixture of Generalized Poisson’s to simulated data. I was able to define a LPMF for a GP and fit a non-mixture dataset fine: functions { real genpoiss\_lpmf(int y, real lambda1, real lambda2) { …

---

## [Identifying a Mixture IRT Model in brms](https://discourse.mc-stan.org/t/identifying-a-mixture-irt-model-in-brms/29691)

<div class="topic-metadata">

**Author:** [@wgoette](https://discourse.mc-stan.org/u/wgoette)\
**Replies:** 0\
**Last updated:** [December 4, 2022, 8:43pm UTC](https://discourse.mc-stan.org/t/identifying-a-mixture-irt-model-in-brms/29691 "2022-12-04T20:43:28Z")

</div>

This is really more of a conceptual question that I’m hoping to get clarity on before trying to make the modeling work. In the past, I’ve tried getting a finite mixture IRT model to work, but I never really cracked how t…

---

## [Mixture growth model with non-constant sigma for qPCR data](https://discourse.mc-stan.org/t/mixture-growth-model-with-non-constant-sigma-for-qpcr-data/29478)

<div class="topic-metadata">

**Author:** [@t-pollington](https://discourse.mc-stan.org/u/t-pollington)\
**Replies:** 4\
**Last updated:** [November 15, 2022, 4:40pm UTC](https://discourse.mc-stan.org/t/mixture-growth-model-with-non-constant-sigma-for-qpcr-data/29478 "2022-11-15T16:40:36Z")

</div>

My growth model estimates random intercepts & random gradients for each individual, longitudinally in time. Its current specification is working. I would now like to make the intercept term belong to a 2-component Normal…

---

## [Identification issues with Latent Class Analysis/Mixture model](https://discourse.mc-stan.org/t/identification-issues-with-latent-class-analysis-mixture-model/23452)

<div class="topic-metadata">

**Author:** [@Mauricio\_Garnier-Villarre](https://discourse.mc-stan.org/u/Mauricio_Garnier-Villarre)\
**Replies:** 25\
**Last updated:** [October 24, 2022, 4:44pm UTC](https://discourse.mc-stan.org/t/identification-issues-with-latent-class-analysis-mixture-model/23452 "2022-10-24T16:44:47Z")

</div>

Hi all I am working on creating a general framework to work with mxiture models, specifically with Latent Class Analysis (LCA) and its extensions. Now, I am working on a LCA model, using the bernoulli\_logit\_lpmf functi…

---

## [Logistic Regression without a Gold Standard/Error in Observed Classification](https://discourse.mc-stan.org/t/logistic-regression-without-a-gold-standard-error-in-observed-classification/28644)

<div class="topic-metadata">

**Author:** [@wgoette](https://discourse.mc-stan.org/u/wgoette)\
**Replies:** 6\
**Last updated:** [September 9, 2022, 8:50pm UTC](https://discourse.mc-stan.org/t/logistic-regression-without-a-gold-standard-error-in-observed-classification/28644 "2022-09-09T20:50:55Z")

</div>

Context of Problem I’m trying to specify a logistic regression model that incorporates some amount of unknown classification error in the sample data. The issue of diagnostic uncertainty is an obvious problem, but I’ve …

---

## [Help with specifying a multilevel Gaussian-Lognormal mixture model in brms](https://discourse.mc-stan.org/t/help-with-specifying-a-multilevel-gaussian-lognormal-mixture-model-in-brms/28683)

<div class="topic-metadata">

**Author:** [@Ladislas](https://discourse.mc-stan.org/u/Ladislas)\
**Replies:** 0\
**Last updated:** [August 30, 2022, 9:29am UTC](https://discourse.mc-stan.org/t/help-with-specifying-a-multilevel-gaussian-lognormal-mixture-model-in-brms/28683 "2022-08-30T09:29:49Z")

</div>

Operating System: macOS v11.6 R version 4.1.2 brms Version: 2.17.0 – Hi, I have data coming from an experiment (with humans) in which participants type words in 2 conditions (indicated later on by the mode variable,…

[Next page](https://discourse.mc-stan.org/tag/mixture/127.md?match_all_tags=true&page=1&tags%5B%5D=mixture)
