tensorflow / probability

Probabilistic reasoning and statistical analysis in TensorFlow
https://www.tensorflow.org/probability/
Apache License 2.0
4.26k stars 1.1k forks source link

Feature Request: Efficient Poisson Binomial PMF/CDF in tfp #1453

Open njwfish opened 3 years ago

njwfish commented 3 years ago

Poisson Binomial distributions (and the more general Poisson Multinomial) crop up all over the place in the social sciences, particularly ecological inference, and linguistics. Having such a distribution in tensorflow would be very valuable to those communities. Efficient implementations exist in R: https://cran.r-project.org/web/packages/PoissonBinomial/PoissonBinomial.pdf

And descriptions for implementing the most recent algorithm can be found here: https://www.sciencedirect.com/science/article/pii/S0167947318300082?via%3Dihub

mveramiranda commented 2 years ago

Hello! I will try to work on adding this distribution; it is my first issue :). I will begin implementing one or two of the exact methods to add the support.

njwfish commented 2 years ago

Excited this is getting attention - let me know if I can be helpful!

maknarang29 commented 1 year ago

Hi! Is this issue still up for grab? If so I'd like to work on this

njwfish commented 1 year ago

I believe so yes! @mveramiranda started a version here it looks like but I don’t know how far they got. Certainly not a full implementation. https://github.com/mveramiranda/probability/tree/poisson-binomial-first-draft

njwfish commented 1 year ago

Hi @maknarang29 just want to check if you are working on this. If not I might finally take a look at it, so please let me know!

maknarang29 commented 1 year ago

Hi @maknarang29 just want to check if you are working on this. If not I might finally take a look at it, so please let me know!

Hi, apologies for the delay, I have started working upon the issue, shall update upon my progress soon. I do have a few doubts and was wondering if I can ask here?

njwfish commented 1 year ago

Feel free!

maknarang29 commented 1 year ago

Hi, I have implemented the DC-FFT using pyfftw, I was wondering if that is allowed or should i use scipy or some other package since pyfftw is third party package

njwfish commented 1 year ago

You should use the native tensorflow fft: https://www.tensorflow.org/api_docs/python/tf/signal/fft

njwfish commented 1 year ago

Just following up here!

maknarang29 commented 1 year ago

Just following up here!

HI! apologies, I got caught up in exams. Shall show you the final draft in a week's time

aryangupta01 commented 11 months ago

Is this issue still open or resolved ? I am interested to work on it.

njwfish commented 11 months ago

Yep, still open!