# Ordinal Mixture Model w/ Set Outcome for One Component

**URL:** <https://discourse.mc-stan.org/t/ordinal-mixture-model-w-set-outcome-for-one-component/8572>\
**Category:** brms\
**Created:** [April 22, 2019, 10:59pm UTC](https://discourse.mc-stan.org/t/ordinal-mixture-model-w-set-outcome-for-one-component/8572 "2019-04-22T22:59:17Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Jon\_Fawcett](https://avatars.discourse-cdn.com/v4/letter/j/bc79bd/32.png) [@Jon\_Fawcett](https://discourse.mc-stan.org/u/Jon_Fawcett)\
**Post date:** [April 25, 2019, 4:56pm UTC](https://discourse.mc-stan.org/t/ordinal-mixture-model-w-set-outcome-for-one-component/8572/6 "2019-04-25T16:56:23Z")

</div>

I have a comment and a few follow-up questions for you @paul.buerkner. The model fits fine now, and even produces reasonable results. I have posted a question pertaining to my specification of the lpmf to the general board, but I think it is fine too.

1.) For anyone else that might try something like this, to get the code to work, I had to make a slight modification, adding a variable titled “threshold” to my custom distribution as follows:

> rec\_dist ← custom\_family(  
> “rec\_dist”,  
> type = “int”,  
> special = ‘ordinal’  
> )  
> rec\_dist$threshold=‘equidistant’

Worked fine once I did.

2.) My full model is a little more complex than the above. The mixture is asymmetric, with the mixing proportion set to 0 for certain trials. I do not believe this can be done in the current version of BRMS, so I had to generate the Stan code and make some changes there. **Is there a way to convert the resulting model back into a BRMS object?** None of the outputs or parameters change, only a small portion of the likelihood calculation (where I treat certain trials as coming from Component 2 of the mixture, directly). Bonus points if there _is_ a way to set mixing proportions to 0 for certain trials without modifying the Stan code. Best I could come up with was to force the intercept of a predictor (reflecting the trials in question) on Theta1 to an arbitrarily small value using a strong prior. Code modification seemed more principled.

3.) I would like to compare my mixture model to a non-mixture variant to gauge evidence for each. **What functions, if any, must be included for bayes\_factor and loo to work with my custom distribution within BRMS?** Or should they work and produce reasonable results with any custom distribution so long as the lpmf is defined? The reason I ask is because bayes\_factor is telling me that my mixture is something like 1,000,000 x more probable than the non-mixture (given similar priors). I want to ensure I was not meant to do something to ensure proper functionality before interpreting that!

---

_[View the full topic](https://discourse.mc-stan.org/t/ordinal-mixture-model-w-set-outcome-for-one-component/8572)._
