crflynn / stochastic

Generate realizations of stochastic processes in python.
http://stochastic.readthedocs.io/en/stable/
MIT License
451 stars 80 forks source link

New Continuous Process: Mixed Poisson #7

Closed Gabinou closed 6 years ago

Gabinou commented 6 years ago

This continuous stochastic process generates points distributed according to a rate generated from an arbitrary random distribution. I refer to the random distribution used to generate this rate is known as the information distribution.

The user would need to supply a random distribution in its parameters upon first call (numpy functions such as numpy.random.uniform). Then, a rate would be generated upon initialization. Upon each call of the sample method, a new random rate would be generated using the information distribution.

Since this is a Poisson Process, the suggested MixedPoissonProcess class is very similar to the PoissonProcess class. Additionnal methods are setters and getters for the information process and parameters. Upon each call of the setters, a new rate is generated. Another additional method is the genrate method, which generates a new random rate using the previously supplied information distribution and parameters.

crflynn commented 6 years ago

I saw your PR for this process but I think it might be simpler to just subclass PoissonProcess and make use of the already existing code. Additionally, you would need to

Gabinou commented 6 years ago

Following your comments and suggestions, I have implemented changes:

Still to be implemented is:

Is the pull request in a more acceptable state? And thank you for your comments and help.

crflynn commented 6 years ago

This is ok but there are still a lot of issues that need to be addressed.

I think I might merge this into a separate dev branch and clean it up if you don't mind. I'm hoping that maybe you'll track the changes closely and if needed I can explain the reasoning for them. Is that ok?

Gabinou commented 6 years ago

This sounds marvelous. When it is up to scratch, I will use it as a template for my future pull requests.

Thank you very much!

crflynn commented 6 years ago

I requested some changes in the PR. Please address them. Thanks.

Gabinou commented 6 years ago

All changes were addressed. If this makes this feature acceptable, I will get to upgrading other features also.

crflynn commented 6 years ago

@Gabinou I have merged your PR #8 and made several changes that I think make the implementation a bit cleaner. You may refer to the commits in the mixed branch for the changes. Thanks for contributing.