## Hierarchial or mixed models, Dirichlet priors, modelling and inference help...

Hi,

I'm new to Bayesian inference but I have read what I have found about the subject and believe I have an understanding about the basic concepts. I'm still confused about some concepts and the following problem illustrates this. It's not a homework but an example that I've designed that I can't figure out how to model properly.

Let's say we have K biased N-sided dice with different bias, stored in a bag. I have a guess based on the looks, about what bias each die has. Repeatedly, I take one die from the bag and roll it once, remembering the result, and then put it back.

So by my understanding: the outcome o of a single die roll comes from a categorical distribution with unknown parameters p. p comes from a Dirichlet prior with hyperparameters t, that before any observations has a value that depends on how the die looks. p is dependent on the outcome of picking a die, d, which belongs to a categorical distribution with a Dirichlet prior a(k) = 1

I'm not sure if this is the correct way to describe the problem since I believe I'm confusing a hierarchial model with a mixed model approach (or if it's the same thing).

Anyhow, given this problem, I want to do two things:
1) Infer the posterior distribution over d, given one dice roll o(i).
2) Infer the posterior distribution over p | d, given one dice roll o(i)

For 1), I think I can do this by marginalising over d and p | d ?

For 2), For a case if I knew which die it was, I have understood that when using a Dirichlet prior, there is a closed form solution posterior = D(a + n).
But in my case, I will not be certain about which die I used. I want the posterior distribution p(k) | (d(k), o(i)) for every k. I don't know how to express this through the solution D(a + n).

I tried on my own:
p|(d,o) = (d,o) | p * p / (d,o) = o|p * d|(o,p) * p / (d * o | d)

I have d, o|d can obtain from marginalising over d and p, p can obtain from marginalising over d, I have o|p, so I only need d|(o,p)

d|(o,p) = (d,o) | p / o|p = p |(d,o) * d|o / p|o = p|(d,o) * o|d * d / p|d * o

I have everything except p|(d,o).

So, my system is underdetermined? I have two unknowns p|(d,o) and d|(p,o) which depend on each other.

But I should be able to make some kind of inference?

Regards