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!