Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generators for Poisson and Binomial distributions with different tradeoffs #27

Open
Shimuuar opened this issue Nov 22, 2013 · 5 comments

Comments

@Shimuuar
Copy link
Collaborator

Currently library allows to generate Poisson and binomial random variate using condensed tables algorithm. It is very fast but require building lookup table which is costly. It makes this algorithm unsuitable for cases when only few samples for given parameters are required. For examples when parameters are random variables themselves

@Shimuuar
Copy link
Collaborator Author

There's post about algorithm for generation of Poisson random variates. Algorithm is noce and simple but requires dependency on math-functions (it needs logFactorial).

http://www.johndcook.com/blog/2010/06/14/generating-poisson-random-values/

@cspollard
Copy link

I am trying to figure out whether the issue I have is related. My system is using many GB (I last stopped it at 25 GB!) of memory to do something that perhaps ought to be simple:

> withSystemRandom . asGenIO . sample $ poisson 10000

I guess this is from the table generation. Is this expected given the current setup?

@Shimuuar
Copy link
Collaborator Author

Yes. It's problem with condensed tables. See #59

@jarandaf
Copy link

This is what R uses, might be of help for a possible implementation.

@Shimuuar
Copy link
Collaborator Author

Thank you! Although I don't think I'll have time anytime soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants