I'm working with a dataset $X$ (of length $N$) of count data, which looks like:

enter image description here

I developed a statistical model which can be improved, so I'm asking for any suggestions, for instance, differnet likelihoods or prior selection, different approach, anything...

My model

I'm trying to get the parameters of the likelihood of the data, so thaht I can get a posterior predictive density function, credible intervals and so on. Let's say, I want to model the generative process of the data given some parameters, $f(X|\theta)$

This data shows a large overdispersion ($\bar X << var(X)$), thus a Poisson likelihood, $f(X|\lambda) \sim \mathcal{Poisson}(\lambda)$, is not a good choice.

Reading literature about count data with overdisperssion, I decided to model $f(X|\lambda)$ as a Negative Binomial distribution, thus $f(X|\lambda) \sim \mathcal NB(r, p)$

Parameter estimation

In order to not to end up with a very complex set-up, I've performed bayesian estiamtion of the hyperameter $p$, letting $r$ be computed from the data: in a Neagative Binomial distribution, $r$ is related to the first and second moments of the distribution following:

$ r = \frac{\mu^2}{\sigma^2 - \mu}, \text then $

$ \hat r = \frac{\bar X^2}{var(X) - \bar X} $

The whole set-up is:

  • Likelihood: $f(X|p) = \mathcal NB(\hat r, p)$
  • Prior: $f(p) = \mathcal Beta (0, 0)$ (non informative, improper prior)
  • Posterior: $f(p|X) = \mathcal Beta (0 + \hat rN, 0 + \sum X)$

which returned the following posterior predictive distribution:

enter image description here

The first and second moments of the predictive posterior distribution are very close to those in the data (I've let the data have a huge impact in the posteriors since I've choosen a non-informative prior). Also, the point estimate posterior predictive (using $\mu_p$) does not differ from an averaged predictive posterior distribution over all possible values of $p$.

Once again, any suggestions for improvement?


What about a zero-truncated negative binomial distribution?

  • $\begingroup$ How many data points do you have? How many features? $\endgroup$
    – Peter
    Aug 21, 2020 at 19:29
  • $\begingroup$ 10^4 data points, no features at the moment... are you thinking in performin regression with some features? I could add as features the number of pages per document, for instance $\endgroup$
    – ignatius
    Aug 21, 2020 at 19:45
  • $\begingroup$ I was mistaken, thinking you are doing regression here... Maybe you can add a little context $\endgroup$
    – Peter
    Aug 21, 2020 at 19:51
  • 1
    $\begingroup$ I trying to estimate the parameter $p$ of the likelihood function, so that I can end up with credible intervals, momemts, and so on... I'll clarify it in the post $\endgroup$
    – ignatius
    Aug 21, 2020 at 19:53

1 Answer 1


One option is to estimate a non-parametric function. Instead of assuming a functional form of the data, use something like kernel density estimation (KDE) to estimate the probability density function.

Another option is bootstrap sampling to get credible intervals and other statistics.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.