# Hyerarchical negative binomial process

#1

Hello,

I have been working for a month to model a serie of negative binomial distribution, and I couldn’t come with stable priors. Obviously I lack some more fundamental knowledge.

if I have:

y[n,g] ~ negative_binomial_2(mu[g], sigma[g]);
mu[g] ~ gamma(alpha[g], beta[g]);

to use this in a mixed model in which alphas and betas have different relations and value ranges I need to find the priors for alphas and betas

for example

alpha[g] ~ ?(par1, par2)
beta[g] ~ ?(par3, par4)

Even with bad modelling I observed that for two classes of data I have two distinct distributions of

par1,2,3,4 (class 1)
par1,2,3,4 (class 2)

and alphas and betas are correlated possibly with a quadratic distribution

What hyper distributions can I use? I have tried to stick with real alpha and vector beta giving beta a gamma prior and many other things but a correct prior seem to exist only if alpha or beta are known, but here they are both parameters.

And stack exchange propose a solution if alpha beta both unknown, but at the end doesn’t lead to anything I can practically implement in stan https://stats.stackexchange.com/questions/2635/conjugate-prior-for-a-gamma-distribution

There is a conjugate prior for the Gamma distribution developed by Miller (1980) whose details you can find on Wikipedia and also in the pdf linked in footnote 6. Checkout section 3.2 on page 25 of this paper, there is a prior with four parameters: p, q, r, & s

Thanks a lot. I’m getting lost after a lot of work.

Gamma(.., ..)^2 -> generalized_gamma(?, ?, ?)
#2

It’s hard to follow these model fragments without knowing the shapes of parameters like `mu[g]`. Also, if you use triple back ticks, it’ll quote code properly.

You may want to try to build out from fixed values for some parameters. Then you can introduce relatively tight priors around those fixed values and see what happens, then gradually loosen everything up.

Use fake data simulation to debug your program independently from applying it to whatever data you care about (then you’ll know if it’s a bug in the model or misspecification leading to problems).

I don’t specifically know what prior distributions to recommend for your problem—that will depend on what you think valid parameter values are going to be.