0

Can anyone give me a hand for this derivative and how to avoid polygamma for coding propose.

I have the derivative of binomial distribution as follows:

$\frac{df(x)}{dx} = \binom{n}{x}p^x(1-p)^{n-x}ln[\frac{p}{(1-p)}]+p^x(1-p)^{n-x}\frac{d}{dx}\binom{n}{x}$

I find out that the derivative of binomial coefficient lead to polygamma:

$\frac{d}{dx}\binom{n}{x} = \binom{n}{x}[\psi(1-x+n)-\psi(x+1)]$

My first question is whether my derivative is right. If it is right then I would like to ask for programing sake, could someone help me rewrite the polygamma as summation or something else just to be able to understand how to compute this function. I just find the derivative of binomial coefficient from Wolfram. Please help and thank you in advance.

Roots
  • 1
  • The binomial probability ${n \choose x} p^x (1-p)^x$ is defined for integers $x$ from $0$ to $n$. Why do you want to consider $x$ to be a continuous variable? If you're just trying to find the maximum value, there are better ways. – Robert Israel Nov 05 '17 at 06:47
  • I am really new in this and would like someone to point me in the right direction if my approach is wrong. Would mind directing me which better way I should use – Roots Nov 05 '17 at 07:03
  • I am really new with this and if there is a better way to find the maximum value of x then I would greatly appreciate if someone could point me in the right direction – Roots Nov 05 '17 at 07:13
  • Hint: ${n \choose x+1} = \frac{n-x}{x+1} {n \choose x} $. – Robert Israel Nov 05 '17 at 07:42
  • Does this mean replacing: $\frac{d}{dx}\binom{n}{x}=\frac{n-x}{x+1}\binom{n}{x}$ – Roots Nov 05 '17 at 16:20
  • Can you elaborate on the hint? I still don’t know how to proceed. – Roots Nov 06 '17 at 05:13
  • The maximum occurs at the least $x$ such that ${n \choose x+1} p^{x+1} (1-p)^{n-x-1} \le {n \choose x} p^x (1-p)^{n-x}$. – Robert Israel Nov 06 '17 at 05:52
  • Thanks a lot Robert!! That’s what I need! Appreciated – Roots Nov 06 '17 at 06:40

1 Answers1

0

In his comment, Robert Israel pointed out the key issue.

In the post, you ask "could someone help me rewrite the polygamma as summation ?"

Well, you can rewrite $$\frac{d}{dx}\binom{n}{x} = \binom{n}{x}\left(\psi(1-x+n)-\psi(x+1)\right)=\binom{n}{x} \left(H_{n-x}-H_x\right)$$ where appear harmonic numbers.

But, just have a look here.

  • Thanks Claude and Robert! Yes, I did assume x to be a continuous, but as I said I am new in this and will look further on your comments and hints. – Roots Nov 05 '17 at 07:50