# Model with a bounded sum of multiple count outcomes

Hello, I have a model with three count outcomes and one predictor (a random intercept), which is defined as:

``````mvbf(
bf(Out1 | trials(Tot) ~ (1 | Pred)) + binomial(),
bf(Out2 | trials(Tot) ~ (1 | Pred)) + binomial(),
bf(Out3 | trials(Tot) ~ (1 | Pred)) + binomial()
)
``````

My problem is that Out1 + Out2 + Out3 should be always ≤ Tot in the posterior draws. How do I force this? I tried using a multinomial model but brms/stan complains if Out1 + Out2 + Out3 != Tot.

In case it’s possible to define such a model, should I put particular care in the priors? at the moment I use pretty standard Student(3, 0, 2) for the hierarchical mean and HalfStudent(3, 0, 2.5) for the standard deviation.

Thanks

why is the sum smaller than total?

Imagine you have a certain number of slots for patient visits, some of them get used some not. These visits can also be categorised in three groups. I’d like to see if the number of visits categorized in a certain group changed between predictor level (in this case the predictor is Year), conditional that the predicted sum of the three categories is bounded to the number of slots.

Before I was using a multinomial model for the groups conditional on the total number of visits, ignoring the slots. But this model didn’t seem right because also the total number of visits is uncertain itself. Since stan doesn’t allow discrete parameters (we discussed in a previous thread about the possibility of a hierarchical mutinomial model with a binomial sum), I thought that another solution would be to model the individual groups as binomial conditional to the slots, but I need the bound also their sum.

One idea I just had is to add “fake” category to account for the unused slots in order to use a multinomial, but I don’t know if it theoretically makes sense.

[UPDATE]: I just saw you also suggest this solution on twitter

Right now, I don’t see a better solution than this additional category for unused visits. It could even be sensible to make this the (not directly predicted) reference category against which the other categories are compared.

1 Like