3

The Poisson-Binomial distribution concerns the probability of the number of successes in a sequence of independent Bernoulli trials with different probabilities of success. This is a generalization of the Binomial distribution.

With the command dpoibin, in the poibin package, one can obtain the mass probability function. For instance, with this command:

library(poibin)
n <- 100
Probs_Success <- runif(n)
dpoibin(kk = 30, pp = Probs_Success)

one can obtain the probability of getting 30 successes in a sequence of 100 independent Bernoulli trials with probabilities of success contained in the vector Probs_Success. To compute this probability one has to sum the probabilities of all possible sequences of lenght 100 where there are 30 successes and 70 failures.

Question: How can I efficiently obtain all of the summands that generate the above probability in R? Thanks a lot for your help.

For those who are interested in the problem that motivated this question, please click on the following link:

https://math.stackexchange.com/questions/2924831/bivariate-poisson-binomial-distribution

Student1981
  • 319
  • 1
  • 8
  • Not sure what question is about. Isn't `dpoibin` already doing it for you? Or you want code which independently verify `dpoibin` output? – Severin Pappadeux Sep 24 '18 at 17:17
  • Thanks for your interest, @SeverinPappadeux. The R-command dpoibin provides the sum of all summands. I need the set of all summands to perform another operation with them. I am writing the reason that motivates my question. I will let you know when I finish. – Student1981 Sep 24 '18 at 17:21
  • There are 100 choose 30, which is 29372339821610944823963760 terms in a naive expression for that. There is no efficient way to generate that list. I would strongly reconsider how you're trying to perform the other operation so that you don't need to work with the whole list. (I presume that `dpoibin` uses a dynamic programming technique to keep from working with the whole list itself. Anything else would be a disaster.) – btilly Sep 24 '18 at 17:32
  • I appreciate your interest, @btilly. Thanks for the advice. I am working on a problem that motivates my question. I will let you know when I finish to write this problem. – Student1981 Sep 24 '18 at 17:35
  • Dear @btilly, I updated my question with a link to the problem I am working on if you are interested on it. Thanks. – Student1981 Sep 24 '18 at 19:11
  • Dear @SeverinPappadeux, I updated my question with a link to the problem I am working on if you are interested on it. Thanks. – Student1981 Sep 24 '18 at 19:11
  • 1
    I answered this question there. I answered it in Python rather than R because I know that language better. Hopefully the translation isn't too hard for you. – btilly Sep 24 '18 at 21:15
  • Thank you very much for your answer, @btilly. In addition, I will take advantage of it to learn Python. – Student1981 Sep 24 '18 at 21:21
  • Did you look at https://www.sciencedirect.com/science/article/pii/S0167947312003568?via%3Dihub – Severin Pappadeux Sep 24 '18 at 21:57
  • Yes I did, @SeverinPappadeux. In addition, I am examining the direct convolution algorithm Biscarri et al. (2018) propose. https://www.sciencedirect.com/science/article/pii/S0167947318300082 – Student1981 Sep 24 '18 at 22:10

1 Answers1

0

I solved the problem that motivated the above question. This solution is based on the paper

https://www.tandfonline.com/doi/abs/10.1080/03610918708812585

To see this solution, just click on the following link

https://math.stackexchange.com/questions/2924831/bivariate-poisson-binomial-distribution

Thank all people who provided me suggestions.

Student1981
  • 319
  • 1
  • 8