The pdf of a negative binomial is

$$θ(X=x)= \left( \begin{array}{c} x+j-1 \\ x \end{array} \right)(1-θ)^xθ^j,$$

How would I create the likelihood of this function in order to maximize θ?And how does the likelihood change if there is n observations vs. 1 observation?

So far, I have that the likelihood is

∏ (j + x − 1 C x)θ^j(1-θ)^x

which is simplified to (through the derivative of the log-likelihood)


Meaning that jn/θ=∑X/1-θ

I solved for theta and have:

θ-hat= jn/(jn+∑x)

Is there something wrong? If so, where?

Something extra:

(The alternative pdf is $$P(X=x|j,θ)= \binom{x-1}{j-1}θ^{j}(1-θ)^{x-j}$$

would it yield the same likelihood?)

  • $\begingroup$ $\theta$ should be $p$ on RHS? $\endgroup$
    – kodlu
    Aug 16, 2015 at 5:02
  • $\begingroup$ yes, I modified it to be consistent. $\endgroup$
    – nodel
    Aug 16, 2015 at 5:03
  • $\begingroup$ en.wikipedia.org/wiki/… $\endgroup$
    – user140541
    Aug 16, 2015 at 5:27
  • $\begingroup$ I'm not quite sure why the gamma function is used $\endgroup$
    – nodel
    Aug 16, 2015 at 5:33
  • 1
    $\begingroup$ I solved for θ and can't see why my answer doesn't match the wiki's? How come they have a summation on the top? $\endgroup$
    – nodel
    Aug 16, 2015 at 6:12

1 Answer 1


You are using the PDF

$$P(X = x|j, \theta) = {x + j - 1 \choose x}\theta^j(1-\theta)^{x},$$ for $x = 0, 1, \dots$, where $x$ is the number of failures observed before seeing the $j$th success and $\theta$ is the probability of success on any one trial. I am being fussy about writing everything out in full, because (as you will see) every detail is important here.

With data $X_1, X_2, \dots, X_n,$ you set the partial derivative of the loglikelihood function equal to $0$ to find the estimator

$$\hat \theta = \frac{jn}{jn + T},$$ where $T = \sum_{i=1}^n x_i,$ which is the total number of failures seen while waiting for $nj$ successes.

If I read the notes on your derivation correctly, I think you did it correctly.

Furthermore, this estimator of $\theta$ makes sense, because the numerator is the number of successes observed and the denominator is the total number of trials performed.

Now to try to clear up some of your additional questions in the original post and arising from Comments.

(1) What changes if $n = 1$? There is no product sign in the likelihood and so summation sign in the equation to solve for the estimator. The estimator becomes $\hat \theta = j/(j + x).$ Again the estimator is the ratio of the number $j$ of successes to the total number of trials until those $j$ successes are observed.

2) If you change to the alternative PDF, the estimator will still be the number $nj$ of success divided by the total number of trials necessary to to observe them. However, the equation will not look the same, because this is the PDF of a different random variable. Now $X$ is defined as the total number of $trials$ (not $failures$) until $nj$ successes are seen. This random variable takes values $x = j,\, j+1,\, j+2,\, \dots.$

3) Your answer is not the same as the one in Wikipedia because the random variable there counts the number of $successes$ until (in your notation) $nj$ failures are observed. (I frequently refer questioners to Wikipedia, but not always. Sometimes is is not at the right level, has confusing notation, or formulates an issue in a different way than in the problem posted. Sometimes Wikipedia is helpful, sometimes not; here I think not.)

Please check everything here. I am not the world's best proofreader. And leave a Comment for me if there are unresolved issues about your question. I, or someone else, will try to help.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .