Multinomial-Poisson transformation

475 views
Skip to first unread message

Martin Zuba

unread,
Apr 26, 2014, 7:43:42 AM4/26/14
to r-inla-disc...@googlegroups.com
Dear group,

I’m interested in multinomial analysis with INLA and would like to ask some questions about the multinomial-poisson transformation, which is new to me.

Firstly, the FAQ says that multinomial likelihood is not implemented in INLA and suggests using the multinomial-poisson transformation. However, I do not understand the by large uncommented example code (what is idx, jdx? why does it use weights? Also it does not run because "u" is not defined); and the link to the WinBugs manual is dead. I would be happy to provide a new code example once I understand the multinomial-poisson transformation.


If I understand the multinomial-poisson transformation correctly, I have to follow these quite simple steps in order to perform a multinomial analysis with INLA:

Suppose there are K outcome categories 1..k.

1. Organize the data set such that the new outcome variable is the count of cases where the outcome category K has been realized for any combination of covariates, that is, every combination of covariates has K lines is the data set (see also Guimaraes 2004 Understanding the MP-transf., http://www.stata-journal.com/sjpdf.html?articlenum=st0069)
2. For each covariate, construct a new variable as an interaction with the outcome category variable. Every covariate now has K times as many possible values.
3. Set these new variables to NA if K==1 OR the old covariate == 1 (Reference categories, this might be optional?), see alligator code.
4. Create as a new covariate a categorial variable that has the same value for every combination of covariates. There will be K instances of every value of that new covariate. (Or, add K dummy variables that are 1 if the category k has been realized and 0 otherwise, as Guimaraes suggests).
5. Specify the model family as poisson. Specify the formula as the count of cases ~ covariates, and add an "iid" model component based on the new covariate with fixed and arbitrarily small precision. Remove the intercept (-1). (See alligator code).
6. Run the model using INLA. The idea of the multinomial-poisson transformation is that the maximization of the coefficients of the new model component is mathematically equivalent to enforcing the restriction that p_1 + p_2 + ... + p_k = 1 (which is actually quite amazing).

The disadvantage of the multinomial-poisson distribution however is that it only works with categorial covariates (see Tsodikov and Chefo 2008, http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2516948/ , who come up with an even more complicated solution).

But what exactly does that mean?

From 2. and 4. it follows that the number of values of covariates must be limited, otherwise it would be impossible to speak of "every combination of covariates". But does that mean that all model components of covariates must be of type "iid", or can I use "ar1" and "rw2" type smoothing of covariate coefficients?

Since I now have K times as much possible values for all covariates, I would need to specify which values of the new covariates are "neighbours" (that is, the pairs of old covariate:outcome categories 1:1, 2:1 and 3:1 are neigbours, and 1:2, 2:2 and 3:2 are also neighbours, but possibly with different hyperparameters, and in some way 1:1, 1:2, ... 1:k are also neigbours and so on). Is that possible, and if yes, how would I specify it?

Note also that there is a multinomINLA package by Facundo Munoz (see https://github.com/famuvie/multinomINLA), it seems to be that it does something similar to what I summarized in steps 1-5, but I am not sure of that.

I would be grateful for any comments.

Regards,

Martin Zuba
Vienna University of Economics and Business

Håvard Rue

unread,
Apr 27, 2014, 8:46:12 AM4/27/14
to Martin Zuba, r-inla-disc...@googlegroups.com
On Sat, 2014-04-26 at 04:43 -0700, Martin Zuba wrote:

> Firstly, the FAQ says that multinomial likelihood is not implemented
> in INLA and suggests using the multinomial-poisson transformation.
> However, I do not understand the by large uncommented example code
> (what is idx, jdx? why does it use weights? Also it does not run
> because "u" is not defined); and the link to the WinBugs manual is
> dead. I would be happy to provide a new code example once I understand
> the multinomial-poisson transformation.

Thanks. I have updated the code 'u' is not needed. Also the dead link is
updated.

hopefully the transformation is more clear now. understanding this,
should make it possible to do any extention.


> Note also that there is a multinomINLA package by Facundo Munoz (see
> https://github.com/famuvie/multinomINLA), it seems to be that it does
> something similar to what I summarized in steps 1-5, but I am not sure
> of that.

thanks for this. I didn't know. seems like a useful function....

H


--
Håvard Rue
Department of Mathematical Sciences
Norwegian University of Science and Technology
N-7491 Trondheim, Norway
Voice: +47-7359-3533 URL : http://www.math.ntnu.no/~hrue
Mobile: +47-9260-0021 Email: havar...@math.ntnu.no

R-INLA: www.r-inla.org

Martin Zuba

unread,
Apr 28, 2014, 9:37:57 AM4/28/14
to r-inla-disc...@googlegroups.com
Thank you for your quick reply!

I have managed to fit a model which indeed prodeces fitted values that always add to the total count of observations.

If I am interested in marginal distributions of probs (including out-of sample cases, that is, cases that have NA as dependent variable), not in fitted values, is there a way to obtain them without dividing fitted values or linear predictor by the sum of all categories?

Best regards,
Martin Zuba

Håvard Rue

unread,
Apr 28, 2014, 11:47:25 AM4/28/14
to Martin Zuba, r-inla-disc...@googlegroups.com
I think to predict using this model, you'll need to use sampling, since
you're after expressions like x/(x+y). look at inla.posterior.sample().
its possible to use the marginals for the linear predictors, and compute
it from there, but this assumes independence which you do not have. I'm
not sure how much you loose though with this approximation. the
sample-approach above will account for dependence.

Best

Facundo Muñoz

unread,
May 12, 2014, 6:26:25 AM5/12/14
to r-inla-disc...@googlegroups.com

On 04/26/2014 01:43 PM, Martin Zuba wrote:
> Dear group,
>
> I’m interested in multinomial analysis with INLA and would like to ask
> some questions about the multinomial-poisson transformation, which is
> new to me.
> [...]
> Note also that there is a multinomINLA package by Facundo Munoz (see
> https://github.com/famuvie/multinomINLA), it seems to be that it does
> something similar to what I summarized in steps 1-5, but I am not sure
> of that.

Hi Martin,

this is something I started, but it is not functional right now (only in
very simple cases).

I guess you have learned quite a bit by now about the
multinomial-poisson transformation, so if you want to contribute to the
package, we can finish it together.

Best
ƒacu.-

Reply all
Reply to author
Forward
0 new messages