1

Suppose that I have sampled counts $x_{1}\sim Bin(N,p), \ x_{2}\sim Bin(N-x_{1},p), \ x_{3} \sim Bin(N-x_{1}-x_{2},p)$. My goal is to find the maximum likelihood estimate for $N$.

If I write down the likelihood and discard all the terms that are not $N$, I end up with

$$L(N|x_{1},x_{2},x_{3})\propto \frac{N!}{(N-x_{1}-x_{2}-x_{3})!}(1-p)^{3N}$$

know we know that in order to derive the maximum for $N$ we have to take the logarithms and calculate the derivative with respect to $N$.

So, this would be

$$\frac{dl(N|x_{1},x_{2},x_{3})}{dN}\approx log(N) - \frac{dlog(N-x_{1}-x_{2}-x_{3})!}{dN} +log(1-p)^{3}=0$$

However, I do not know how to calculate the $\frac{dlog(N-x_{1}-x_{2}-x_{3})!}{dN}$ in a convenient closed form solution, what is it going to be?? I know that $\frac{dN!}{dN}\approx \log(N)$ but for the $(N-x_{1}-x_{2}-x_{3})!$ I am completely clueless. Is there an approximation in a closed form or an analytical solution?

Now, if I use the stirlings approximation for the $log(N-x_{1}-x_{2}-x_{3})!$, then my equation will be

$$\frac{dl(N|x_{1},x_{2},x_{3})}{dN}\approx log(N) + \frac{1}{2(N-x_{1}-x_{2}-x_{3})}-log(N-x_{1}-x_{2}-x_{3}) +log(1-p)^{3}=0$$

which I don't know how to solve for $N$.

Jonathan1234
  • 1,063
  • +1, interesting question. How do you know that $\frac{dN!}{dN} \approx \ln N$? Is that derived through the $\Gamma(\cdot)$ function somehow? – gt6989b Sep 19 '22 at 16:43
  • @gt6989b I've seen it from here https://demonstrations.wolfram.com/DerivativeOfLogX/ – Jonathan1234 Sep 19 '22 at 16:46
  • 1
    Right. So they do interpret the factorial as a $\Gamma$, which makes it continuous and allows differentiating. They also claim equality in the limit sense only, so for small values of the argument, the approximating may be quite far off. Interesting, thank you. – gt6989b Sep 19 '22 at 16:49
  • @gt6989b In my case I can regard the $N>100$ or even more, but it seems non trivial how to derive it :/ – Jonathan1234 Sep 19 '22 at 16:50
  • Some related ideas here: https://math.stackexchange.com/questions/1246766/derivative-of-the-gamma-function – gt6989b Sep 19 '22 at 17:23
  • you can also use Stirling's formula to approximate for large $N$ – gt6989b Sep 19 '22 at 17:25
  • @gt6989b yes I've already seen it but it doesn't really help with the derivation that I want to do. I think based is to create a different question that actually formulates better the question – Jonathan1234 Sep 19 '22 at 17:53
  • Why doesn't it help? You basically have $N! = \Gamma(N+1)$, so $(N-a-b-c)! = \Gamma(N-a-b-c+1)$ and you can differentiate as before? – gt6989b Sep 19 '22 at 17:55
  • @gt6989b I added further details. I think if I use the stirlings approximation i'll end up having an equation of the form $N + log(N)$ which I cannot maximize for $N$ in a closed form version. I want to distinguish $N$ from all the rest – Jonathan1234 Sep 19 '22 at 18:00
  • 1
    What's wrong with using the chain rule? – Merosity Sep 19 '22 at 18:16
  • @Merosity Can you elaborate please? You mean to write analytically the $(N-x_{1}-x_{2}-x_{3})!$ and then take the derivative? – Jonathan1234 Sep 19 '22 at 18:23
  • @Jonathan1234 For The closed form, Have a look at: https://math.stackexchange.com/questions/973823/maximum-likelihood-estimate-of-n-trials-in-binomial – whoisit Sep 20 '22 at 00:18
  • @KB Thank you finally managed to bring it to a closed form – Jonathan1234 Sep 20 '22 at 16:52

0 Answers0