I have 2 different multinomial distributions that I want to multiply together to get a matrix. This matrix matches my observed data. Is there a way to decompose this data using either PyMC3 or Stan? Are there any good examples? It seems like this is similar to a Bayesian version of Non-Negative Matrix Factorization.
Asked
Active
Viewed 452 times
0
-
Can you clarify what you mean by wanting to multiply two multinomial distributions to obtain a matrix? In Stan, this would be an two-dimensional array of integers rather than a matrix (because in Stan, matrices only contain real numbers) but it should not be too difficult to write down a bivariate likelihood of it. – Ben Goodrich Dec 16 '16 at 18:58
-
I have a 2 dimensional table of features (real numbers) that I want to decompose into 2 vectors. Each vector needs to sum to 1 (multinomial distribution). I'm trying to get this to work with PyMC3 or Stan, but so far I haven't been able to figure out how to accomplish this. – Chris Dec 16 '16 at 19:28
-
Did you mean to say a simplex vector (a non-negative vector that sums to 1), which is often used for the parameter of a multinomial likelihood? In Stan, you can declare a parameter as a `simplex[K] vec1;` and you could declare another `simplex[J] vec2;`. Then you could do `matrix[K,J] M = vec1 * vec2'` But you need some sort of a likelihood function for the observed $K \times J$ array. Alp has some Stan [code](http://www.proditus.com/papers/KRGB_nips2015.pdf) for matrix factorizations such as these. – Ben Goodrich Dec 16 '16 at 21:55
-
Ben Goodrich, yes this is exactly what I want! The problem I'm having is the last part: how do I make a likelihood function for the observed data. Is this different than just the vec1 * vec2'? – Chris Dec 18 '16 at 20:31
-
We would need to know more about the observed data to say anything meaningful, but `vec1 * vec2'` would be an input to that likelihood function. – Ben Goodrich Dec 19 '16 at 04:18