4
$\begingroup$

I have a question concerning the ML-estimation of the trials of a Binomial variable. The setting is the following:

I have a random variable $X\sim Bin(n,p)$ with $n\in\mathbb{N}$ unknown, $p\in (0,1)$ the known success probability and with density (w.r.t. to the counting measure) $p_n(x)=\binom{n}{x}p^x(1-p)^{n-x}=:L_x(n)$. The log-likehood function is therefore given by $$l_x(n)=\log L_x(N)=\log(n!)-\log(x!)-\log((n-x)!)+x\log(p)+(n-x)\log(1-p) .$$ Maximizing $l_x(n)$ w.r.t. to $n$ is equivalent to maximizing $\log(n!)-\log((n-x)!)+n\log(1-p)$ or $\frac{n!}{(n-x)!}(1-p)^n$.

My problem is that I don't know how to proceed from here. A person in this thread Maximum likelihood estimate of $N$ (trials) in Binomial suggested that a solution is given by $\hat{n}=X/p$. However, $X/p\notin \mathbb{N}$ for most $p$, so I suspect that this can't be the answer.

$\endgroup$
7
  • $\begingroup$ This might help. $\endgroup$
    – TheSimpliFire
    Jan 30, 2018 at 16:47
  • $\begingroup$ Thx, but this is deriving the MLE for p not n $\endgroup$
    – J.Kar
    Jan 30, 2018 at 16:50
  • $\begingroup$ Can you follow the procedure and adapt it so it fits your variable? $\endgroup$
    – TheSimpliFire
    Jan 30, 2018 at 16:56
  • $\begingroup$ I don't see how the "standard MLE procedure" applies here. Taking the derivative of the log likelihood functino wrt to $n$ ends up with messy terms involving the derivative of $n!$ $\endgroup$
    – J.Kar
    Jan 30, 2018 at 17:14
  • $\begingroup$ I think the result might turn messy, but do you know about the gamma function? $\endgroup$
    – TheSimpliFire
    Jan 30, 2018 at 17:19

1 Answer 1

6
$\begingroup$

Consider $\dfrac{{n+1 \choose x}p^x(1-p)^{n+1-x}}{{n \choose x}p^x(1-p)^{n-x}} = \dfrac{(n+1)}{(n+1-x)}(1-p)$ which is less than $1$ when $n > \dfrac{x}{p}-1$, and so choosing $n+1$ in such a case would not give you a maximum likelihood estimate

Thus, given $x$ and $p$, your maximum likelihood estimate of $n$ is $\bigg\lfloor\dfrac{x}{p}\bigg\rfloor$ (rounding down)

unless $\dfrac{x}{p}$ is an integer in which case there are two with equal likelihood: $\dfrac{x}{p}-1$ and $\dfrac{x}{p}$

$\endgroup$
6
  • $\begingroup$ thx a lot, I got it now! $\endgroup$
    – J.Kar
    Jan 30, 2018 at 19:39
  • 2
    $\begingroup$ I didn't get it at all. Why should I consider this division term? Why would I want to choose n+1 ? Why should I be rounding down and not up? $\endgroup$ Feb 10, 2020 at 17:29
  • 1
    $\begingroup$ @DavidRefaeli One way of finding whether one likelihood is greater than another is to divide one by the other and compare the result with $1$. The actual division shows that any choice over $\frac x p$ does not give a maximum and also that any choice below $\frac x p -1 $ also fails to give a maximum. That is why you round down $\endgroup$
    – Henry
    Feb 10, 2020 at 17:37
  • $\begingroup$ @Henry ok. Suppose I have 3 results of 4,5,6. And that p is 13/15. Rounding down will give me 17 if I take the total (from 17.3), or 5 if I take the average (from 5.7). Which is clearly wrong, as I have a result of 6, meaning that the minimal n is 6, or 18 for total. What am I missing? $\endgroup$ Feb 10, 2020 at 19:52
  • 2
    $\begingroup$ @DavidRefaeli In the original question there was a single sample. There is an implicit indicator function in that that for the likelihood to be non-zero you need $n \ge x$ but that is not a problem as $\lfloor\frac{x}{p}\rfloor \ge x$. In your example with three samples, the maximum likelihood estimator would be different both because you start with $\prod\limits_i \frac{{n+1 \choose x_i}p^{x_i}(1-p)^{n+1-x_i}}{{n \choose x_i}p^{x_i}(1-p)^{n-x_i}}=\frac{(n+1)^3}{\prod(n+1-x_i)}(1-p)^3$ and because the estimator should explicitly be at least $\max(x_i)$ $\endgroup$
    – Henry
    Feb 10, 2020 at 21:08

You must log in to answer this question.

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