# Multinomial distribution proportionate to inverse of the inputs

I have an array of integers which I want to model with a multinomial distribution. The problem is the numbers in the vector is related to the inverse probability: The higher the number is, the lower the probability will be.

For, probability vector w and inputs Int_vec, I currently use the element-wise division as follows (e is a vector of one):

``````model {
Int_vec ~ multinomial(e ./ w);
}
``````

However, I got into the following error when compiling the model:

There may be parameters that are not unit scale; consider rescaling with a multiplier (see manual section 22.12)

It is obvious that the element-wise inversion of w would not lead to another probability vector. So, what is the best way to scale the inverse of w? Should I define another variable in â€śtransforms parametersâ€ť?

Any help is highly appreciated!

1 Like

The standard (which does not necessarily mean the best, but definitely a good starting point) way you model probability vectors based on unbounded predictors is to do a `softmax` transform, I.e. the most direct way would be to have `multinomial(softmax(e ./ w))`, but I would be surprised if that worked well (there is no guarantee that `e ./ w` is on the scale implied by `softmax` I.e. on relative log odds. So thinking about what transformation is sensible to move from `w` to relative log-odds will likely be necessary.

Reviewing the wiki article on multinomial regression Multinomial logistic regression - Wikipedia might also be useful.

Best of luck with your model!

1 Like

Thanks, @martinmodrak! I did the normalization by dividing by the sum of the vectors!